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
This proposal suggests enhancing the Model Context Protocol Python SDK with a modular router system similar to FastAPI's APIRouter. This would allow developers to organize MCP tools, resources, and prompts across multiple files and modules, improving code organization and maintainability for larger applications.
Current limitation
Currently, the MCP Python SDK requires defining all tools, resources, and prompts on a single FastMCP instance:
For larger applications, this leads to several issues:
All MCP components must be defined in a single file or imported into a single namespace
Difficult to organise code by domain or feature
No clear way to create reusable tool/resource modules
Challenging to maintain separation of concerns in larger projects
Request
It would be beneficial to have a modular router system similar to FastAPI's APIRouter that allows developers to:
Define tools, resources, and prompts in separate files
Group related functionality in domain-specific modules
Import and combine these modules in a main MCP application
This would significantly improve code organization and maintainability for larger MCP-based applications, especially those with many tools and resources spanning different domains or features.
The text was updated successfully, but these errors were encountered:
This proposal suggests enhancing the Model Context Protocol Python SDK with a modular router system similar to FastAPI's APIRouter. This would allow developers to organize MCP tools, resources, and prompts across multiple files and modules, improving code organization and maintainability for larger applications.
Current limitation
Currently, the MCP Python SDK requires defining all tools, resources, and prompts on a single FastMCP instance:
For larger applications, this leads to several issues:
Request
It would be beneficial to have a modular router system similar to FastAPI's APIRouter that allows developers to:
This would significantly improve code organization and maintainability for larger MCP-based applications, especially those with many tools and resources spanning different domains or features.
The text was updated successfully, but these errors were encountered: