AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Litellm Mcp

mcp-wklee610-litellm-mcp · by wklee610

MCP server for LiteLLM

No reviews yet
0 installs
39 views
0.0% view→install

Install

$ agentstack add mcp-wklee610-litellm-mcp

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No 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.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-wklee610-litellm-mcp)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

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 →
Are you the author of Litellm Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

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 operationId values, 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+
  • uv package 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 example http://localhost:4000.
  • LITELLM_MASTER_KEY: LiteLLM master key or admin key.
  • LITELLM_TIMEOUT_SECONDS: Optional request timeout in seconds. Defaults to 30.
  • MCP_TRANSPORT: MCP transport, either stdio (default) or http.
  • MCP_HOST: HTTP bind address. Defaults to 0.0.0.0.
  • MCP_PORT: HTTP bind port. Defaults to 8000.

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.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.