Skip to content

proxy

Transport-aware proxy for connecting to MCP servers

  • Client ↔ Proxy: HTTP/JSON-RPC (internal)
  • Proxy ↔ MCP Server: SSE (web-standard)
  • Multi-server routing with authentication

MCP Proxy Configuration

Fields

FieldTypeDescription
serversVec<McpProxyTarget>Target MCP servers the proxy routes to
proxy_authOption<String>Proxy authentication (for incoming requests)
timeout_secondsu64Default timeout for requests (seconds)

MCP Proxy Target - An external MCP server the proxy connects to

Fields

FieldTypeDescription
nameStringServer identifier
sse_endpointStringSSE endpoint URL (e.g., “https://api.example.com/sse”)
auth_tokenOption<String>Authentication token for this server
descriptionOption<String>Server description

MCP Proxy - Routes between internal HTTP and external SSE

Methods

fn new(config: McpProxyConfig) -> Self

Create new MCP proxy

async fn list_tools_async(&self) -> Result<Vec<Tool>, ProtocolError>

List tools from all servers (async version)

async fn call_tool_async(&self, name: &str, arguments: Option<serde_json::Value>) -> Result<CallToolResult, ProtocolError>

Call tool (async version)

async fn health_check_all(&self) -> HashMap<String, bool>

Health check all servers

MCP Proxy Builder - Convenient proxy configuration

Methods

fn new() -> Self

Create new proxy builder

fn add_server(self, name: &str, sse_endpoint: &str) -> Self

Add MCP server

fn add_server_with_auth(self, name: &str, sse_endpoint: &str, auth_token: &str) -> Self

Add MCP server with authentication

fn with_proxy_auth(self, auth_token: &str) -> Self

Set proxy authentication token

fn with_timeout(self, timeout_seconds: u64) -> Self

Set timeout for external requests

fn build(self) -> McpProxy

Build the MCP proxy