litellm-admin-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@litellm-admin-mcpcould you list all internal users?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
litellm-admin-mcp
LiteLLM Admin MCP server for OpenClaw. Exposes LiteLLM Proxy admin APIs (internal users, virtual keys, spend logs) as MCP tools over streamable-http, so agents can manage LiteLLM without custom HTTP glue.
将 LiteLLM Proxy 的管理能力封装为 MCP Server,供 OpenClaw Agent 通过
streamable-http调用。
Overview
Item | Detail |
Transport | MCP Streamable HTTP at |
Backend | LiteLLM Proxy REST API ( |
Auth |
|
Tools | 18 admin tools ( |
Health |
|
OpenClaw Agent ──streamable-http + Bearer sk-*──► litellm-admin-mcp :3100/mcp
│
▼ Authorization pass-through
LiteLLM ProxyRelated MCP server: MetaMCP Admin MCP
Prerequisites
Node.js 20+ (
engines.nodeinpackage.json)A running LiteLLM Proxy with a valid admin key (
sk-*)For OpenClaw integration: OpenClaw CLI with MCP support
Install & Run
# Install dependencies
npm install
# Development (hot reload)
npm run dev
# Production build
npm run build
npm startDefault listen address: http://0.0.0.0:3100
Health:
http://localhost:3100/healthMCP:
http://localhost:3100/mcp
Docker Deployment
Quick start (docker compose)
docker compose up -d --build
docker compose logs -f litellm-admin-mcp
curl -s http://localhost:3100/healthOptional .env beside docker-compose.yml:
LITELLM_BASE_URL=http://192.168.91.200:8888
LITELLM_V1_BASE_URL=http://192.168.91.200:8888/v1
PORT=3100Network note: The container must reach LiteLLM at
LITELLM_BASE_URL. From inside Docker,127.0.0.1points to the container itself — use the host LAN IP orhost.docker.internal(Docker Desktop).
Build and run manually
docker build -t litellm-admin-mcp:latest .
docker run -d \
--name litellm-admin-mcp \
-p 3100:3100 \
-e LITELLM_BASE_URL=http://192.168.91.200:8888 \
--restart unless-stopped \
litellm-admin-mcp:latestStop: docker compose down or docker stop litellm-admin-mcp && docker rm litellm-admin-mcp
Environment Variables
Copy .env.example and adjust as needed:
cp .env.example .envVariable | Required | Default | Description |
| No |
| LiteLLM Proxy base URL (no trailing slash) |
| No |
| OpenAI-compatible base URL used in |
| No |
| HTTP port for this MCP server |
| No |
| Bind address |
Example:
export LITELLM_BASE_URL=http://your-litellm-host:8888
export PORT=3100
export HOST=0.0.0.0
npm run devAdmin key is not an environment variable. Configure it in the MCP client (e.g. OpenClaw headers), not in this server's env.
Authentication
Every request to /mcp must include:
Authorization: Bearer sk-<your-litellm-admin-key>Behavior:
Missing or invalid header (must start with
Bearer sk-) → 401 from this server; LiteLLM is not called.Valid header → forwarded unchanged to LiteLLM API calls made by tool handlers.
OpenClaw (or any MCP client) supplies the key per session. Rotate keys in the client config without redeploying this server.
OpenClaw Configuration
推荐用 双 Agent 隔离管理员与员工自助场景;权限由 LiteLLM RBAC + OpenClaw tool 白名单共同约束,MCP 本身不重复实现鉴权层。
Recommended architecture: dual agents
Agent |
| Use case |
|
| Ops: users, keys, models, global usage reports |
| Employee self-serve key or scoped admin key | Feishu bot DM: request API key, check own usage |
Feishu Bot (litellm-self) Admin Agent (litellm-admin)
│ │
└──────── streamable-http ───────────┘
│
litellm-admin-mcp :3100/mcp
│
▼ Authorization pass-through
LiteLLM ProxyMCP server connection
Add to OpenClaw MCP config (e.g. ~/.openclaw/openclaw.json or project-level MCP settings):
{
"mcp": {
"servers": {
"litellm-admin": {
"url": "http://192.168.91.200:3100/mcp",
"transport": "streamable-http",
"headers": {
"Authorization": "Bearer sk-your-admin-key"
}
},
"litellm-self": {
"url": "http://192.168.91.200:3100/mcp",
"transport": "streamable-http",
"headers": {
"Authorization": "Bearer sk-your-self-serve-key"
}
}
}
}
}Replace:
url— host/port wherelitellm-admin-mcpruns (path must be/mcp)litellm-admin→ LiteLLM proxy admin key (sk-*)litellm-self→ a scoped key (self-serve or limited admin); do not reuse the root admin key for employee-facing bots
Network notes:
OpenClaw and MCP on the same host:
http://127.0.0.1:3100/mcpMCP in Docker, OpenClaw on host: use the host LAN IP, not container
127.0.0.1OpenClaw must reach both this MCP server and LiteLLM is not required — only MCP needs
LITELLM_BASE_URL
Tool allowlists
Restrict tools per agent so employee bots cannot invoke destructive admin operations.
Employee self-serve (litellm-self, e.g. Feishu bot):
litellm_key_generate
litellm_key_list
litellm_key_info
litellm_user_info
litellm_model_list
litellm_model_info
litellm_usage_spend_logs
litellm_usage_user_activityAdministrator (litellm-admin): all 18 tools (see MCP Tools below).
Configure and verify:
openclaw mcp configure litellm-self \
--include litellm_key_generate,litellm_key_list,litellm_key_info,litellm_user_info,litellm_model_list,litellm_model_info,litellm_usage_spend_logs,litellm_usage_user_activity
openclaw mcp doctor litellm-admin --probe
openclaw mcp doctor litellm-self --probe
openclaw mcp tools litellm-admin # expect 18
openclaw mcp tools litellm-self # expect 8 (after allowlist)Feishu bot agent prompt (template)
Attach this system prompt to the litellm-self agent bound to your Feishu channel:
你是公司内网 LLM 服务助手。员工通过私聊可申请 API Key、查询可用模型和 token 用量。
## 申请 API Key
1. 确认员工身份(飞书 user_id / 工号);必要时用 litellm_user_info 核对是否已有账号
2. 调用 litellm_key_generate,建议 key_alias 设为唯一标识(如 feishu:<user_id>)
3. 将返回的 onboarding.message_zh 完整发给用户,必须包含 virtual_key
4. 明确告知:API Key 仅显示一次,请勿外传,仅在内网使用
## 查模型
- litellm_model_list / litellm_model_info
## 查用量
- litellm_usage_spend_logs(按 user_id 或时间范围)
- litellm_user_info(预算、累计 spend)
## 查已有 Key
- litellm_key_list / litellm_key_info(用 key_alias)
- 注意:LiteLLM 的 key_list / key_info 不会返回完整 virtual_key,只能查元数据
## 禁止
不要创建/删除用户、删模型、全局报表等管理员操作;引导用户联系 IT/管理员。Responsibilities: MCP vs OpenClaw
Responsibility | MCP (this server) | OpenClaw |
LiteLLM API wrappers | 18 tools | Select tools per agent |
Chinese tool descriptions / keywords | Yes | — |
Onboarding template ( |
| Forward to employee |
Feishu | — | Your agent logic |
Multi-turn chat, intent routing | — | Yes |
Admin vs employee isolation | Pass-through | Separate agents + allowlists |
User mapping suggestion: map feishu:ou_xxx to a LiteLLM user_id on first request (litellm_user_create + litellm_key_generate), or rely on key_alias=feishu:ou_xxx if your Proxy config allows it.
Key behavior reminders
virtual_keyis returned only once atlitellm_key_generate— sendonboarding.message_zhto the user immediately; afterwards uselookup_tokenorkey_aliasfor management.key_list/key_infonever return the full key — LiteLLM limitation, not an MCP bug.Set
LITELLM_V1_BASE_URLon the MCP server if employees reach LiteLLM through a reverse proxy (no:8888in the public URL); otherwise onboardingcurlexamples will point at the wrong host.
OpenClaw rollout checklist
# 1. MCP health (no auth)
curl -s http://192.168.91.200:3100/health
# 2. OpenClaw connectivity
openclaw mcp doctor litellm-admin --probe
openclaw mcp doctor litellm-self --probe
# 3. Tool counts
openclaw mcp tools litellm-admin
openclaw mcp tools litellm-selfMCP Tools (18)
Users (5)
Tool | Description |
| List internal users (pagination, filters) |
| Create internal user with role/budget/models |
| Update user role, budget, models |
| Delete internal users |
| User details, keys, spend (self or admin) |
Keys (5)
Tool | Description |
| List virtual keys ( |
| Create virtual key; returns |
| Update models, budget, rate limits |
| Revoke virtual keys |
| Key details and spend; supports |
Models (5)
Tool | Description |
| List configured proxy models |
| Single model config details |
| Add model route (admin) |
| Update model params (admin) |
| Remove model config (admin) |
Usage (3)
Tool | Description |
| Per-request token/spend logs |
| Platform-wide spend summary (admin) |
| Daily user activity trends |
Tool responses use a unified envelope:
{ "success": true, "data": {} }{ "success": false, "error": { "status": 400, "message": "...", "detail": {} } }Verification
Health check (no auth)
curl -s http://localhost:3100/health
# {"status":"ok"}OpenClaw MCP probe
With the server running and OpenClaw configured:
openclaw mcp doctor --probeConfirm litellm-admin (or your server alias) reports a healthy streamable-http connection and lists all 18 tools.
Testing
# Unit tests (default, no live LiteLLM)
npm test
# Optional integration tests against a real LiteLLM instance
RUN_INTEGRATION=1 npm test
# With custom LiteLLM URL / admin key for integration
LITELLM_BASE_URL=http://your-host:8888 LITELLM_ADMIN_KEY=sk-your-key RUN_INTEGRATION=1 npm testIntegration tests are read-only (user/list, key/list). They are skipped unless RUN_INTEGRATION=1.
Security
Treat the LiteLLM admin key (sk-*) as a root credential.
It can create/delete users and keys, change budgets, and read spend data.
Store it only in trusted MCP client config (OpenClaw headers), secret managers, or CI secrets — never commit it to git.
This server does not add a second auth layer; anyone who can reach
/mcpwith a valid admin key can perform admin actions on your LiteLLM Proxy.Bind to
127.0.0.1or place the service behind a private network / reverse proxy with TLS if exposed beyond localhost.Do not log full
sk-*values.key_generatemay return a new plaintext key once (LiteLLM behavior); handle that response carefully.
Project Layout
Dockerfile # Multi-stage production image
docker-compose.yml # One-command deployment
src/
server.ts # Hono app, /health, /mcp transport
litellm-client.ts # LiteLLM HTTP client with auth pass-through
tools/
users.ts # 5 user tools
keys.ts # 5 key tools (+ onboarding on generate)
models.ts # 5 model tools
usage.ts # 3 usage tools
index.ts # MCP server registration
utils/
response.ts # ok() / fail() helpers
onboarding.ts # virtual key quickstart / message_zh
tests/ # Vitest unit + optional integration testsLicense
See repository license file if present.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/junwayne66/litellm-admin-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server