Title: Split protocol types into a standalone `mcp-types` package by Kludex · Pull Request #2973 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Split protocol types into a standalone `mcp-types` package by Kludex · Pull Request #2973 · modelcontextprotocol/python-sdk
X Title: Split protocol types into a standalone `mcp-types` package by Kludex · Pull Request #2973 · modelcontextprotocol/python-sdk
Description: What Extract the protocol wire types from src/mcp/types/ into a separate distribution, mcp-types (imported as mcp_types), wired into the existing uv workspace as a member under src/mcp-types/ (same nesting as httpx2/httpcore2). mcp-types depends only on pydantic + typing-extensions, so tooling and lightweight clients can (de)serialize MCP traffic without pulling in httpx, starlette, uvicorn, and the rest of the server/transport stack. Key changes src/mcp/types/ → src/mcp-types/mcp_types/ (_types, jsonrpc, _wire_base, methods, v2025_11_25/, v2026_07_28/), moved with git mv so history is preserved. src/mcp/shared/version.py → src/mcp-types/mcp_types/version.py. It is a pure leaf with no mcp dependencies, which is what lets mcp_types depend on nothing in mcp (methods.py needs KNOWN_PROTOCOL_VERSIONS). mcp.types and mcp.shared.version are removed (no shim). All importers are rewritten to mcp_types / mcp_types.version. mcp.__init__ still re-exports the type names from mcp_types, so from mcp import Tool is unchanged. Workspace/build wiring: [tool.uv.workspace] member, [tool.uv.sources], mcp dependency, pyright include, ruff per-file-ignore, coverage source + [tool.coverage.paths] mapping, and scripts/gen_surface_types.py output path + --base-class. Breaking change from mcp.types import X and from mcp.shared.version import X no longer work; use from mcp_types import X / from mcp_types.version import X. The top-level from mcp import X re-exports are unchanged. Documented in docs/migration.md. Verification 2714 tests pass; pyright reports 0 errors; ruff/format clean. 100.00% coverage, strict-no-cover clean. mcp-types builds standalone (wheel includes py.typed and all modules). scripts/gen_surface_types.py --check regenerates the v* validators identically from the new path. AI Disclaimer This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.
Open Graph Description: What Extract the protocol wire types from src/mcp/types/ into a separate distribution, mcp-types (imported as mcp_types), wired into the existing uv workspace as a member under src/mcp-types/ (same...
X Description: What Extract the protocol wire types from src/mcp/types/ into a separate distribution, mcp-types (imported as mcp_types), wired into the existing uv workspace as a member under src/mcp-types/ (same...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2973
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5f832f87-62f9-c188-60e4-3854bb0b2948 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8142:33F480:2D27B3:3E84AB:6A59C7DC |
| html-safe-nonce | a4d89b2a0343a99ceece6e0e68cbc7e1cc70dc86103a7db16efa977e6df91be5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTQyOjMzRjQ4MDoyRDI3QjM6M0U4NEFCOjZBNTlDN0RDIiwidmlzaXRvcl9pZCI6IjUzNDc2Mjk1MzM5NjQ2NTA0NjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | df3466516b6d119b07bc132b9934a5e7bec151cf03faea415330c75e8f30139e |
| hovercard-subject-tag | pull_request:3936352668 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2973/files |
| twitter:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| og:image:alt | What Extract the protocol wire types from src/mcp/types/ into a separate distribution, mcp-types (imported as mcp_types), wired into the existing uv workspace as a member under src/mcp-types/ (same... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ba3976babb66479b1c943a8edc0777d96157da48fadc0161f9ddb219deee8353 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ab680789ae4a316cdaf0d5a292a1760140931cc4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width