/** * Export Claude MCP config → Kimi (.kimi-code/mcp.json), Grok (.grok/config.toml), * and Cursor (.cursor/mcp.json) for multi-target parity. * * Sources (merged; later wins on same server id): * 1. ~/.claude.json#mcpServers (+ projects[]#mcpServers) * 2. ~/.claude/settings.json#mcpServers * 3. /.claude/config/mcp-active.json * 4. /.claude/settings.json#mcpServers * 5. /.mcp.json */ /** Bump when export shape / source merge changes (manifest freshness). */ export declare const MCP_EXPORT_VERSION = "1.4.0"; export declare const GROK_RULES_VERSION = "1.2.0"; export type ClaudeMcpServers = Record>; export interface McpExportResult { kimiWritten: boolean; grokWritten: boolean; cursorWritten: boolean; grokRulesWritten: boolean; serverCount: number; /** Server ids dropped by stack / Claude.ai-connector filters */ dropped?: string[]; sources?: string[]; skippedReason?: string; } /** Extract mcpServers map from a parsed JSON value. */ export declare function asMcpServers(raw: unknown): ClaudeMcpServers | null; /** * Load merged Claude MCP map: user-global (~/.claude.json) + project files. * Project entries override user-global on the same server id. */ export declare function loadProjectMcpServers(projectDir: string): ClaudeMcpServers | null; /** Diagnostic: which source files contributed (same merge order). */ export declare function listMcpSourceLabels(projectDir: string): string[]; /** Normalize one Claude MCP entry to Kimi / Cursor-friendly shape. */ export declare function toKimiServerEntry(cfg: Record): Record; export declare function toKimiMcpJson(servers: ClaudeMcpServers): string; export declare function toCursorMcpJson(servers: ClaudeMcpServers): string; /** HTTP MCP hosts that often block Grok startup on OAuth prompts. */ export declare function isOauthLikelyUrl(url: string): boolean; /** * Claude.ai hosted connectors (Gmail / Calendar / Drive / …). * They only work inside Claude; exporting them hangs Kimi/Grok/Cursor on auth. */ export declare function isClaudeAiConnector(name: string, cfg: Record): boolean; /** Vercel HTTP MCP or Next.js DevTools (registry id / npx package). */ export declare function isVercelStackMcp(name: string, cfg: Record): boolean; /** * Drop Claude.ai connectors always; drop Vercel/Next DevTools unless stack is nodejs. */ export declare function filterServersForExport(servers: ClaudeMcpServers, stackId: string | null | undefined): { servers: ClaudeMcpServers; dropped: string[]; }; /** * MySQL MCP with empty MYSQL_* is flaky (connects then health unavailable) and * slows /mcps. Start disabled until real env is filled. */ export declare function isMysqlMissingEnv(name: string, cfg: Record): boolean; /** * Build Grok project MCP TOML fragment. * Project `.grok/config.toml` may only contribute mcp_servers / plugins / permission — * do not put [skills] or [compat.*] here (those belong in ~/.grok/config.toml). */ export declare function toGrokMcpTomlFragment(servers: ClaudeMcpServers): string; /** * Rewrite project `.grok/config.toml` as MCP-only (strip SVS skills/compat pollution). * Grok ignores [skills]/[compat] in project files and they confuse diagnosis. */ export declare function writeGrokProjectMcpConfig(projectDir: string, servers: ClaudeMcpServers): void; /** @deprecated use writeGrokProjectMcpConfig — kept for tests */ export declare function mergeGrokConfigToml(existing: string | null, fragment: string): string; export interface ExportMcpOptions { /** Which side-cars to write (default: all) */ targets?: Array<'kimi' | 'grok' | 'cursor'>; force?: boolean; /** Override stack from `.claude/config/active-project.json` (php | nodejs | python | …) */ stack?: string | null; } /** * Write Kimi / Grok / Cursor MCP artefacts from merged Claude MCP sources. * Filters Claude.ai connectors always; Vercel/Next DevTools only for nodejs. */ export declare function exportMcpToTargets(projectDir: string, opts?: ExportMcpOptions): McpExportResult;