/** * Wires the in-house `McpRegistry` to the MCP SDK's `McpServer` and * starts the stdio transport. * * Why a separate registry first? See `registry.ts` — we need to gate * writes (allowWrite), serialize calls, and shape error envelopes * before the SDK sees the handler. Here the bridge is intentionally * thin: every registered tool becomes a forwarder that delegates to * `dispatchTool`, every resource becomes a single-URI ReadCallback, * every prompt forwards its args object through unchanged. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import type { McpContextProvider } from "./auth.js"; import type { McpRegistry } from "./registry.js"; export interface McpServerOptions { /** * Lazy provider for the bound `McpContext`. Resolves on first tool / * resource / prompt invocation so the stdio transport can complete * the MCP `initialize` handshake before any keychain access happens. * See `createMcpContextProvider` for the memoization + retry shape. */ getContext: McpContextProvider; registry: McpRegistry; } export declare const buildMcpServer: (options: McpServerOptions) => McpServer; export declare const startStdioTransport: (server: McpServer) => Promise;