Crate mcp_streamable_proxy

Crate mcp_streamable_proxy 

Source
Expand description

MCP Streamable HTTP Proxy Module

This module provides a proxy implementation for MCP (Model Context Protocol) using Streamable HTTP transport with stateful session management.

§Features

  • Streamable HTTP Support: Uses rmcp 0.12 with enhanced Streamable HTTP transport
  • Stateful Sessions: Custom SessionManager with backend version tracking
  • Hot Swap: Supports backend connection replacement without downtime
  • Version Control: Automatically invalidates sessions when backend reconnects

§Architecture

Client → Streamable HTTP → ProxyAwareSessionManager → ProxyHandler → Backend MCP Service
                                   ↓
                           Version Tracking
                           (DashMap<SessionId, BackendVersion>)

Re-exports§

pub use proxy_handler::ProxyHandler;
pub use session_manager::ProxyAwareSessionManager;
pub use server::run_stream_server;
pub use server::run_stream_server_from_config;

Modules§

config
Configuration types for Streamable HTTP proxy
proxy_handler
server
Streamable HTTP server implementation
session_manager
Session Manager with backend version tracking

Structs§

McpServiceConfig
MCP 服务配置
Peer
An interface to fetch the remote client or server
RoleClient
RoleServer
RunningService
ToolFilter
工具过滤配置

Traits§

ServerHandler

Type Aliases§

ClientInfo
ServerInfo