Merge pull request #40 from anthropics/dickson/mcp
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.13) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run

Update MCP types to align with what Claude Code expects
This commit is contained in:
Dickson Tsai 2025-06-25 08:06:27 -07:00 committed by GitHub
commit 52cc0db139
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,11 +11,32 @@ PermissionMode = Literal["default", "acceptEdits", "bypassPermissions"]
# MCP Server config
class McpServerConfig(TypedDict):
"""MCP server configuration."""
class McpStdioServerConfig(TypedDict):
"""MCP stdio server configuration."""
transport: list[str]
env: NotRequired[dict[str, Any]]
type: NotRequired[Literal["stdio"]] # Optional for backwards compatibility
command: str
args: NotRequired[list[str]]
env: NotRequired[dict[str, str]]
class McpSSEServerConfig(TypedDict):
"""MCP SSE server configuration."""
type: Literal["sse"]
url: str
headers: NotRequired[dict[str, str]]
class McpHttpServerConfig(TypedDict):
"""MCP HTTP server configuration."""
type: Literal["http"]
url: str
headers: NotRequired[dict[str, str]]
McpServerConfig = McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig
# Content block types