Problem
Currently, all 17+ MCP tools are defined in a single server.py file, which makes the codebase difficult to navigate and maintain. As the project grows, this monolithic structure will become increasingly unwieldy.
Proposed Solution
Restructure the codebase to separate MCP tools into logical modules:
Suggested Structure
src/lampyrid/
├── server.py # FastMCP server initialization and configuration
├── tools/
│ ├── __init__.py # Tool registration
│ ├── accounts.py # Account management tools (list_accounts, search_accounts, get_account)
│ ├── transactions.py # Transaction management tools (CRUD operations)
│ └── budgets.py # Budget management tools (list, get, spending analysis)
Benefits
- Improved Maintainability: Each module focuses on a specific domain
- Better Navigation: Easier to locate and modify specific tools
- Cleaner Code: Reduced file size and better separation of concerns
- Scalability: Easier to add new tools without cluttering a single file
- Testing: Can test tool modules independently
Implementation Considerations
- Maintain existing FastMCP server initialization pattern
- Keep all tool tags and metadata intact
- Ensure no breaking changes to the MCP interface
- Update tests to reflect new structure
- Update documentation to reference new file locations
Current Stats
server.py contains all 17+ MCP tools
- File is becoming difficult to navigate
- Clear domain boundaries already exist (accounts, transactions, budgets)
This refactoring aligns with the project's clean architecture principles and will make future development more efficient.
Problem
Currently, all 17+ MCP tools are defined in a single
server.pyfile, which makes the codebase difficult to navigate and maintain. As the project grows, this monolithic structure will become increasingly unwieldy.Proposed Solution
Restructure the codebase to separate MCP tools into logical modules:
Suggested Structure
Benefits
Implementation Considerations
Current Stats
server.pycontains all 17+ MCP toolsThis refactoring aligns with the project's clean architecture principles and will make future development more efficient.