René's URL Explorer Experiment


Title: Restore mcp.server.fastmcp as a deprecated import alias for MCPServer by maxisbey · Pull Request #3189 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Restore mcp.server.fastmcp as a deprecated import alias for MCPServer by maxisbey · Pull Request #3189 · modelcontextprotocol/python-sdk

X Title: Restore mcp.server.fastmcp as a deprecated import alias for MCPServer by maxisbey · Pull Request #3189 · modelcontextprotocol/python-sdk

Description: Adds a deprecated mcp.server.fastmcp import path so the single most common line in v1 code, from mcp.server.fastmcp import FastMCP, resolves again on v2 (with an MCPDeprecationWarning) instead of raising ModuleNotFoundError, and makes MCPServer's constructor keyword-only after name. Motivation and Context from mcp.server.fastmcp import FastMCP is the first line of nearly every v1 server, and of most tutorial and LLM-generated code, so it's row 1 of the migration guide's "changes almost every project hits" table. For decorator-built servers the rename is genuinely most of the port: the README-shaped v1 quickstart (FastMCP("Demo") + @mcp.tool() / @mcp.resource() / @mcp.prompt() + mcp.run()) runs unmodified on v2 given only the class alias. This is the one v1 name where the alias alone rescues real programs, which is the line for shimming it — mcp.types and McpError stay hard breaks because an alias there saves nobody. Scope is deliberately narrow: Package init only. FastMCP, Context, Image, Audio, Icon (v1's exact __all__) resolve to the v2 objects; mcp.server.fastmcp.server, .prompts.base, etc. still raise ModuleNotFoundError, since nothing beneath them is behaviour-equivalent. The warning is honest. It says this is not just a rename (default server name, transport params off the constructor, sync handlers on a worker thread) and links the guide. MCPDeprecationWarning subclasses UserWarning, so it shows without -W. Removed in v3. from mcp.server import FastMCP is not restored (v1 exported it there too): that needs a module-level __getattr__ on mcp.server, which loosens static checking of every from mcp.server import ... for all downstream users. No API-reference page — the doc generator skips deprecated shim modules. The keyword-only constructor closes the one hazard the shim would otherwise make silent. v2 inserted title/description ahead of instructions, so a v1 FastMCP("Demo", "You answer questions about the weather.") used to run without complaint and land the instructions in title; with the import erroring, users at least met the guide first. Now that the import warns and continues, that call raises TypeError instead — for shim users and mechanical-rename users alike, matching what the lowlevel Server already does. The migration guide's constructor section is rewritten from "silently misassigns" to "raises". How Has This Been Tested? New tests/server/test_fastmcp.py: the import warns with the replacement named, and the five re-exports are the v2 objects (FastMCP is MCPServer, v1 __all__ preserved). Full suite: ./scripts/test at 100% coverage, strict-no-cover clean; pyright 0 errors. Ran an unmodified v1 README-shaped server end-to-end through the old import against an in-process Client: tool call, resource template, and prompt all round-trip; the warning is attributed to the user's own import line (stacklevel correct) and fires once per process. Probed the edges: from mcp.server.fastmcp.prompts import base → ModuleNotFoundError; positional FastMCP('Demo', 'instructions') → the TypeError quoted in the guide; python -W error::UserWarning -c 'import mcp.server.fastmcp' → raises the warning cleanly by category; from mcp.server import FastMCP → still ImportError. Regenerated docs/api/ before and after: no fastmcp page either way. Breaking Changes MCPServer(...) no longer accepts title, description, instructions, website_url, icons, version, auth_server_provider, or token_verifier positionally — pass them by keyword (the migration guide already recommended this; the signature now enforces it). Documented in docs/migration.md. The new import path is additive (previously it did not exist), gated behind a deprecation warning. Types of changes New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed AI Disclaimer

Open Graph Description: Adds a deprecated mcp.server.fastmcp import path so the single most common line in v1 code, from mcp.server.fastmcp import FastMCP, resolves again on v2 (with an MCPDeprecationWarning) instead of r...

X Description: Adds a deprecated mcp.server.fastmcp import path so the single most common line in v1 code, from mcp.server.fastmcp import FastMCP, resolves again on v2 (with an MCPDeprecationWarning) instead of r...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/3189

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:99e5acac-4dfd-7487-335f-92087f624e8b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDDE6:D1C6A:6778FC:8AA6F9:6B00AC59
html-safe-nonce3cfc0527e6529d32f805a9b8567b5b7737b2a1fdb7d4be42034bee4028035683
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEREU2OkQxQzZBOjY3NzhGQzo4QUE2Rjk6NkIwMEFDNTkiLCJ2aXNpdG9yX2lkIjoiNDQ3MDgzMzk1MDcyOTc0MzQ0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7535c1042e6f6319448833b876ea4d9c6a4ce63f449477a9f7cfb90f28042057
hovercard-subject-tagpull_request:4145716728
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/3189/files
twitter:imagehttps://avatars.githubusercontent.com/u/224885523?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/224885523?s=400&v=4
og:image:altAdds a deprecated mcp.server.fastmcp import path so the single most common line in v1 code, from mcp.server.fastmcp import FastMCP, resolves again on v2 (with an MCPDeprecationWarning) instead of r...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonec0dd5f5d6f515a591019ecd66df2c4eab3379c2d3b0777568a90d8c7ae10b79e
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release729d8cda69b3d267995675dfbf89ff27ccf61bf6
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F3189%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F3189%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues308 (308)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
maxisbeyhttps://github.com/maxisbey
mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
fastmcp-import-shimhttps://github.com/modelcontextprotocol/python-sdk/tree/fastmcp-import-shim
Conversation 4 https://github.com/modelcontextprotocol/python-sdk/pull/3189
Commits 2 https://github.com/modelcontextprotocol/python-sdk/pull/3189/commits
Checks 39 https://github.com/modelcontextprotocol/python-sdk/pull/3189/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/3189/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files
Restore mcp.server.fastmcp as a deprecated import alias for MCPServer https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#top
Show all changes 2 commits https://github.com/modelcontextprotocol/python-sdk/pull/3189/files
ac6a957 Restore mcp.server.fastmcp as a deprecated import alias for MCPServer maxisbey Jul 27, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/3189/commits/ac6a957de08edef89d37eac142fdd07bb428b55c
5f87d39 Fix contradictions in the FastMCP rename migration prose maxisbey Jul 27, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/3189/commits/5f87d3974959b66bd601d5755db168518d9fe7db
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/3189/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files
migration.md https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
gen_ref_pages.py https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-73375caa03c5e86d6fddec33d06c9dfa3fb32811abb634df5bb5d6246aa2d31a
__init__.py https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-2b14af7dec09d8ffd8c362d449747584575acd06308b48168f758395b7d0810a
server.py https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-51d6996c0b80b8a5c42e7071451cb9ed3c91b398facebe99b94aad911059190e
test_fastmcp.py https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-9e4143f7104068c6f319da89fa8f806c17cd79c73c2154fd1096f197c70df665
docs/migration.mdhttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
View file https://github.com/modelcontextprotocol/python-sdk/blob/5f87d3974959b66bd601d5755db168518d9fe7db/docs/migration.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3189/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
scripts/docs/gen_ref_pages.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-73375caa03c5e86d6fddec33d06c9dfa3fb32811abb634df5bb5d6246aa2d31a
View file https://github.com/modelcontextprotocol/python-sdk/blob/5f87d3974959b66bd601d5755db168518d9fe7db/scripts/docs/gen_ref_pages.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3189/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-73375caa03c5e86d6fddec33d06c9dfa3fb32811abb634df5bb5d6246aa2d31a
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-73375caa03c5e86d6fddec33d06c9dfa3fb32811abb634df5bb5d6246aa2d31a
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-73375caa03c5e86d6fddec33d06c9dfa3fb32811abb634df5bb5d6246aa2d31a
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-73375caa03c5e86d6fddec33d06c9dfa3fb32811abb634df5bb5d6246aa2d31a
src/mcp/server/fastmcp/__init__.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-2b14af7dec09d8ffd8c362d449747584575acd06308b48168f758395b7d0810a
View file https://github.com/modelcontextprotocol/python-sdk/blob/5f87d3974959b66bd601d5755db168518d9fe7db/src/mcp/server/fastmcp/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3189/{{ revealButtonHref }}
claudehttps://github.com/apps/claude
Jul 27, 2026https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#r3660715579
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files
src/mcp/server/mcpserver/server.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-51d6996c0b80b8a5c42e7071451cb9ed3c91b398facebe99b94aad911059190e
View file https://github.com/modelcontextprotocol/python-sdk/blob/5f87d3974959b66bd601d5755db168518d9fe7db/src/mcp/server/mcpserver/server.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3189/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-51d6996c0b80b8a5c42e7071451cb9ed3c91b398facebe99b94aad911059190e
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-51d6996c0b80b8a5c42e7071451cb9ed3c91b398facebe99b94aad911059190e
https://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-51d6996c0b80b8a5c42e7071451cb9ed3c91b398facebe99b94aad911059190e
tests/server/test_fastmcp.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files#diff-9e4143f7104068c6f319da89fa8f806c17cd79c73c2154fd1096f197c70df665
View file https://github.com/modelcontextprotocol/python-sdk/blob/5f87d3974959b66bd601d5755db168518d9fe7db/tests/server/test_fastmcp.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3189/{{ revealButtonHref }}
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3189/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.