Install
$ agentstack add mcp-wklee610-litellm-mcp ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
LiteLLM MCP Server
An MCP server for LiteLLM operations. At startup it reads the LiteLLM proxy OpenAPI document and registers one FastMCP tool per LiteLLM endpoint.
Features
- Full LiteLLM API coverage: Registers every operation in
GET /openapi.json. - Version-aware tools: Tool names come from LiteLLM
operationIdvalues, so
the exposed tools follow the running LiteLLM version.
- Discovery helpers: Includes tools to list/search registered LiteLLM tools
and inspect individual endpoint mappings.
- Environment-based config: Reads the LiteLLM URL and master key from env vars.
Prerequisites
- Python 3.10+
uvpackage manager recommended- A reachable LiteLLM proxy
- A LiteLLM master key or admin key
Installation
uv sync
Configuration
The server reads LiteLLM connection settings from environment variables. It fetches ${LITELLM_URL}/openapi.json during startup.
LITELLM_URL: LiteLLM proxy base URL, for examplehttp://localhost:4000.LITELLM_MASTER_KEY: LiteLLM master key or admin key.LITELLM_TIMEOUT_SECONDS: Optional request timeout in seconds. Defaults to30.MCP_TRANSPORT: MCP transport, eitherstdio(default) orhttp.MCP_HOST: HTTP bind address. Defaults to0.0.0.0.MCP_PORT: HTTP bind port. Defaults to8000.
Usage
Running the Server
export LITELLM_URL=http://localhost:4000
export LITELLM_MASTER_KEY=sk-...
uv run litellm-mcp
The default transport is stdio. To expose the server through FastMCP's Streamable HTTP transport instead:
export MCP_TRANSPORT=http
export MCP_HOST=0.0.0.0
export MCP_PORT=8000
uv run litellm-mcp
Clients can then connect to http://localhost:8000/mcp.
Using Docker
docker build -t litellm-mcp .
docker run -i --rm \
-e LITELLM_URL=http://host.docker.internal:4000 \
-e LITELLM_MASTER_KEY=sk-... \
litellm-mcp
For Streamable HTTP:
docker run --rm -p 8000:8000 \
-e LITELLM_URL=http://host.docker.internal:4000 \
-e LITELLM_MASTER_KEY=sk-... \
-e MCP_TRANSPORT=http \
litellm-mcp
Claude Desktop Configuration
{
"mcpServers": {
"litellm": {
"command": "",
"args": [
"--directory",
"",
"run",
"litellm-mcp"
],
"env": {
"LITELLM_URL": "http://localhost:4000",
"LITELLM_MASTER_KEY": "sk-..."
}
}
}
}
Tool Names
Tool names are generated from LiteLLM OpenAPI operationId values and are limited to 64 characters. A numeric suffix is added within that limit when shortening produces a duplicate name.
Examples from LiteLLM v1.84.8:
| LiteLLM Endpoint | MCP Tool | |------------------|----------| | GET /health/readiness | health_readiness_health_readiness_get | | GET /key/list | list_keys_key_list_get | | GET /key/info | info_key_fn_key_info_get | | GET /spend/logs/v2 | ui_view_spend_logs_spend_logs_v2_get | | POST /chat/completions | chat_completion_chat_completions_post |
Two helper tools are always registered:
list_litellm_openapi_tools: Search/list dynamically registered endpoint tools.get_litellm_openapi_tool: Show the HTTP method, path, and parameter mapping
for one endpoint tool.
Project Structure
src/litellm_mcp/
├── configs/ # Environment configuration
├── connections/ # LiteLLM HTTP client singleton
├── tools/ # OpenAPI-driven FastMCP tool registration
└── main.py # Entry point and tool registration
Security Notes
LITELLM_MASTER_KEY can read and mutate sensitive LiteLLM state. Because this server exposes every LiteLLM endpoint in the running proxy, including mutating admin endpoints, prefer running it locally or in a trusted network.
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: wklee610
- Source: wklee610/litellm-mcp
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.