Skip to main content
The LiteLLM gateway acts as an MCP (Model Context Protocol) proxy β€” it forwards requests from AI clients to MCP servers and injects upstream credentials at the wire level. Agents never hold real MCP server credentials.

Configuration

MCP servers are declared in config.yaml using the same dict-keyed format as LiteLLM:

Endpoints

Route to a specific server

Auto-select server

The gateway selects the server using (in priority order):
  1. x-litellm-mcp-server: <name> header
  2. ?server=<name> query parameter
  3. First configured server (if only one)
All MCP endpoints require Authorization: Bearer <master-key>.

Supported auth types

Referencing secrets

Auth values starting with os.environ/ are read from environment variables at boot:
This keeps credentials out of config.yaml and version control.

Current limitations

These features from LiteLLM’s hosted MCP are not yet supported:
  • Multi-server aggregation behind a single /mcp endpoint
  • Per-request upstream credentials via x-mcp-{server}-{header}
  • oauth2 and aws_sigv4 auth types
  • sse and stdio transports (HTTP only)