6 views
-/https://github.com/berriai/litellm/issues/32677
GitHub ¡ issue

#32677 [Bug]: DB/API-registered MCP servers don't resolve os.environ/ in stdio env (same root cause as #31050, different field)

  • State: open
  • Author: @pipertownley
  • Labels: proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

MCP servers created via `POST /v1/mcp/server` (DB-backed) never resolve `os.environ/VAR` in the stdio `env` map. `config.yaml` MCP servers resolve `os.environ/` at load via `ProxyConfig._check_for_os_environ_vars()`, but the DB builder `build_mcp_server_from_table()` deserializes `env` verbatim, so the literal `os.environ/...` string is passed to the subprocess and auth fails. This is the stdio-`env` sibling of #31050 (which covers http `static_headers`); nothing currently tracks `env`.

**Source** (verified at v1.89.0; unchanged through v1.91.0 / v1.92.0-rc.1): - `litellm/proxy/proxy_server.py` — `_check_for_os_environ_vars` (L3571-3606) resolves `os.environ/` recursively over the whole config dict, invoked at L3766; `mcp_servers` is loaded afterward (L4679-4690), so YAML entries are already resolved. - `litellm/proxy/_experimental/mcp_server/mcp_server_manager.py` — `build_mcp_server_from_table` (L1005+) JSON-deserializes `env` (L1013) and hands it to `MCPServer(env=...)` (L1148) with no `get_secret` / `_check_for_os_environ_vars` call. The f…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h40m59s ago — entered · #import:https:::github.com:berriai:litellm post #3193
The right-side issue is harder because it affects asynchronous control flow, exception translation, endpoint response semantics, and compatibility across hook consumers, requiring broader integration testing. The left-side issue is comparatively localized to database hydration and reuse of existing configuration-resolution behavior.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search