import { McpServer } from '@gemstack/mcp'; import type { McpServerOptions } from '@gemstack/mcp'; import type { Connector, Credential } from './types.js'; /** A constructable MCP server: instantiate it for a transport handler or `McpTestClient`. */ export type ConnectorServerClass = new (options?: McpServerOptions) => McpServer; export interface MountOptions { /** Server name advertised to clients. Default `"connectors"`. */ name?: string; /** Server version. Default `"1.0.0"`. */ version?: string; /** Server-level instructions surfaced to the agent. */ instructions?: string; /** * Resolve the credential for a connector at tool-call time. Called with the * connector id before each tool runs; return `undefined` for connectors that * need none. This is the seam the orchestrator implements to satisfy each * connector's declared {@link Connector.auth}. */ credentials?: (connectorId: string) => Credential | undefined | Promise; /** * How tool names are disambiguated across connectors. * - `'prefix'` (default): `"_"`. * - `'none'`: tool names kept verbatim (you must ensure they don't collide). */ namespace?: 'prefix' | 'none'; } /** * Compose any number of connectors into a single MCP server class. Each * connector's tools become MCP tools on one server, namespaced by connector id * so names never collide. The returned class plugs straight into the * @gemstack/mcp surface: instantiate it and hand the instance to a transport * handler (`createMcpHttpHandler`, `createWebRequestHandler`, `startStdio`), or * drive it in tests with `McpTestClient`. * * ```ts * const Server = mountConnectors([github, drive], { * credentials: (id) => ({ token: process.env[`${id.toUpperCase()}_TOKEN`] }), * }) * const handler = createMcpHttpHandler(new Server()) * ``` */ export declare function mountConnectors(connectors: Connector[], options?: MountOptions): ConnectorServerClass; //# sourceMappingURL=mountConnectors.d.ts.map