/** * External MCP server loader. * * Chat is the most capable surface, so beyond the in-process `edsger-*` MCP * servers it can also talk to user-configured *external* MCP servers (stdio or * http/sse). Users declare them in a Claude-Code-style config file: * * ~/.edsger/mcp.json (global, default) * $EDSGER_MCP_CONFIG (path override) * * Shape (mirrors Claude Code's `.mcp.json`): * { * "mcpServers": { * "github": { "command": "npx", "args": ["-y","@modelcontextprotocol/server-github"], * "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" } }, * "linear": { "type": "http", "url": "https://mcp.linear.app/sse", * "headers": { "Authorization": "Bearer ${LINEAR_TOKEN}" } } * } * } * * `${VAR}` tokens in any string value are expanded from the process env so * secrets stay out of the file. We only read trusted user-owned locations — * never a cloned repo's `.mcp.json` — because with bypassPermissions a stdio * server is arbitrary local code execution. */ import type { McpHttpServerConfig, McpSSEServerConfig, McpStdioServerConfig } from '@anthropic-ai/claude-agent-sdk'; /** External (process/remote) MCP server configs — excludes in-process SDK ones. */ export type ExternalMcpServerConfig = McpStdioServerConfig | McpHttpServerConfig | McpSSEServerConfig; export interface ExternalMcpServers { /** name → config, ready to spread into the SDK `mcpServers` option. */ servers: Record; /** Server names, to add to an agent definition's `mcpServers` allowlist. */ names: string[]; } /** Resolve the config file path: $EDSGER_MCP_CONFIG, else ~/.edsger/mcp.json. */ export declare function externalMcpConfigPath(): string; /** * Load and validate user-configured external MCP servers. Best-effort: a * missing file returns nothing; a malformed file (or bad entry) is skipped * with a warning rather than throwing, so chat still runs. */ export declare function loadExternalMcpServers(opts?: { path?: string; warn?: (msg: string) => void; }): ExternalMcpServers;