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

106 lines (105 loc) 4.09 kB
import { AtlassianCredentials, TransportResponse } from '../utils/transport.util.js'; /** * Supported HTTP methods for API requests */ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * Request options for API calls */ export interface ApiRequestOptions { method?: HttpMethod; queryParams?: Record<string, string>; body?: Record<string, unknown>; } /** * Validates and returns Atlassian credentials * @throws {McpError} If credentials are missing * @returns {AtlassianCredentials} Valid credentials */ export declare function validateCredentials(): AtlassianCredentials; /** * Normalizes the API path by ensuring it starts with / * @param path - The raw path provided by the user * @returns Normalized path */ export declare function normalizePath(path: string): string; /** * Appends query parameters to a path * @param path - The base path * @param queryParams - Optional query parameters * @returns Path with query string appended */ export declare function appendQueryParams(path: string, queryParams?: Record<string, string>): string; /** * Makes a generic API request to the Confluence API * * @param path - API endpoint path (e.g., '/wiki/api/v2/spaces') * @param options - Request options including method, queryParams, and body * @returns Promise resolving to the raw API response with rawResponsePath * @throws {McpError} If credentials are missing or API request fails * * @example * // GET request * const spaces = await request('/wiki/api/v2/spaces', { * method: 'GET', * queryParams: { limit: '10' } * }); * * @example * // POST request * const page = await request('/wiki/api/v2/pages', { * method: 'POST', * body: { spaceId: '123', title: 'New Page', ... } * }); */ export declare function request<T = unknown>(path: string, options?: ApiRequestOptions): Promise<TransportResponse<T>>; /** * Makes a GET request to the Confluence API * @param path - API endpoint path * @param queryParams - Optional query parameters * @returns Promise resolving to the API response with rawResponsePath */ export declare function get<T = unknown>(path: string, queryParams?: Record<string, string>): Promise<TransportResponse<T>>; /** * Makes a POST request to the Confluence API * @param path - API endpoint path * @param body - Request body * @param queryParams - Optional query parameters * @returns Promise resolving to the API response with rawResponsePath */ export declare function post<T = unknown>(path: string, body?: Record<string, unknown>, queryParams?: Record<string, string>): Promise<TransportResponse<T>>; /** * Makes a PUT request to the Confluence API * @param path - API endpoint path * @param body - Request body * @param queryParams - Optional query parameters * @returns Promise resolving to the API response with rawResponsePath */ export declare function put<T = unknown>(path: string, body?: Record<string, unknown>, queryParams?: Record<string, string>): Promise<TransportResponse<T>>; /** * Makes a PATCH request to the Confluence API * @param path - API endpoint path * @param body - Request body * @param queryParams - Optional query parameters * @returns Promise resolving to the API response with rawResponsePath */ export declare function patch<T = unknown>(path: string, body?: Record<string, unknown>, queryParams?: Record<string, string>): Promise<TransportResponse<T>>; /** * Makes a DELETE request to the Confluence API * @param path - API endpoint path * @param queryParams - Optional query parameters * @returns Promise resolving to the API response with rawResponsePath */ export declare function del<T = unknown>(path: string, queryParams?: Record<string, string>): Promise<TransportResponse<T>>; declare const _default: { request: typeof request; get: typeof get; post: typeof post; put: typeof put; patch: typeof patch; del: typeof del; validateCredentials: typeof validateCredentials; normalizePath: typeof normalizePath; appendQueryParams: typeof appendQueryParams; }; export default _default;