-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add mcp.types as a permanent alias for mcp_types #3190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fd93d4c
Add mcp.types deprecation shim over mcp_types
maxisbey 20d1b45
Make mcp.types a permanent alias, not a deprecation shim
maxisbey 72d8f58
Bind mcp.types on `import mcp`, restoring v1's fourth import idiom
maxisbey 716a7ff
Import protocol types through mcp.types in all user-facing code
maxisbey 5ffd74e
Mirror mcp_types.methods and .jsonrpc under mcp.types too
maxisbey 2b33969
Bound the bare-import subprocess test with the suite's standard timeout
maxisbey 6c5ab37
Drop a stale line-number reference in the callbacks doc
maxisbey c27f95c
Drop the removed-name hint machinery from mcp.types
maxisbey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟣 Pre-existing (not introduced by this PR): docs/advanced/apps.md:23 has
hl_lines="18 21 29 31", but all four numbers point at blank lines indocs_src/apps/tutorial001.py— the four "moves" the page's prose enumerates sit exactly one line below each. Since this PR's hl_lines sweep fixed every other page in this class (apps.md was skipped only because its tutorial had nomcp_typesimport to reorder), it's a natural one-line rider: change the spec tohl_lines="19 22 30 32".Extended reasoning...
What the bug is.
docs/advanced/apps.mdline 23 reads:All four highlighted line numbers land on blank lines in
docs_src/apps/tutorial001.py. Verified against the working tree withcat -n:apps = Apps()@apps.tool(resource_uri="ui://clock/app.html", ...)apps.add_html_resource("ui://clock/app.html", CLOCK_HTML, title="Clock")mcp = MCPServer("clock", extensions=[apps])The intended targets are unambiguous: they are exactly the four "moves" the page's own prose enumerates immediately below the code block (
Apps(),@apps.tool(resource_uri=...),add_html_resource,extensions=[apps]). The spec is uniformly off by one low; the fix ishl_lines="19 22 30 32".How it manifests. mkdocs-material renders
hl_linesas highlighted rows in the included snippet. As shipped, the page highlights four empty rows and none of the four lines the surrounding prose tells the reader to look at — a visible rendering defect on the published Apps page, though nothing functional breaks.Why this PR didn't fix it (and why it's pre-existing). This PR reorders
mcp_types→mcp.typesimports across ~145 docs/example files and mechanically remaps everyhl_linesspec that the import reshuffling shifted.docs_src/apps/tutorial001.pyimports nothing frommcp_types, so the sweep never touched it — neitherdocs/advanced/apps.mdnor its tutorial appears in this PR's diff. The off-by-one predates the PR (introduced in commit 48ef569). It's surfaced here only because it is the one remaininghl_linesdefect in the docs tree after this PR's sweep: every remap the PR did make was verified content-identical (old spec on old source vs. new spec on new source highlight the same lines, the only difference being the two swapped-but-still-highlighted import lines in the handling_errors tutorial).Step-by-step proof. (1) Open
docs/advanced/apps.md:23— the fence carrieshl_lines="18 21 29 31". (2) Runcat -n docs_src/apps/tutorial001.py: lines 18, 21, 29, and 31 are empty; lines 19, 22, 30, and 32 holdapps = Apps(), the@apps.tool(resource_uri=...)decorator,apps.add_html_resource(...), andmcp = MCPServer("clock", extensions=[apps])respectively. (3) Read the prose under the block — it walks through exactly those four constructs as the page's "four moves". (4) Render the page: four blank highlighted rows, zero of the four moves highlighted.Fix. One-line change in
docs/advanced/apps.md:23:hl_lines="18 21 29 31"→hl_lines="19 22 30 32". It fits naturally into this PR (whose third commit is precisely an hl_lines-remap sweep), or as a trivial follow-up.Severity. Pre-existing and cosmetic — a docs rendering issue in a file this PR does not touch. It must not block merge; it's noted here only because this PR fixed every other instance of the same defect class. (Anchored to the nearest in-diff
hl_lineshunk indocs/advanced/extensions.mdbecause the actual defect's file is not in the diff.)