/** * MCP Registry Types * * Types derived from the external-mcp.json registry file. * This ensures the MCPTool type stays in sync with the registry. * * Note: this module is intentionally NOT validated against * `mcp/mcp-server-config.schema.ts` (the schema used at runtime connection * time in `mcp-client-manager.service.ts`/`di/container.ts`). It runs once at * module load, synchronously, over the package's own bundled * `data/external-mcp.default.json` — never a plugin- or user-supplied file — * and only ever reads `.id`/`.name` to build compile-time type unions and * lookup tables. It never reads `command`/`args`/`env`/`url`, so there is no * unvalidated security-sensitive data flowing from here into `connect()`. * If this module starts reading those fields, or starts accepting * non-bundled input, it must be validated the same way. */ /** * Known MCP server IDs from the registry * When adding a new MCP server, add its ID here and to external-mcp.json */ export type MCPServerId = 'browserstack' | 'chrome-devtools' | 'context7' | 'deep-research' | 'elastic' | 'figma' | 'firebase' | 'gcloud' | 'github' | 'grafana' | 'mongodb' | 'playwright' | 'serena' | 'storybook' | 'terraform'; /** * Convert hyphenated server ID to underscore format for tool names * e.g., "chrome-devtools" -> "chrome_devtools" */ type HyphenToUnderscore = S extends `${infer L}-${infer R}` ? `${L}_${HyphenToUnderscore}` : S; /** * MCP Tool type derived from registry server IDs * Format: mcp_ * e.g., "mcp_playwright" | "mcp_chrome_devtools" | ... */ export type MCPTool = `mcp_${HyphenToUnderscore}`; /** * All server IDs from the registry (runtime values) */ export declare const MCP_SERVER_IDS: MCPServerId[]; /** * Map of server ID to MCP tool name */ export declare const SERVER_ID_TO_TOOL: Record; /** * Map of MCP tool name to server ID */ export declare const TOOL_TO_SERVER_ID: Record; /** * Check if a string is a valid MCP tool name */ export declare function isValidMCPTool(tool: string): tool is MCPTool; /** * Get server ID from MCP tool name * Returns undefined if the tool name is not in mcp_ format */ export declare function getServerIdFromTool(tool: string): MCPServerId | undefined; /** * Get MCP tool name from server ID */ export declare function getToolFromServerId(serverId: MCPServerId): MCPTool; export {}; //# sourceMappingURL=mcp-registry.types.d.ts.map