/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Wire-level MCP types. * * The SDK-side `McpSdkServerConfigWithInstance` (which carries a runtime * `McpServer` instance) is NOT here — that's SDK-local. Only configuration * shapes that travel across the CLI ↔ SDK JSONL boundary live in this file. */ export type McpStdioServerConfig = { type?: 'stdio'; command: string; args?: string[]; env?: Record; /** * Per-server tool-call timeout in milliseconds. Overrides the * MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock * limit per call; progress notifications do not extend it. Values below * 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default). */ timeout?: number; }; export type McpSSEServerConfig = { type: 'sse'; url: string; headers?: Record; /** * Per-server tool-call timeout in milliseconds. Overrides the * MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock * limit per call; progress notifications do not extend it. Values below * 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default). */ timeout?: number; }; export type McpHttpServerConfig = { type: 'http'; url: string; headers?: Record; /** * Per-server tool-call timeout in milliseconds. Overrides the * MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock * limit per call; progress notifications do not extend it. Values below * 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default). */ timeout?: number; }; export type McpSdkServerConfig = { type: 'sdk'; name: string; }; export type McpToolRuntimeOverride = { exposedName?: string; alwaysLoad?: boolean; }; export type McpServerConfigForProcessTransport = McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig | McpSdkServerConfig; /** Internal SDK -> CLI wire shape after public tool policies are normalized. */ export type McpServerConfigForCliTransport = McpServerConfigForProcessTransport & { toolOverrides?: Record; }; export type McpServerStatus = { name: string; status: 'connected' | 'failed' | 'needs-auth' | 'pending' | 'disabled'; serverInfo?: { name: string; version: string; }; error?: string; config?: McpServerStatusConfig; scope?: string; tools?: Array<{ name: string; description?: string; annotations?: { readOnly?: boolean; destructive?: boolean; openWorld?: boolean; }; }>; }; export type McpServerStatusConfig = McpServerConfigForProcessTransport; export type McpSetServersResult = { added: string[]; removed: string[]; errors: Record; }; export type OAuthToken = { accessToken: string; refreshToken?: string; tokenType?: string; expiresAt?: number; scope?: string; };