mcp-proxy

mcp-proxy

By stephenlacy GitHub

Fast rust MCP proxy between stdio and SSE

proxy mcp
Overview

what is mcp-proxy?

mcp-proxy is a Rust-based bidirectional proxy that connects standard input/output (stdio) to Server-Sent Events (SSE), allowing seamless communication between local and remote servers.

how to use mcp-proxy?

To use mcp-proxy, install it via Cargo, build it, and run it in either SSE Client Mode or Stdio Client Mode, depending on your needs.

key features of mcp-proxy?

  • Connects to remote servers over SSE and exposes them as stdio servers.
  • Connects local stdio servers and exposes them as SSE servers.
  • Fast startup with minimal memory usage.

use cases of mcp-proxy?

  1. Connecting local applications to remote servers using SSE.
  2. Exposing local command-line tools as SSE services.
  3. Facilitating communication between different server types in a microservices architecture.

FAQ from mcp-proxy?

  • What programming language is mcp-proxy written in?

mcp-proxy is written in Rust.

  • How do I install mcp-proxy?

You can install it using Cargo with the command: cargo install mcp-proxy.

  • Can I use mcp-proxy with any command-line tool?

Yes, mcp-proxy can expose any command-line tool as an SSE server.

Content

mcp-proxy

A Rust bidirectional MCP proxy between stdio and SSE. Based initially on sparfenyuk/mcp-proxy

Features

  • Connect to a remote server over SSE and expose it as a stdio server
  • Connect to a local server using stdio and expose it as an SSE server
  • Fast startup with minimal memory usage

Usage

Installing

# from crates.io
cargo install rmcp-proxy

cargo install --git https://github.com/stephenlacy/mcp-proxy

Building

cargo build --release

Running

The proxy can operate in two modes:

1. SSE Client Mode

Connect to a remote MCP server over SSE and expose it as a stdio server.

This allows a local client such as Claude or Cursor connect to a remote server running on SSE.

Example
mcp-proxy http://localhost:8080/sse
mcp-proxy --headers Authorization 'Bearer YOUR_TOKEN' http://localhost:8080/sse
Using with Claude or Cursor
{
  "mcpServers": {
    "mcp-proxy": {
      "command": "mcp-proxy",
      "args": ["http://example.com/sse"]
    }
  }
}

2. Stdio Client Mode

Connect to a local command using stdio and expose it as an SSE server.

This allows remote SSE connections to a local stdio server.

mcp-proxy --sse-port 8080 -- your-command --arg1 value1 --arg2 value2
mcp-proxy --sse-port 8080 -e KEY VALUE -e ANOTHER_KEY ANOTHER_VALUE -- your-command --arg1 value1 --arg2 value2
mcp-proxy --sse-port 8080 python mcp_server.py
mcp-proxy --sse-port 8080 -- npx -y @modelcontextprotocol/server-everything

Using as a library

use rmcp::{
    ServiceExt,
    model::{ClientCapabilities, ClientInfo},
    transport::{sse::SseTransport, stdio},
};

use rmcp_proxy::proxy_handler::ProxyHandler;

// Create SSE transport
let transport = SseTransport::start(&config.url).await?;

let client_info = ClientInfo {
    protocol_version: Default::default(),
    capabilities: ClientCapabilities::builder()
        .enable_experimental()
        .enable_roots()
        .enable_roots_list_changed()
        .enable_sampling()
        .build(),
    ..Default::default()
};

// Create client service with transport
let client = client_info.serve(transport).await?;

// Get server info
let server_info = client.peer_info();
info!("Connected to server: {}", server_info.server_info.name);

// Create proxy handler
let proxy_handler = ProxyHandler::new(client);

// Create stdio transport
let stdio_transport = stdio();

// Create server with proxy handler and stdio transport
let server = proxy_handler.serve(stdio_transport).await?;

License

MIT

No tools information available.
School MCP
School MCP by 54yyyu

A Model Context Protocol (MCP) server for academic tools, integrating with Canvas and Gradescope platforms.

canvas mcp
View Details
repo-template
repo-template by loonghao

A Model Context Protocol (MCP) server for Python package intelligence, providing structured queries for PyPI packages and GitHub repositories. Features include dependency analysis, version tracking, and package metadata retrieval for LLM interactions.

-

google-calendar mcp
View Details
strava-mcp
strava-mcp by jeremysilva1098

MCP server for strava

strava mcp
View Details

Model Context Protocol (MCP) server implementation for Rhinoceros/Grasshopper integration, enabling AI models to interact with parametric design tools

grasshopper mcp
View Details

MCP configuration to connect AI agent to a Linux machine.

security mcp
View Details

AI assistant built with Streamlit, NVIDIA NIM (LLaMa 3.3:70B) / Ollama, and Model Control Protocol (MCP).

python mcp
View Details