litellm/litellm-proxy-extras
Claude 48a63341c8
feat(mcp): per-server env vars with global + per-user scopes
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.
2026-05-20 21:43:30 +00:00
..
dist adding build 2026-03-21 22:55:04 -07:00
litellm_proxy_extras feat(mcp): per-server env vars with global + per-user scopes 2026-05-20 21:43:30 +00:00
tests [Fix] v2 resolver: swallow non-connection DB errors; wrap resolve failures 2026-04-21 15:53:07 -07:00
build_and_publish.md build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
LICENSE install prisma migration files - connects litellm proxy to litellm's prisma migration files (#9637) 2025-03-29 15:27:09 -07:00
migration_runbook.md [Infra] Add freshness and destructive guards to migration workflow 2026-04-21 12:00:23 -07:00
pyproject.toml chore(ci): bump versions (#28287) 2026-05-19 15:10:37 -07:00
README.md build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00

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