Skip to content

feat(mcp binary bridge):#21

Merged
ChrisCoder9000 merged 1 commit intomainfrom
development
Feb 22, 2026
Merged

feat(mcp binary bridge):#21
ChrisCoder9000 merged 1 commit intomainfrom
development

Conversation

@ChrisCoder9000
Copy link
Copy Markdown
Contributor

@ChrisCoder9000 ChrisCoder9000 commented Feb 22, 2026

  • featured binary to connect to brainapi mcp without deps

Summary by CodeRabbit

  • New Features

    • Added MCP stdio ↔ HTTP bridge service for translating between standard input/output and HTTP-based MCP server communication with streaming response support and automatic network error recovery.
  • Chores

    • Updated build system and webserver configuration to support the new bridge service.

- featured binary to connect to brainapi mcp without deps
@ChrisCoder9000 ChrisCoder9000 merged commit 2a86cb5 into main Feb 22, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 22, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

A new Rust-based MCP stdio-to-HTTP bridge service is introduced with complete implementation including configuration management, async I/O handling, remote transport with SSE support, and graceful shutdown. Build infrastructure is updated with new Makefile targets, and webserver configuration is modified for enhanced networking capabilities.

Changes

Cohort / File(s) Summary
New MCP Bridge Service
mcp-stdio-http-bridge/Cargo.toml, mcp-stdio-http-bridge/rust-toolchain.toml, mcp-stdio-http-bridge/README.md, mcp-stdio-http-bridge/src/lib.rs, mcp-stdio-http-bridge/src/main.rs, mcp-stdio-http-bridge/src/bridge.rs, mcp-stdio-http-bridge/src/config.rs, mcp-stdio-http-bridge/src/remote_transport.rs, mcp-stdio-http-bridge/src/stdio.rs
New Rust project implementing a stdio-to-HTTP bridge for MCP with async message forwarding, exponential backoff retry logic, SSE parsing, and graceful shutdown via signals. Includes configuration from environment variables, HTTP transport with Bearer token support, and stdin/stdout I/O utilities.
Build & Ignore Configuration
.gitignore, Makefile
Added Makefile targets for building the MCP bridge (standard and x86 release builds) and starting nginx. Updated .gitignore to track READMEP.md, .DS_Store exclusion, .favorites.json inclusion toggle, and nuanced rules for bridge target artifacts.
Webserver Infrastructure
src/services/webserver/docker-compose.yaml, src/services/webserver/nginx/nginx.conf
Updated Docker Compose image tag and container naming, added port mappings (80, 443), docker host alias configuration, and healthcheck parameters. Modified nginx configuration to remove external HTTPS/TLS, proxy traffic through docker host alias (host.docker.internal), and add forwarding headers.

Sequence Diagram(s)

sequenceDiagram
    participant stdin as stdin
    participant stdinReader as stdin_reader<br/>(Task)
    participant inputChan as input Channel
    participant bridge as bridge<br/>(Task)
    participant httpClient as HTTP Client
    participant remoteServer as Remote MCP<br/>Server
    participant outputChan as output Channel
    participant stdoutWriter as stdout_writer<br/>(Task)
    participant stdout as stdout

    rect rgba(100, 150, 200, 0.5)
    Note over stdin,stdout: Initialization & Startup
    stdinReader->>stdinReader: Start reading from stdin
    bridge->>bridge: Load config from env
    stdoutWriter->>stdoutWriter: Start listening to output channel
    end

    rect rgba(100, 150, 200, 0.5)
    Note over stdin,stdout: Normal Message Flow
    stdin->>stdinReader: JSON-RPC message
    stdinReader->>inputChan: Send message
    inputChan->>bridge: Receive message
    bridge->>httpClient: Build POST request
    httpClient->>remoteServer: Send (with optional Bearer token)
    remoteServer->>httpClient: Response (202 or SSE stream)
    httpClient->>bridge: Parse response/SSE to JSON lines
    bridge->>outputChan: Send each response line
    outputChan->>stdoutWriter: Receive lines
    stdoutWriter->>stdout: Write newline-delimited JSON
    end

    rect rgba(200, 100, 100, 0.5)
    Note over stdin,stdout: Error & Retry Handling
    bridge->>httpClient: Retry with exponential backoff
    httpClient-->>remoteServer: Retry after delay
    bridge->>outputChan: Send JSON-RPC error on non-retryable failure
    end

    rect rgba(100, 200, 100, 0.5)
    Note over stdin,stdout: Graceful Shutdown (SIGINT/SIGTERM)
    bridge->>bridge: Receive shutdown signal
    bridge->>inputChan: Stop accepting messages
    bridge->>outputChan: Drain pending items
    stdinReader->>stdinReader: Cancel and exit
    stdoutWriter->>stdoutWriter: Cancel and exit
    bridge->>bridge: Exit cleanly
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A bridge of bits and bytes so bright,
From stdio flows to HTTP's flight,
With backoff bouncing, SSE streams,
And graceful shutdowns—dev dreams!
The rabbit hops through async code,
Building paths on the network road. 🌉

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch development

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant