import type { LexiconPlugin } from "../../lexicon.js"; import type { McpRequest, McpResponse } from "./types.js"; /** * The name a lexicon's MCP tool is registered under: `:`, * whether or not the lexicon already wrote the prefix itself (#1341). */ export declare function namespacedToolName(lexicon: string, name: string): string; /** * The URI a lexicon's MCP resource is registered under: `chant:///`. * * Three authored forms reach here (#1341). The bare path is the intended one. * `createCatalogResource` emits `:resource-catalog`, and * `lexicon-authoring/lsp-mcp.mdx` taught `chant://lexicon//` — * which azure followed, and which produced the unusable * `chant://azure/chant://lexicon/azure/catalog`. */ export declare function namespacedResourceUri(lexicon: string, uri: string): string; /** * MCP Server implementation */ export declare class McpServer { private tools; private toolHandlers; private pluginResources; constructor(plugins?: LexiconPlugin[]); /** * Register tools contributed by a plugin, namespaced as `lexicon:toolName`. * * Namespacing is idempotent (#1341). Core is not the only place that applies * a prefix: `createDiffTool` in ../../lexicon-plugin-helpers.ts already emits * `${lexiconName}:diff`, and eleven lexicons write the prefix into the name by * hand. Applying it unconditionally produced `gitlab:gitlab:diff` and * `aws:aws:diff` in every `chant serve mcp` session, while every doc named the * single-prefixed form. A tool declared either way now registers under exactly * one namespace. */ private registerPluginTools; /** * Register resources contributed by a plugin, namespaced as * `chant://lexicon/uri`, idempotently — see {@link registerPluginTools}. */ private registerPluginResources; /** * Register a tool with its handler */ private registerTool; /** * Handle incoming MCP request */ handleRequest(request: McpRequest): Promise; /** * Dispatch request to appropriate handler */ private dispatch; /** * Handle tools/call request */ private handleToolsCall; /** * Start the MCP server on stdio */ start(): Promise; } /** * Start MCP server, loading plugins from the project */ export declare function startMcpServer(): Promise; //# sourceMappingURL=server.d.ts.map