@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
86 lines (85 loc) • 3.56 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteApiToolArgs = exports.PatchApiToolArgs = exports.PutApiToolArgs = exports.PostApiToolArgs = exports.RequestWithBodyArgs = exports.GetApiToolArgs = exports.OutputFormat = void 0;
const zod_1 = require("zod");
/**
* Output format options for API responses
* - toon: Token-Oriented Object Notation (default, more token-efficient for LLMs)
* - json: Standard JSON format
*/
exports.OutputFormat = zod_1.z
.enum(['toon', 'json'])
.optional()
.describe('Output format: "toon" (default, 30-60% fewer tokens) or "json". TOON is optimized for LLMs with tabular arrays and minimal syntax.');
/**
* Base schema fields shared by all API tool arguments
* Contains path, queryParams, jq filter, and outputFormat
*/
const BaseApiToolArgs = {
/**
* The API endpoint path (without base URL)
* Examples:
* - "/wiki/api/v2/spaces" - list spaces
* - "/wiki/api/v2/spaces/{id}" - get space
* - "/wiki/api/v2/pages" - list/create pages
* - "/wiki/api/v2/pages/{id}" - get page
* - "/wiki/api/v2/pages/{id}/body" - get page body
*/
path: zod_1.z
.string()
.min(1, 'Path is required')
.describe('The Confluence API endpoint path (without base URL). Must start with "/". Examples: "/wiki/api/v2/spaces", "/wiki/api/v2/pages", "/wiki/api/v2/pages/{id}"'),
/**
* Optional query parameters as key-value pairs
*/
queryParams: zod_1.z
.record(zod_1.z.string(), zod_1.z.string())
.optional()
.describe('Optional query parameters as key-value pairs. Examples: {"limit": "25", "cursor": "...", "space-id": "123", "body-format": "storage"}'),
/**
* Optional JMESPath expression to filter/transform the response
* IMPORTANT: Always use this to reduce response size and token costs
*/
jq: zod_1.z
.string()
.optional()
.describe('JMESPath expression to filter/transform the response. IMPORTANT: Always use this to extract only needed fields and reduce token costs. Examples: "results[*].{id: id, title: title}" (extract specific fields), "results[0]" (first result), "results[*].id" (IDs only). See https://jmespath.org'),
/**
* Output format for the response
* Defaults to TOON (token-efficient), can be set to JSON if needed
*/
outputFormat: exports.OutputFormat,
};
/**
* Body field for requests that include a request body (POST, PUT, PATCH)
*/
const bodyField = zod_1.z
.record(zod_1.z.string(), zod_1.z.unknown())
.describe('Request body as a JSON object. Structure depends on the endpoint. Example for page: {"spaceId": "123", "title": "Page Title", "body": {"representation": "storage", "value": "<p>Content</p>"}}');
/**
* Schema for conf_get tool arguments (GET requests - no body)
*/
exports.GetApiToolArgs = zod_1.z.object(BaseApiToolArgs);
/**
* Schema for requests with body (POST, PUT, PATCH)
*/
exports.RequestWithBodyArgs = zod_1.z.object({
...BaseApiToolArgs,
body: bodyField,
});
/**
* Schema for conf_post tool arguments (POST requests)
*/
exports.PostApiToolArgs = exports.RequestWithBodyArgs;
/**
* Schema for conf_put tool arguments (PUT requests)
*/
exports.PutApiToolArgs = exports.RequestWithBodyArgs;
/**
* Schema for conf_patch tool arguments (PATCH requests)
*/
exports.PatchApiToolArgs = exports.RequestWithBodyArgs;
/**
* Schema for conf_delete tool arguments (DELETE requests - no body)
*/
exports.DeleteApiToolArgs = exports.GetApiToolArgs;