# Mcp Proxy

> Fast rust MCP proxy between stdio and SSE

- **Type:** MCP server
- **Install:** `agentstack add mcp-stephenlacy-mcp-proxy`
- **Verified:** Pending review
- **Seller:** [stephenlacy](https://agentstack.voostack.com/s/stephenlacy)
- **Installs:** 0
- **Category:** [Security](https://agentstack.voostack.com/c/security)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [stephenlacy](https://github.com/stephenlacy)
- **Source:** https://github.com/stephenlacy/mcp-proxy

## Install

```sh
agentstack add mcp-stephenlacy-mcp-proxy
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

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

### Building

```bash
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

```bash
# 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

```json
{
  "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.

```bash
# 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:

```bash
# Clear all auth data
mcp-proxy reset

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

### Command Line Options

```bash
# Transport selection
--transport     # sse, streamable-http, or auto (default: auto)

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

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

# Headers (client mode) 
-H, --headers    # 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:

```bash
# 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

```rust
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

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [stephenlacy](https://github.com/stephenlacy)
- **Source:** [stephenlacy/mcp-proxy](https://github.com/stephenlacy/mcp-proxy)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: flagged — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-stephenlacy-mcp-proxy
- Seller: https://agentstack.voostack.com/s/stephenlacy
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
