mcp-proxy

by stephenlacy

A Rust 双向 MCP 代理,支持 stdio 和 SSE 之间的通信,并集成 OAuth。支持连接远程 MCP 服务器(通过 SSE)并将其作为 stdio 服务器暴露,反之亦然。

Developer toolsstdioCommunity

Repository-wide counts · Cached 2026-03-08

Overview

The mcp-proxy MCP server is a publicly available project. Review the upstream repository for installation instructions, supported tools, compatibility, permissions, and current maintenance status.

Configuration

Configuration, transport, authentication, and runtime requirements vary by project. Open the repository before connecting and use the smallest set of credentials and permissions required.

Open the mcp-proxy repository to read the latest documentation.

KEEP EXPLORING

Compare source, connection, and authentication details before choosing an implementation.

View the complete category

模型上下文协议服务器

modelcontextprotocol

Community

一组用于模型上下文协议(MCP)的参考实现,展示了对大型语言模型(LLM)工具和数据源的安全且受控的访问方式。

Context7 Platform - Up-to-date Code Docs For Any Prompt

upstash

Community

Context7 MCP server providing up-to-date, version-specific documentation and code examples for libraries, enabling coding agents to fetch accurate docs and code snippets. Requires an API key for higher rate limits, passed via CONTEXT7_API_KEY header.

Playwright MCP

Microsoft Corporation

Community

A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. Enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.

AIHawk

feder-cr

Community

AIHawk is an anti detect browser and web browsing agent, open source, with an MCP server for coding agents: undetected, no captchas, no blocks. It requires an OpenRouter API key for the standalone web UI mode, which can be provided via the --openrouter-key flag or the OPENROUTER_API_KEY environment variable or a .env file in the running directory.

FROM THE SOURCE

Repository README

Build-time snapshot · Retrieved 2026-10-05

View original

mcp-proxy

A Rust bidirectional MCP proxy supporting SSE and Streamable HTTP transports with OAuth.

Features

  • Multiple transports: SSE and Streamable HTTP
  • OAuth authentication: Full OAuth flow with automatic token refresh
  • Bidirectional proxy: Connect remote servers to local clients or expose local servers remotely
  • Fast and lightweight: Built in rust for performance

Usage

Installing

# from crates.io
cargo install rmcp-proxy
# from github
cargo install --git https://github.com/stephenlacy/mcp-proxy

Building

cargo build --release

Running

The proxy can operate in two modes:

1. Remote Client Mode

Connect to a remote MCP server and expose it as a local stdio server. Supports both SSE and Streamable HTTP transports with automatic detection.

Transport Detection:

  • URLs containing /sse → Uses SSE transport
  • All other URLs → Uses Streamable HTTP transport
  • Override with --transport flag
Basic Examples
# Streamable HTTP
mcp-proxy http://localhost:9090/mcp/instances_abc123

# SSE transport
mcp-proxy http://localhost:8080/sse
mcp-proxy --transport sse http://localhost:8080/events

# Specific
mcp-proxy --transport streamable-http http://localhost:9090/api
Using with Claude or Cursor
{
  "mcpServers": {
    "my-remote-server": {
      "command": "mcp-proxy",
      "args": ["http://example.com/mcp/instances_abc123"]
    },
    "sse-server": {
      "command": "mcp-proxy", 
      "args": ["--transport", "sse", "http://example.com/sse"]
    }
  }
}
2. Local Server Mode

Connect to a local MCP server via stdio and expose it as a remote server. Supports both SSE and Streamable HTTP endpoints.

# Expose as SSE server
mcp-proxy --port 8080 -- your-command --arg1 value1 --arg2 value2
mcp-proxy --port 8080 python mcp_server.py
mcp-proxy --port 8080 -- npx -y @modelcontextprotocol/server-everything

# Or http+streamable
mcp-proxy --port 9090 --transport streamable-http -- python mcp_server.py

mcp-proxy --port 8080 -e KEY VALUE -e ANOTHER_KEY ANOTHER_VALUE -- your-command

Authentication Management

Clearing Auth Cache

If you encounter authentication issues, clear the auth cache:

# Clear all auth data
mcp-proxy reset

# Or manually delete the directory
rm -rf ~/.mcp-auth

Command Line Options

# Transport selection
--transport <TRANSPORT>    # sse, streamable-http, or auto (default: auto)

# Server mode options
--port <PORT>             # Port for local server mode (default: random)
--host <HOST>             # Host to bind to (default: 127.0.0.1)

# Environment variables (server mode)
-e, --env <KEY> <VALUE>   # Set environment variable
--pass-environment        # Pass through all environment variables

# Headers (client mode) 
-H, --headers <KEY> <VALUE>  # Add custom headers

# Reset auth
mcp-proxy reset           # Clear all stored auth data

Logging

The upstream rmcp crate dumps noisy logs unfortunately

Control log verbosity with the RUST_LOG environment variable:

# Minimal logging
RUST_LOG=error mcp-proxy http://example.com/mcp
RUST_LOG=debug mcp-proxy http://example.com/mcp
RUST_LOG=info mcp-proxy http://example.com/mcp

Library Usage

use rmcp_proxy::{
    sse_client::run_sse_client,
    streamable_http_client::run_streamable_http_client,
    StreamableHttpClientConfig, SseClientConfig
};

// Streamable HTTP client
let config = StreamableHttpClientConfig {
    url: "http://example.com/mcp/instances_abc123".to_string(),
    headers: HashMap::new(),
};
run_streamable_http_client(config).await?;

// SSE client  
let config = SseClientConfig {
    url: "http://example.com/sse".to_string(),
    headers: HashMap::new(),
};
run_sse_client(config).await?;

License

MIT