litellm/ui
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
..
litellm-dashboard feat(mcp): per-server env vars with global + per-user scopes 2026-05-20 21:43:30 +00:00
Dockerfile feat: add componentized proxy deployment with gateway, backend, ui, and migrations (#27557) 2026-05-16 09:25:17 -07:00
nginx.conf feat: add componentized proxy deployment with gateway, backend, ui, and migrations (#27557) 2026-05-16 09:25:17 -07:00