[loop-generated] [refactor] Split timmy/mcp_bridge.py — 544 lines, MCP protocol integration #1394

Closed
opened 2026-03-24 11:50:59 +00:00 by Timmy · 1 comment
Owner

Current State:

  • src/timmy/mcp_bridge.py is 544 lines handling MCP (Model Context Protocol) integration
  • Contains protocol implementation, server management, tool bridging, and message routing
  • Critical component for external tool integration and protocol compliance

Proposed Split:

src/timmy/mcp/
├── __init__.py          # Main MCP interface
├── protocol.py          # Core MCP protocol implementation
├── server.py            # MCP server management and lifecycle
├── tools.py             # Tool bridging and capability mapping
├── messages.py          # Message routing and serialization
└── client.py            # MCP client connection management

Benefits:

  • Better protocol version management
  • Easier to add new MCP features
  • Improved error handling and debugging
  • Better separation of client vs server concerns

Acceptance Criteria:

  • All MCP functionality preserved
  • Protocol compliance maintained
  • Tests pass
  • Tool integration still works
  • Each module under 150 lines
**Current State:** - `src/timmy/mcp_bridge.py` is 544 lines handling MCP (Model Context Protocol) integration - Contains protocol implementation, server management, tool bridging, and message routing - Critical component for external tool integration and protocol compliance **Proposed Split:** ``` src/timmy/mcp/ ├── __init__.py # Main MCP interface ├── protocol.py # Core MCP protocol implementation ├── server.py # MCP server management and lifecycle ├── tools.py # Tool bridging and capability mapping ├── messages.py # Message routing and serialization └── client.py # MCP client connection management ``` **Benefits:** - Better protocol version management - Easier to add new MCP features - Improved error handling and debugging - Better separation of client vs server concerns **Acceptance Criteria:** - [ ] All MCP functionality preserved - [ ] Protocol compliance maintained - [ ] Tests pass - [ ] Tool integration still works - [ ] Each module under 150 lines
Author
Owner

Split src/timmy/mcp_bridge.py (544 lines) into focused modules:

Target structure:

  • src/timmy/mcp/bridge_core.py - Main bridge logic and connection handling
  • src/timmy/mcp/tool_registry.py - Tool registration and discovery
  • src/timmy/mcp/protocol_handler.py - Low-level MCP protocol operations

Instructions:

  1. Analyze the file to understand the logical separation points
  2. Split into 3 files maintaining all functionality
  3. Update imports in any files that reference mcp_bridge
  4. Ensure all tests pass: tox -e unit
  5. Verify no circular imports

Verification:

  • All existing functionality preserved
  • No test failures
  • Each new file <200 lines
  • Clear separation of concerns
Split src/timmy/mcp_bridge.py (544 lines) into focused modules: **Target structure:** - src/timmy/mcp/bridge_core.py - Main bridge logic and connection handling - src/timmy/mcp/tool_registry.py - Tool registration and discovery - src/timmy/mcp/protocol_handler.py - Low-level MCP protocol operations **Instructions:** 1. Analyze the file to understand the logical separation points 2. Split into 3 files maintaining all functionality 3. Update imports in any files that reference mcp_bridge 4. Ensure all tests pass: `tox -e unit` 5. Verify no circular imports **Verification:** - All existing functionality preserved - No test failures - Each new file <200 lines - Clear separation of concerns
kimi was assigned by Timmy 2026-03-24 11:55:56 +00:00
kimi was unassigned by Timmy 2026-03-24 19:33:26 +00:00
Timmy closed this issue 2026-03-24 21:54:16 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1394