proxy
MCP Proxy
Section titled “MCP 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
Structs
Section titled “Structs”McpProxyConfig
Section titled “McpProxyConfig”MCP Proxy Configuration
Fields
| Field | Type | Description |
|---|---|---|
servers | Vec<McpProxyTarget> | Target MCP servers the proxy routes to |
proxy_auth | Option<String> | Proxy authentication (for incoming requests) |
timeout_seconds | u64 | Default timeout for requests (seconds) |
McpProxyTarget
Section titled “McpProxyTarget”MCP Proxy Target - An external MCP server the proxy connects to
Fields
| Field | Type | Description |
|---|---|---|
name | String | Server identifier |
sse_endpoint | String | SSE endpoint URL (e.g., “https://api.example.com/sse”) |
auth_token | Option<String> | Authentication token for this server |
description | Option<String> | Server description |
McpProxy
Section titled “McpProxy”MCP Proxy - Routes between internal HTTP and external SSE
Methods
fn new(config: McpProxyConfig) -> SelfCreate new MCP proxy
list_tools_async
Section titled “list_tools_async”async fn list_tools_async(&self) -> Result<Vec<Tool>, ProtocolError>List tools from all servers (async version)
call_tool_async
Section titled “call_tool_async”async fn call_tool_async(&self, name: &str, arguments: Option<serde_json::Value>) -> Result<CallToolResult, ProtocolError>Call tool (async version)
health_check_all
Section titled “health_check_all”async fn health_check_all(&self) -> HashMap<String, bool>Health check all servers
McpProxyBuilder
Section titled “McpProxyBuilder”MCP Proxy Builder - Convenient proxy configuration
Methods
fn new() -> SelfCreate new proxy builder
add_server
Section titled “add_server”fn add_server(self, name: &str, sse_endpoint: &str) -> SelfAdd MCP server
add_server_with_auth
Section titled “add_server_with_auth”fn add_server_with_auth(self, name: &str, sse_endpoint: &str, auth_token: &str) -> SelfAdd MCP server with authentication
with_proxy_auth
Section titled “with_proxy_auth”fn with_proxy_auth(self, auth_token: &str) -> SelfSet proxy authentication token
with_timeout
Section titled “with_timeout”fn with_timeout(self, timeout_seconds: u64) -> SelfSet timeout for external requests
fn build(self) -> McpProxyBuild the MCP proxy