litellm/ui
Claude e30e463927
feat(mcp): add admin-declared per-user fields for MCP servers
Generalizes the existing BYOK pattern (one user-provided credential per
server) to N admin-declared fields. Each field can target an HTTP header
(http/sse transports) or env var (stdio), with an optional value template
for prefixes like "Bearer {value}". Field values are encrypted at rest,
stored in the existing LiteLLM_MCPUserCredentials table with a
"type": "user_fields" discriminator so they don't collide with BYOK
strings or OAuth2 blobs.

Demo flow:
  1. Admin adds a server with one or more user fields.
  2. The user dashboard shows a red "N missing fields" badge until each
     required field has a value.
  3. Calling the server via Claude Code (or any MCP client) before saving
     returns HTTP 401 with error="user_fields_missing", the list of
     missing field descriptors, and a config_url pointing at the
     dashboard.
  4. After the user saves their values, the badge clears and tool calls
     dispatch with the user's values injected as the configured headers
     or env vars.

Backend
- New JSONB column LiteLLM_MCPServerTable.user_fields with a migration.
- MCPUserField / MCPUserFieldValuesRequest / MCPUserFieldsStatus types
  on the existing create/update/read models.
- DB helpers store/get/delete user-field values via the same encryption
  path as BYOK; a "type" discriminator keeps the three formats apart.
- New endpoints GET/POST/DELETE /v1/mcp/server/{id}/user-field-values
  and GET /v1/mcp/user-field-values (aggregated for dashboard badges).
- GET /v1/mcp/server is annotated per-caller with missing_user_field_keys.
- execute_mcp_tool enforces required fields with a friendly 401 carrying
  the dashboard config_url; the managed MCP dispatch path injects the
  resolved headers and stdio env vars.

UI
- Admin "Add MCP Server" form gains a dynamic User Fields section.
- Dashboard servers list shows a red badge with the missing-field count
  for each affected server and opens a new UserFieldsModal where the
  end-user fills in their values.
2026-05-19 02:48:57 +00:00
..
litellm-dashboard feat(mcp): add admin-declared per-user fields for MCP servers 2026-05-19 02:48:57 +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