Title: Fix docs/release follow-ups from the mcp-types package split by maxisbey · Pull Request #2977 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Fix docs/release follow-ups from the mcp-types package split by maxisbey · Pull Request #2977 · modelcontextprotocol/python-sdk
X Title: Fix docs/release follow-ups from the mcp-types package split by maxisbey · Pull Request #2977 · modelcontextprotocol/python-sdk
Description: What
Follow-ups from the review of #2973 (the review comment) — the items #2973 itself didn't pick up before it merged. Two of them are invisible to every check that ran green on that PR, because neither the docs build nor the publish path runs in PR CI.
Key changes
The published API reference (PR-introduced by #2973, no CI sees it). docs/hooks/gen_ref_pages.py derives the mkdocstrings identifier from the path relative to src/, which for the new package yields ::: mcp-types.mcp_types.* — and griffe resolves modules by walking the filesystem, not importlib, so it happily collects the hyphenated directory as a namespace package. The result is a green mkdocs build --strict that publishes the entire type system under the heading mcp-types.mcp_types (a dotted path that is a syntax error to import) while every existing link to /api/mcp/types/* 404s. Fixed by deriving each module's identifier from its own package root, adding src/mcp-types to the mkdocs paths: list and to the deploy-docs.yml trigger filter (which only listed src/mcp/**), and dropping the mkdocs watch: package list rather than extending it.
The publish path. The release job uploads both distributions in one trusted-publishing step. A partial upload — say, the mcp-types trusted publisher isn't configured yet, or PyPI hiccups on one project — used to be unrecoverable from the workflow alone, because re-running it failed on the files that had already landed. skip-existing: true makes a re-run skip whatever is already on PyPI and upload the rest, so a partial failure is fixed by re-running the job.
Development Status classifier. #2975 set mcp to 5 - Production/Stable but left src/mcp-types/pyproject.toml at 3 - Alpha, and the two distributions are published in lockstep with an exact == pin — so their PyPI metadata would contradict each other, immutably. mcp-types now matches, and RELEASE.md records that the classifier is permanently 5 - Production/Stable and is not part of any release.
A CI check for the package's headline contract. Nothing today fails if mcp_types grows an import httpx: tests, pyright, and ruff all run in the one workspace venv, which always has the full SDK dependency closure installed, so the import just resolves and everything stays green — the breakage only surfaces for the first user who installs mcp-types into a clean environment. A new step in the pre-commit job exercises the contract directly: uv run --isolated --no-project --with ./src/mcp-types resolves only the package's declared dependencies into an empty environment and imports every module, so a stray import of the SDK or anything from its stack is a ModuleNotFoundError and a red, blocking check (the pre-commit job is a hard gate; the test matrix is continue-on-error). Also moves tests/shared/test_version.py to tests/types/ to mirror its source module.
Docs. The migration guide's headline "After (v2)" example, from mcp import Tool, CallToolResult, raises ImportError — CallToolResult was never in mcp.__all__. Swapped for Resource, which is. Also: name mcp_types.version as the home of the protocol-version constants (they're not in mcp_types.__all__ and the section never said where they went), link the new API reference from the section about the move, correct "depends only on pydantic" to also name typing-extensions, and point schema/README.md at the new codegen output path.
Contributor docs. [project].dependencies becoming dynamic means uv add
Open Graph Description: What Follow-ups from the review of #2973 (the review comment) — the items #2973 itself didn't pick up before it merged. Two of them are invisible to every check that ran green on that PR, becau...
X Description: What Follow-ups from the review of #2973 (the review comment) — the items #2973 itself didn't pick up before it merged. Two of them are invisible to every check that ran green on that PR, b...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2977
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:84414b78-b574-c4dc-c248-3b818ba25e01 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BF7A:289D0C:66A85B:880D97:6A5B34FA |
| html-safe-nonce | 58e8e697ab31b3989b96e7eb35bc848f8f243ad41be2fe94c91143b45a45cb56 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjdBOjI4OUQwQzo2NkE4NUI6ODgwRDk3OjZBNUIzNEZBIiwidmlzaXRvcl9pZCI6IjEyNjE4OTk5MzIwOTA3MDkyNDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a1d0e88429a637febd175a4e3c84e3fdd41391cd6a538dff84b0fb5db2fd97c2 |
| hovercard-subject-tag | pull_request:3937441887 |
| 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/2977/files |
| twitter:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| og:image:alt | What Follow-ups from the review of #2973 (the review comment) — the items #2973 itself didn't pick up before it merged. Two of them are invisible to every check that ran green on that PR, becau... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width