serve command starts the UMCP server, which aggregates multiple upstream MCP servers and exposes their tools through a unified interface.
Usage
serve is the default command, you can omit it:
Transport Options
stdio Transport (Default)
HTTP Transport
Flags
The transport protocol to use for the MCP server.Options:
stdio- Standard input/output (default)http- Streamable HTTP server
- If the value is not
stdioorhttp, UMCP exits with an error:
The host address to bind the HTTP server to. Only used when
--transport http.Examples:This flag is ignored when using
--transport stdio.The port number to bind the HTTP server to. Only used when
--transport http.Validation:- Must be a positive integer
- If invalid, UMCP exits with an error:
This flag is ignored when using
--transport stdio.The endpoint path for the HTTP server. Only used when
--transport http.Path normalization:- Paths without a leading
/are automatically prefixed with/ - Example:
mcpbecomes/mcp
This flag is ignored when using
--transport stdio.Path to the UMCP configuration file.Examples:
On first run, if the default config file doesn’t exist, UMCP auto-creates it with detailed placeholders.
Examples
Default stdio Server
- Transport:
stdio - Config:
~/.config/umcp/umcp.jsonc
HTTP Server with Custom Port
- Transport:
http - Host:
127.0.0.1(default) - Port:
3000 - Path:
/mcp(default)
Full HTTP Configuration
Custom Config File
Combined Options
HTTP Endpoint Behavior
When running with--transport http, the server:
- Accepts requests at the configured endpoint path (default
/mcp) - Returns 404 for other paths:
- Supports methods:
POST,GET,DELETE - Returns 405 for unsupported methods:
- Request body limit: 1 MB maximum
- Error responses are JSON:
Shutdown Signals
The server gracefully handles shutdown signals:- stdio transport:
SIGINT,SIGTERM, stdin close - http transport:
SIGINT,SIGTERM
- Close all upstream provider connections
- Close the MCP server
- (HTTP only) Close the HTTP server
- Exit gracefully
Startup Process
When you runumcp serve, it:
-
Loads configuration from the specified config file
-
Connects to providers defined in your config
-
Discovers tools from all upstream servers
-
Registers unified tools with namespaced names
- Starts the server on the configured transport
Error Handling
Invalid Transport
Invalid Port
Config File Issues
If the config file has errors, UMCP will exit with validation details. See validate command for more information.Structured Logs
All logs are emitted as JSON lines to stderr:Next Steps
Configuration
Configure your MCP providers
Validate
Validate your configuration