-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
questionFurther information is requestedFurther information is requestedv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Description
Description
Has the MCP team considered lazy importing in the mcp package?
Right now, if you import anything from mcp, it will run the mcp/init.py file, and it will import from all the submodules at the beginning. However, most people probably only need to develop for the server or client, but not both. Importing all the sub-modules will create a huge upfront cold start latency as more people are integrating MCP with their services in a auto-scaling format. Whenever a new server instance is cold-started, importing from MCP will take a non-trivial amount of time (~1s in my own laptop, it's usually slower on Cloud).
Would love to draft a PR if this is worth the value.
References
No response
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requestedv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes