Lazy import in src/mcp/__init__.py
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
This is something that's been mentioned before in http://github.com/modelcontextprotocol/python-sdk/issues/1508
Currently it won't be prioritised, but potentially looked at for something in v2 of the SDK.
We do need to refactor the module names, and define what is private and public properly, but I don't think we need anything smart regarding imports. The imports being slow was mainly because of jsonschema.