Overview
UMCP acts as a transport bridge, allowing you to connect to MCP providers that use different transport protocols and expose them all through a single unified interface. This means downstream clients only need to connect to UMCP using one transport type, while UMCP handles the complexity of connecting to providers via their native transports.Supported Transports
UMCP supports three MCP transport protocols:- stdio - Standard input/output (process-based)
- sse - Server-Sent Events (HTTP-based)
- streamable-http - Streamable HTTP (modern HTTP-based)
config.ts:11:
How Transport Bridging Works
Upstream Connections
Each provider in your configuration specifies its transport type. UMCP creates the appropriate client connection based on thetransport field:
Downstream Interface
UMCP exposes a single downstream interface that clients connect to. You choose the downstream transport when starting UMCP:Transport-Specific Configuration
stdio Transport
Forstdio providers, you must specify a command and optionally args. From config.ts:46-52:
HTTP Transports (sse & streamable-http)
For HTTP-based transports, you must specify aurl. From config.ts:54-61:
Downstream Server Implementation
UMCP’sserve.ts module handles both stdio and HTTP downstream connections.
stdio Server
The stdio server usesStdioServerTransport from the MCP SDK. From serve.ts:109-114:
HTTP Server
The HTTP server usesStreamableHTTPServerTransport and handles multiple HTTP methods. From serve.ts:116-177:
Server Setup Flow
The mainrunServe function orchestrates the entire server setup. From serve.ts:179-209:
- Load configuration
- Create environment pool (for round-robin rotation)
- Create provider manager (handles upstream connections)
- Create MCP server
- Discover and register tools
- Start appropriate transport (stdio or HTTP)
HTTP Request Handling
The HTTP server supports GET, POST, and DELETE methods, matching the MCP protocol requirements:- GET: Typically used for session management
- POST: Used for tool calls and other operations
- DELETE: Used for session cleanup
serve.ts:138-149:
Request Body Parsing
For POST requests, UMCP reads and parses JSON bodies with size limits. Fromserve.ts:30-51:
Path Normalization
HTTP endpoint paths are automatically normalized to start with a forward slash. Fromserve.ts:26-28:
Use Cases
Local Development
Connect to local stdio tools and expose them via HTTP:http://localhost:3000/mcp instead of managing multiple stdio processes.
Centralized Gateway
Create a single HTTP endpoint that aggregates tools from multiple sources:- Local stdio tools (file system, shell commands)
- Remote HTTP services (cloud APIs)
- Legacy SSE providers
Cloud Deployment
Deploy UMCP as an HTTP service that bridges to stdio tools running in containers:Best Practices
- Choose the right downstream transport: Use stdio for local development and HTTP for networked access
- Secure HTTP deployments: Use reverse proxies (nginx, Caddy) to add TLS and authentication
- Monitor provider health: Watch logs for upstream connection failures
- Set appropriate timeouts: Consider network latency when connecting to remote HTTP providers
Graceful Shutdown
UMCP handles shutdown signals to cleanly close all connections. Fromserve.ts:53-81:
- SIGINT: Ctrl+C in terminal
- SIGTERM: Standard termination signal
- stdin close: When stdin pipe closes (stdio mode only)