mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-07-07 14:45:00 +00:00
Merge pull request #40 from anthropics/dickson/mcp
Update MCP types to align with what Claude Code expects
This commit is contained in:
commit
52cc0db139
1 changed files with 25 additions and 4 deletions
|
@ -11,11 +11,32 @@ PermissionMode = Literal["default", "acceptEdits", "bypassPermissions"]
|
||||||
|
|
||||||
|
|
||||||
# MCP Server config
|
# MCP Server config
|
||||||
class McpServerConfig(TypedDict):
|
class McpStdioServerConfig(TypedDict):
|
||||||
"""MCP server configuration."""
|
"""MCP stdio server configuration."""
|
||||||
|
|
||||||
transport: list[str]
|
type: NotRequired[Literal["stdio"]] # Optional for backwards compatibility
|
||||||
env: NotRequired[dict[str, Any]]
|
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
|
# Content block types
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue