Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
modelcontextprotocol
/
python-sdk
Public
Notifications
You must be signed in to change notification settings
Fork
3.9k
Star
24.3k
Code
Issues
232
Pull requests
184
Actions
Projects
Security and quality
6
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
[experimental - do not merge] Cut startup cost: lazy exports, pay-for-what-you-use imports, deferred model builds
- #3220
#3220
Draft
maxisbey
wants to merge 32 commits into
main
modelcontextprotocol/python-sdk:main
from
import-speed
modelcontextprotocol/python-sdk:import-speed
Copy head branch name to clipboard
Conversation
Commits
32
(32)
Checks
Files changed
Draft
[experimental - do not merge] Cut startup cost: lazy exports, pay-for-what-you-use imports, deferred model builds
#3220
maxisbey
wants to merge 32 commits into
main
modelcontextprotocol/python-sdk:main
from
import-speed
modelcontextprotocol/python-sdk:import-speed
Copy head branch name to clipboard
Commits
Commits on Jul 29, 2026
Resolve the mcp package's exports lazily (PEP 562)
Show description for 622aed5
maxisbey
committed
622aed5
View commit details
Copy full SHA for 622aed5
Browse repository at this point
Resolve submodules of mcp.client, mcp.server, mcp.shared and mcp.os on attribute access
Show description for 2128b57
maxisbey
committed
2128b57
View commit details
Copy full SHA for 2128b57
Browse repository at this point
Stop mcp.client from importing the server stack
Show description for 1c1b7f8
maxisbey
committed
1c1b7f8
View commit details
Copy full SHA for 1c1b7f8
Browse repository at this point
Load httpx2 with the HTTP transports only
Show description for 1e00f42
maxisbey
committed
1e00f42
View commit details
Copy full SHA for 1e00f42
Browse repository at this point
Keep typing.get_type_hints(Client) resolvable at runtime
Show description for 5b25303
maxisbey
committed
5b25303
View commit details
Copy full SHA for 5b25303
Browse repository at this point
Make server-side imports pay-for-what-you-use
Show description for fcaf297
maxisbey
committed
fcaf297
View commit details
Copy full SHA for fcaf297
Browse repository at this point
Test HttpResource.read() instead of excluding it from coverage
Show description for 3ac881f
maxisbey
committed
3ac881f
View commit details
Copy full SHA for 3ac881f
Browse repository at this point
Load per-version wire packages lazily from the methods surface maps
Show description for 0237ed9
maxisbey
committed
0237ed9
View commit details
Copy full SHA for 0237ed9
Browse repository at this point
Keep PrimitiveSchemaDefinition reachable on mcp.server.elicitation
Show description for 2a7fb0c
maxisbey
committed
2a7fb0c
View commit details
Copy full SHA for 2a7fb0c
Browse repository at this point
Add an import-cost ratchet for the SDK's entry points
Show description for ff6c36e
maxisbey
committed
ff6c36e
View commit details
Copy full SHA for ff6c36e
Browse repository at this point
Keep the Client type-hints test green on Python 3.10
Show description for 2a13e6d
maxisbey
committed
2a13e6d
View commit details
Copy full SHA for 2a13e6d
Browse repository at this point
Use one lazy-attribute helper for the packages, invisible to type checkers
Show description for 1f3fbc7
maxisbey
committed
1f3fbc7
View commit details
Copy full SHA for 1f3fbc7
Browse repository at this point
Keep the public server signatures resolvable by typing.get_type_hints
Show description for cdc78fc
maxisbey
committed
cdc78fc
View commit details
Copy full SHA for cdc78fc
Browse repository at this point
Load the OAuth provider stack and cryptography with their first user, not the server
Show description for 9ef39b6
maxisbey
committed
9ef39b6
View commit details
Copy full SHA for 9ef39b6
Browse repository at this point
Keep the wire packages statically discoverable to bundlers
Show description for 695b1ab
maxisbey
committed
695b1ab
View commit details
Copy full SHA for 695b1ab
Browse repository at this point
Defer building the generated wire models and emit them in dependency order
Show description for b8bc17d
maxisbey
committed
b8bc17d
View commit details
Copy full SHA for b8bc17d
Browse repository at this point
Defer building the monolith protocol models and routing adapters
Show description for 08f4385
maxisbey
committed
08f4385
View commit details
Copy full SHA for 08f4385
Browse repository at this point
Defer building the SDK's own eager pydantic models and adapters
Show description for 45bb6c9
maxisbey
committed
45bb6c9
View commit details
Copy full SHA for 45bb6c9
Browse repository at this point
Document the import-cost contract and the deferred-work model
Show description for 1facb57
maxisbey
committed
1facb57
View commit details
Copy full SHA for 1facb57
Browse repository at this point
Cover the deferred-signature edge cases: instance access and defer_build turned off
maxisbey
committed
d515c85
View commit details
Copy full SHA for d515c85
Browse repository at this point
Serialize the deferred first build of the SDK's pydantic models
Show description for 8c9f2a2
maxisbey
committed
8c9f2a2
View commit details
Copy full SHA for 8c9f2a2
Browse repository at this point
Add mcp.warm(): opt-in prewarming for the deferred validators
Show description for 33471c7
maxisbey
committed
33471c7
View commit details
Copy full SHA for 33471c7
Browse repository at this point
Document the deferred-work bills and correct the import-cost bullets
Show description for 7fae576
maxisbey
committed
7fae576
View commit details
Copy full SHA for 7fae576
Browse repository at this point
Construct DEFAULT_CLIENT_INFO without building the Implementation model
Show description for 53a46e6
maxisbey
committed
53a46e6
View commit details
Copy full SHA for 53a46e6
Browse repository at this point
Import the internal deferred_model decorator under a private name
Show description for 986d3b9
maxisbey
committed
986d3b9
View commit details
Copy full SHA for 986d3b9
Browse repository at this point
Fail generation if a non-class statement sits between generated classes
Show description for e02caca
maxisbey
committed
e02caca
View commit details
Copy full SHA for e02caca
Browse repository at this point
Cover the decorator's refusal paths and the runtime-only lazy-init branches
Show description for fc4f4e6
maxisbey
committed
fc4f4e6
View commit details
Copy full SHA for fc4f4e6
Browse repository at this point
Generate a deferred model's JSON schema under the rebuild lock too
Show description for b592f09
maxisbey
committed
b592f09
View commit details
Copy full SHA for b592f09
Browse repository at this point
Spell warm()'s every-version flag as all_versions and return a frozen dataclass
Show description for 6da7ba4
maxisbey
committed
6da7ba4
View commit details
Copy full SHA for 6da7ba4
Browse repository at this point
Document the prewarm recipe and the rebuild lock's terms
Show description for 008c74e
maxisbey
committed
008c74e
View commit details
Copy full SHA for 008c74e
Browse repository at this point
Resolve attribute chains through the four leaf sub-packages too
Show description for cb7c68c
maxisbey
committed
cb7c68c
View commit details
Copy full SHA for cb7c68c
Browse repository at this point
Pin the decorator's refusal messages and describe two wire-base tests
Show description for 2716d09
maxisbey
committed
2716d09
View commit details
Copy full SHA for 2716d09
Browse repository at this point
You can’t perform that action at this time.