litellm/litellm-proxy-extras
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
..
dist adding build 2026-03-21 22:55:04 -07:00
litellm_proxy_extras feat(mcp): add admin-declared per-user fields for MCP servers 2026-05-19 02:48:57 +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 bump: version 0.4.71 → 0.4.72 2026-05-13 21:51:11 -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