UNPKG

@aashari/mcp-server-atlassian-confluence

Version:

Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP in

44 lines (43 loc) 2.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const logger_util_js_1 = require("../utils/logger.util.js"); const error_util_js_1 = require("../utils/error.util.js"); const atlassian_comments_controller_js_1 = require("../controllers/atlassian.comments.controller.js"); const defaults_util_js_1 = require("../utils/defaults.util.js"); // Create logger for this CLI module const logger = logger_util_js_1.Logger.forContext('cli/atlassian.comments.cli.ts'); /** * Register comments-related commands with the CLI * * @param program - Commander program to register commands with */ function register(program) { // Register the command to list comments for a page program .command('ls-page-comments') .description('List comments for a Confluence page, with pagination support.') .requiredOption('-p, --page-id <pageId>', 'The numeric ID of the Confluence page to get comments from. This is required and must be a valid page ID from your Confluence instance.') .option('-l, --limit <limit>', 'Maximum number of comments to return (1-100). Use this to control the response size. Useful for pagination or when you only need a few results.', (val) => parseInt(val, 10), defaults_util_js_1.DEFAULT_PAGE_SIZE) .option('-c, --start <start>', 'Pagination start position (0-based offset). For comments, Confluence uses offset-based pagination via the "start" parameter rather than cursor-based pagination used in other endpoints. The pagination information is included at the end of the response.', (val) => parseInt(val, 10), 0) .action(async (options) => { const methodLogger = logger.forMethod('ls-page-comments'); try { methodLogger.debug('CLI ls-page-comments', options); // Call the controller const result = await atlassian_comments_controller_js_1.atlassianCommentsController.listPageComments({ pageId: options.pageId, limit: options.limit, start: options.start, // Use the default format (ADF) for best results bodyFormat: 'atlas_doc_format', }); // Output the content (which now includes pagination information) console.log(result.content); } catch (error) { (0, error_util_js_1.handleCliError)(error); } }); logger.debug('Registered Confluence comments CLI commands'); } exports.default = { register };