# Project TODO List This document outlines the tasks to be completed for the `mcp-bridge` project. ## Phase 1: Core Functionality - [x] **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` - [x] **Configuration Handling** - [x] Implement YAML parsing for `config.yaml` - [x] Implement loading of service-specific YAML files - [x] Finalize YAML structure (e.g., use a map for services, add `command` for adapter) - [x] **HTTP Server** - [x] Create basic HTTP server that binds to `localhost` - [x] Implement configurable port via command-line flag - [x] **MCP Adapter Management** - [x] Implement logic to spawn MCP adapters as child processes - [x] Manage the lifecycle of adapter processes (start, stop) - [x] **MCP Communication** - [x] Implement `stdio`-based communication with child processes - [x] Implement JSON-RPC 2.0 message serialization/deserialization - [x] **Request Routing** - [x] Implement handler to parse `?service=` query parameter - [x] Route incoming HTTP requests to the correct MCP service based on the query param - [x] Handle default service logic when the query param is omitted ## Phase 2: Features & Refinements - [x] **Endpoint Mapping** - [x] Map HTTP POST requests to the `tools/call` MCP method - [x] Pass request body as parameters to the MCP call - [x] **Error Handling** - [x] Translate MCP errors to appropriate HTTP status codes (400, 500) - [x] 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`