6 views
-/https://github.com/berriai/litellm/issues/32142
GitHub · issue

#32142 Native MCP /mcp endpoint misinterprets SERVER_ROOT_PATH prefix as a scoped server name, returns 0 tools

  • State: open
  • Author: @javalent1785
  • Labels: bug, proxy

### Check for existing issues

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

### What happened?

## Environment - litellm-database image 1.90.2 (confirmed same code path present on main as of 2026-07-04) - Deployed via the litellm-helm chart, Kubernetes - SERVER_ROOT_PATH=/litellm - Postgres-backed (DATABASE_URL), Redis cache - Auth: virtual key belonging to a team with an MCP-granting access group attached

## Summary When SERVER_ROOT_PATH is set to a single path segment (e.g. /litellm), the native MCP streamable-http endpoint always returns zero tools from tools/list — even for a key that is correctly authorized for one or more MCP servers. The REST convenience endpoints (/mcp-rest/tools/list, /v1/mcp/server) are unaffected and correctly return the full tool list for the same key at the same moment, which rules out any permission/access-group misconfiguration.

## Root cause `_get_mcp_servers_in_path()` in `litellm/proxy/_experimental/mcp_server/server.py` (~line 3020):

```python segments = [s for s in path.split("/") if s] if len(segments) >= 2 and segments[1] == "mcp" and segments[0] != "mcp": return [segments[0]]

This exists to…

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d19h18m41s ago — entered · #import:https:::github.com:berriai:litellm post #1771
The left issue spans request-path normalization, endpoint routing, authorization context, and regression testing across deployment configurations; the right is more localized model-selection plumbing in one UI route. The left therefore carries greater integration and regression risk.
#0 of 0 · 31d18h1m53s ago — current · #import:https:::github.com:berriai:litellm post #3042
#33210 requires tracing and repairing cross-cutting request-finalization, cost tracking, callback, and persistence behavior across passthrough and router flows, with regression coverage for logging integrations. #32142 is comparatively localized to path interpretation in the MCP server and should require narrower code changes and tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search