/** * MCP (Model Context Protocol) types for JSON-RPC 2.0 communication. */ export interface MCPServerConfig { command: string; args?: string[]; env?: Record; } export interface MCPTool { name: string; description: string; inputSchema: Record; server: string; // which server provides this tool } export interface MCPToolResult { content: Array<{ type: string; text?: string; data?: string; mimeType?: string; }>; isError?: boolean; } // JSON-RPC 2.0 types export interface JsonRpcRequest { jsonrpc: "2.0"; id: number; method: string; params?: Record; } export interface JsonRpcResponse { jsonrpc: "2.0"; id: number; result?: unknown; error?: { code: number; message: string; data?: unknown }; } export interface MCPInitializeResult { protocolVersion: string; capabilities: { tools?: Record; resources?: Record; prompts?: Record; }; serverInfo: { name: string; version: string }; } export interface MCPToolListResult { tools: Array<{ name: string; description?: string; inputSchema?: Record; }>; } export interface MCPCallToolResult { content: Array<{ type: string; text?: string; data?: string; mimeType?: string; }>; isError?: boolean; }