mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
Adds admin-configurable environment variables on MCP servers, interpolated
into static_headers (and any other ${NAME} reference) at request time.
- Global vars: value supplied by admin, used for every user.
- Per-user vars: each user fills in their own value via the MCP Gateway
dashboard. The proxy returns a friendly 412 with a setup URL when a
user invokes a server before filling in their required values.
Backend
- New ``LiteLLM_MCPServerTable.env_vars`` JSON column and per-user
``LiteLLM_MCPUserEnvVars`` table (encrypted values).
- Interpolation helpers in ``_experimental.mcp_server.utils``
(parse_admin_env_vars, interpolate_headers, MCPMissingUserEnvVarsError,
build_env_var_setup_url).
- ``MCPServerManager._resolve_static_headers_with_env_vars`` merges
globals + per-user values and raises when a required user var is
unset. Wired into both the call_tool and list_tools paths.
- REST endpoints under ``/v1/mcp``:
- GET/POST/DELETE ``/server/{id}/user-env-vars``
- GET ``/user-env-vars/status`` (dashboard summary)
- MCP-protocol call_tool and REST /tools/call surface the missing-vars
error as a user-facing message with the setup URL.
UI
- ``EnvVarsSection`` form component in the Add / Edit MCP Server modal:
three columns (name, value, scope). Scope is a Global / Per-user
select.
- User-facing ``UserEnvVarsModal`` for filling in per-user values.
- Dashboard server list highlights servers with missing per-user vars
in red with a clickable missing-count chip that opens the modal.
- Deep-link ``?fill_env_vars=<server_id>`` auto-opens the modal so the
link in the proxy's friendly error lands the user in the right place.
|
||
|---|---|---|
| .. | ||
| dist | ||
| litellm_proxy_extras | ||
| tests | ||
| build_and_publish.md | ||
| LICENSE | ||
| migration_runbook.md | ||
| pyproject.toml | ||
| README.md | ||
Additional files for the proxy. Reduces the size of the main litellm package.
Currently, only stores the migration.sql files for litellm-proxy.
To install, run:
uv add litellm-proxy-extras
OR
uv tool install 'litellm[proxy]' # installs litellm-proxy-extras and other proxy dependencies
To use the migrations, run:
litellm --use_prisma_migrate