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

94 lines (93 loc) 3.86 kB
"use strict"; /** * Tool for interacting with Confluence inline comments specifically */ Object.defineProperty(exports, "__esModule", { value: true }); const zod_1 = require("zod"); 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"); // Create logger for this file const logger = logger_util_js_1.Logger.forContext('tools/atlassian.inline-comments.tool.ts'); /** * Args schema for listing inline comments only */ const ListInlineCommentsArgsSchema = zod_1.z.object({ /** * The ID of the page to get inline comments for */ pageId: zod_1.z .string() .min(1) .describe('The ID of the Confluence page to retrieve inline comments for'), /** * Include resolved inline comments */ includeResolved: zod_1.z .boolean() .default(false) .describe('Include resolved inline comments in the results (default: false)'), /** * Sort order for inline comments */ sortBy: zod_1.z .enum(['created', 'position']) .default('position') .describe('Sort by creation date or document position (default: position)'), /** * Maximum number of results to return */ limit: zod_1.z .number() .int() .min(1) .max(100) .default(25) .describe('Maximum number of inline comments to retrieve (1-100)'), /** * Starting point for pagination */ start: zod_1.z .number() .int() .min(0) .default(0) .describe('Starting point for pagination (used for retrieving subsequent pages of results)'), }); /** * Handle the request to list inline comments only for a page * @returns {Promise<{ content: Array<{ type: 'text', text: string }> }>} MCP response with formatted inline comments list */ async function handleListInlineComments(args) { const methodLogger = logger.forMethod('handleListInlineComments'); try { methodLogger.debug('Tool conf_ls_inline_comments called', args); // Call the new controller method for inline comments const result = await atlassian_comments_controller_js_1.atlassianCommentsController.listInlineComments({ pageId: args.pageId, includeResolved: args.includeResolved, sortBy: args.sortBy, limit: args.limit, start: args.start, }); // Format the response for MCP return { content: [{ type: 'text', text: result.content }], }; } catch (error) { methodLogger.error('Tool conf_ls_inline_comments failed', error); return (0, error_util_js_1.formatErrorForMcpTool)(error); } } /** * Register all inline comment-related tools */ function registerTools(server) { const registerLogger = logger.forMethod('registerTools'); registerLogger.debug('Registering Confluence inline comments tools...'); // Register the list inline comments tool server.tool('conf_ls_inline_comments', 'Lists ONLY inline comments for a Confluence page, identified by `pageId`. Filters out regular page comments and shows only comments attached to specific text selections. Includes highlighted text context and comment content in Markdown format. Supports filtering by resolution status and sorting by document position or creation date. Use this instead of `conf_ls_page_comments` when you specifically need inline comments that reference particular text passages. Requires Confluence credentials to be configured.', ListInlineCommentsArgsSchema.shape, handleListInlineComments); registerLogger.debug('Successfully registered Confluence inline comments tools'); } exports.default = { registerTools };