Repository navigation
feat(mcp): per-server env vars with global + per-user scopes #28917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mateo-berri
merged 81 commits into
litellm_internal_staging
from
litellm_mcp_server_env_vars
Jun 6, 2026
Merged
Changes from 17 commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
e58a561
Merge pull request #27906 from BerriAI/litellm_internal_staging
shin-berri a72414a
Merge pull request #28100 from BerriAI/litellm_internal_staging
yuneng-berri 79b4578
Merge pull request #28292 from BerriAI/litellm_internal_staging
yuneng-berri 48a6334
feat(mcp): per-server env vars with global + per-user scopes
claude accecaf
test(mcp): add DB layer + load-user-env-vars coverage
claude 35f6961
Merge pull request #28680 from BerriAI/litellm_internal_staging
yuneng-berri 06f6cfc
Merge pull request #28709 from BerriAI/litellm_internal_staging
yuneng-berri 28883ea
feat(mcp/ui): match env-vars UI to card-grid design from #28399
claude 855cf82
test(mcp): cover per-user env-var management endpoints
claude 719d562
fix(mcp): don't block tool listing on missing per-user env vars
claude 1db27bd
Merge remote-tracking branch 'origin/patch/v1.87.0-rc.1' into litellm…
mateo-berri d042da1
style(mcp/ui): give env-vars section its production look
mateo-berri 5ae6c82
fix(mcp): friendlier missing-per-user-env-vars error message
mateo-berri 8fca9d7
chore: rename htmls
mateo-berri af63258
Merge branch 'litellm_internal_staging' into litellm_mcp_server_env_vars
mateo-berri 48e8f40
fix(mcp): load DB-stored servers whose env_vars hydrate as MCPEnvVar …
cursoragent ef341b8
fix(mcp/ui): scope create-server e2e assertion to the new card grid
mateo-berri 7d11dd7
style(mcp): black-format the env-vars deserialization regression test
cursoragent d781b62
fix(mcp): surface DB errors on tool-call path and redact global env v…
mateo-berri 9764f54
fix(mcp): gate per-user env-var endpoints by server access
mateo-berri b38320d
fix(mcp): propagate delete DB errors; drop redundant import and dupli…
mateo-berri 26f15b4
fix(mcp): stop echoing credential values in bulk env-var status and l…
mateo-berri dbc5193
style(mcp/ui): hoist MCPUserEnvVarsStatus import to top of networking…
mateo-berri 3392cd0
fix(mcp): URL-encode server_id in env-var setup deep link
mateo-berri e030c24
Merge branch 'litellm_internal_staging' into litellm_mcp_server_env_vars
mateo-berri 236407a
fix(mcp): wrap get_mcp_server result in LiteLLM_MCPServerTable
mateo-berri 102b73a
fix(mcp): redact global env var secrets from read-only admin server v…
mateo-berri 1f1bf4c
fix(mcp): surface env-var fetch errors and authorize before existence…
mateo-berri e9eeca1
fix(mcp): make per-user env var status write-only
mateo-berri 0dcf316
fix(mcp/ui): clear value for user-scope env vars before submit
mateo-berri ba20078
fix(mcp): keep a created MCP server when post-write registry refresh …
mateo-berri 8852c0d
fix(mcp): preserve env_vars in registry to table conversion
mateo-berri ba7cab2
fix(mcp/ui): clarify per-user env var field as a hint, not a value
mateo-berri e33ec2e
fix(mcp/ui): rename env vars section to Variables
mateo-berri 8581460
fix(mcp): redact global env var secrets from read-only admin submissi…
mateo-berri cc6e6de
fix(mcp): convert registry env_vars to MCPEnvVar when building server…
mateo-berri 61962af
fix(mcp): scope per-user env var overrides to currently user-scoped vars
mateo-berri 3b1a90e
fix(mcp): encrypt global env var secrets at rest
mateo-berri 21c7c38
fix(mcp): extract env var resolution to satisfy ruff PLR0915
mateo-berri 4b31a6d
perf(mcp): cache per-user env var values off the hot tool-call path
mateo-berri ca1e837
fix(mcp): delete per-user env vars with their server and document POS…
mateo-berri c9cc963
refactor(mcp/ui): share normalizeEnvVars helper between create and ed…
mateo-berri 018df7f
perf(mcp): evict oldest per-user env var cache entry instead of clear…
mateo-berri 3527827
fix(mcp): interpolate global env vars before upstream health probes
mateo-berri 30b0502
fix(mcp): re-check DB before raising missing-env-var 412 and correct …
mateo-berri f08bc13
perf(mcp): index server_id on LiteLLM_MCPUserEnvVars for orphan cleanup
mateo-berri de72a84
fix(mcp): drop undecryptable global env vars and merge per-user env v…
mateo-berri 19a3cfa
fix(mcp): log best-effort user env var load failures at warning
mateo-berri ad07d14
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 4576c48
fix(mcp): don't re-decrypt already-decrypted global env vars in regis…
mateo-berri 77ddd83
fix(mcp): serialize env_vars from data_dict and document reload decry…
mateo-berri 43394c1
fix(mcp): rotate new encrypted env var columns on master-key rotation
mateo-berri 86cf341
fix(mcp): redact global env var secrets from management telemetry
mateo-berri 4cbf8ca
fix(mcp): drop env vars entirely for virtual keys and reuse access lo…
mateo-berri fe20b4b
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 63a9f00
chore(ui): satisfy frontend-lint gate on touched MCP files
mateo-berri 3ac1c00
fix(mcp): surface DB-unavailable as a real error on per-user env var …
mateo-berri 67e81f7
fix(ui): move MCP env-var loading to React Query to drop lint suppres…
mateo-berri 2e94852
fix(mcp): make per-user env var cleanup best-effort on server delete
mateo-berri 3f62063
fix(mcp): skip health check for servers with per-user env-var headers
mateo-berri 2fb11f1
test(core-utils): skip token_counter custom-tokenizer assertion when …
mateo-berri 2da1e5e
fix(mcp): use global fallback before raising missing per-user env var…
mateo-berri 178af17
fix(mcp): drop env vars entirely for non-admin server views
mateo-berri 47fa6ff
Merge branch 'litellm_internal_staging' into litellm_mcp_server_env_vars
mateo-berri 113f6d8
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri ae026d2
fix(mcp): serialize per-user env var merge to avoid lost concurrent u…
mateo-berri 16f1d3e
fix(mcp): warn on undecryptable per-user env vars and align status wi…
mateo-berri 3f61004
fix(mcp): compute per-user env var lock key without hashtextextended
mateo-berri 16bc527
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 82e69ed
mcp: decrypt env_vars on Prisma create/update rows that return JSON s…
cursoragent eaab1c5
fix(mcp): redact nested env_vars in submissions telemetry response
mateo-berri 298a3ca
refactor(mcp): drop unused store_user_env_vars helper
mateo-berri 201f40f
Merge branch 'litellm_internal_staging' into litellm_mcp_server_env_vars
mateo-berri faca397
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 4d7f160
chore(mcp): log master-key rotation summary counts
mateo-berri 4929f50
refactor(ui): route MCP env-var calls through shared http client
mateo-berri 5177f8f
fix(mcp): acquire user env-var advisory lock via execute_raw
mateo-berri aa78a90
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 0234405
fix(mcp): treat empty-valued global env var as unset in header resolu…
mateo-berri 587829c
fix(mcp): trim static header whitespace and surface real connection e…
mateo-berri 7570cc6
fix(mcp): treat empty global as unset in user env-var status too
mateo-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...roxy-extras/litellm_proxy_extras/migrations/20260520120000_add_mcp_env_vars/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| -- AlterTable: add admin-configured env_vars to MCP server table | ||
| ALTER TABLE "LiteLLM_MCPServerTable" ADD COLUMN IF NOT EXISTS "env_vars" JSONB DEFAULT '[]'; | ||
|
|
||
| -- CreateTable: per-user env var values for MCP servers | ||
| CREATE TABLE IF NOT EXISTS "LiteLLM_MCPUserEnvVars" ( | ||
| "id" TEXT NOT NULL, | ||
| "user_id" TEXT NOT NULL, | ||
| "server_id" TEXT NOT NULL, | ||
| "values_b64" TEXT NOT NULL, | ||
| "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
|
||
| CONSTRAINT "LiteLLM_MCPUserEnvVars_pkey" PRIMARY KEY ("id") | ||
| ); | ||
|
|
||
| -- CreateIndex | ||
| CREATE UNIQUE INDEX IF NOT EXISTS "LiteLLM_MCPUserEnvVars_user_id_server_id_key" ON "LiteLLM_MCPUserEnvVars"("user_id", "server_id"); | ||
|
|
||
| -- CreateIndex | ||
| CREATE INDEX IF NOT EXISTS "LiteLLM_MCPUserEnvVars_user_id_idx" ON "LiteLLM_MCPUserEnvVars"("user_id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.