-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Comparing changes
Open a pull request
base repository: modelcontextprotocol/python-sdk
base: main
head repository: modelcontextprotocol/python-sdk
compare: v2-design-sketches
- 8 commits
- 23 files changed
- 2 contributors
Commits on Jan 24, 2026
-
wip: add v2 lowlevel server design sketch
Initial sketch exploring a simplified lowlevel server API: - Method-string based handler registration - Context object for bidirectional communication - Separate request/notification handlers - Transport abstraction with GET stream handler Also excludes v2_scratch and scratch folders from linting. This is exploratory design work for SDK v2.
Configuration menu - View commit details
-
Copy full SHA for c149884 - Browse repository at this point
Copy the full SHA c149884View commit details -
wip: refine v2 lowlevel server types and handlers
- Add type-safe method registration with Literal unions (RequestMethod, ClientNotificationMethod, ServerNotificationMethod) - Switch notification params from TypedDicts to BaseModels for consistency and proxy support - Add Context dataclass with send_notification and send_request for bidirectional communication - Result types inherit from JSONRPCResponse with id from request - Clean up handler examples to use new types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for d618612 - Browse repository at this point
Copy the full SHA d618612View commit details -
wip: reorganize v2 sketch into transport subpackage
- Extract Transport protocol, Context, and StreamableHTTPTransport into v2_scratch/transport/ subpackage - Rename JSONRPCResponse -> JSONRPCResultResponse for clarity - Add JSONRPCErrorResponse with structured ErrorData - Make JSONRPCResponse a type alias (Result | Error) per spec - Remove v2_scratch from ruff exclude (enable linting) - Add py.typed marker and __init__.py files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 8385638 - Browse repository at this point
Copy the full SHA 8385638View commit details -
wip: checkpoint - mcp_v2 types with generic bases and TypeAdapter
- Add json_rpc.py with generic bases (RequestBase, NotificationBase, ResultResponseBase) for typed message subclasses - Add JSONRPCMessageAdapter for automatic message type discrimination - Update types.py to use generic bases for typed requests/notifications - Add parametrized tests for TypeAdapter discrimination - Reorganize v2_scratch -> src/mcp_v2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 0b00503 - Browse repository at this point
Copy the full SHA 0b00503View commit details -
wip: add extra="allow" to all protocol types via base classes
- Add model_config with extra="allow" to JSONRPCBase and ErrorData - Create MCPModel base class with extra="allow" for MCP domain types - Update inheritance: params inherit from RequestParams, results from Result - Add snake_case aliases for camelCase fields (protocol_version, etc.) - Add Meta, Icon, Annotations, ToolAnnotations, ToolExecution, JsonSchema types - Expand Tool model with all spec fields 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for c90b6f0 - Browse repository at this point
Copy the full SHA c90b6f0View commit details -
wip: restructure mcp_v2 types into separate modules
- Split types.py into base.py, common.py, content.py, initialize.py, tools.py, and resources.py - Fix transport imports to use specific module paths - Update Context.send_notification to take method as separate param - Use X | None instead of Optional[X] (with PyCharm noinspection comments) - All ruff and pyright checks pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 8d2ce8a - Browse repository at this point
Copy the full SHA 8d2ce8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e67625 - Browse repository at this point
Copy the full SHA 5e67625View commit details -
wip: add Starlette-style lifespan to v2 LowLevelServer
- Lifespan is now an async context manager that receives the server - Lifespan runs ONCE for the server lifetime, not per-session - Add separate session_lifespan for per-session state - Runner pattern: run() enters lifespan, handle_session() reuses it - Matches Starlette/FastAPI lifespan semantics Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%) Claude-Steers: 12 Claude-Permission-Prompts: 8 Claude-Escapes: 1
Configuration menu - View commit details
-
Copy full SHA for b8c29d2 - Browse repository at this point
Copy the full SHA b8c29d2View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...v2-design-sketches