# Project TODO List This document outlines the tasks to be completed for the `mcp-bridge` project. ## Phase 1: Core Functionality - [ ] **Project Setup** - [x] Initialize Git repository and connect to remote - [x] Create directory structure (`/src`, `/test`, `/dist`) - [x] Create placeholder `build-test-deploy.sh` and `install.sh` - [ ] **Configuration Handling** - [ ] Implement YAML parsing for `config.yaml` - [ ] Implement loading of service-specific YAML files - [ ] Finalize YAML structure (e.g., use a map for services, add `command` for adapter) - [ ] **HTTP Server** - [ ] Create basic HTTP server that binds to `localhost` - [ ] Implement configurable port via command-line flag - [ ] **MCP Adapter Management** - [ ] Implement logic to spawn MCP adapters as child processes - [ ] Manage the lifecycle of adapter processes (start, stop) - [ ] **MCP Communication** - [ ] Implement `stdio`-based communication with child processes - [ ] Implement JSON-RPC 2.0 message serialization/deserialization - [ ] **Request Routing** - [ ] Implement handler to parse `?service=` query parameter - [ ] Route incoming HTTP requests to the correct MCP service based on the query param - [ ] Handle default service logic when the query param is omitted ## Phase 2: Features & Refinements - [ ] **Session Management** - [ ] Implement transparent MCP session handling (initialize and store `sessionId` internally) - [ ] **Endpoint Mapping** - [ ] Map HTTP POST requests to the `tools/call` MCP method - [ ] Pass request body as parameters to the MCP call - [ ] **Error Handling** - [ ] Translate MCP errors to appropriate HTTP status codes (400, 500) - [ ] Implement graceful handling for config errors, missing services, etc. - [ ] **Logging** - [ ] Add structured logging for requests, responses, and errors - [ ] Implement configurable verbosity via a command-line flag (e.g., `-v`) - [ ] **Configuration Reload** - [ ] Implement dynamic config reload via `SIGHUP` signal - [ ] Implement `/reload` HTTP endpoint - [ ] Define and implement session/process behavior on reload ## Phase 3: Testing & Distribution - [ ] **Build & Installation Scripts** - [ ] Populate `build-test-deploy.sh` to compile for multiple architectures (macOS, Linux, Windows) and place binaries in `./dist` - [ ] Populate `install.sh` to download and install the correct binary for the user's system - [ ] **Testing** - [ ] Create basic unit tests for HTTP handling and request routing in `/test` - [ ] Create integration tests for MCP communication - [ ] **Documentation** - [ ] Create `README.md` with comprehensive installation, configuration, and usage instructions - [ ] Provide sample `config.yaml` and `service1.yaml` files - [ ] **Finalization** - [ ] Commit compiled binaries to the `./dist` directory - [ ] Tag a version `v1.0.0`