[Chore] update mcp documentation for header forwarding#22750
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR updates MCP documentation and the dashboard UI to standardize on
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| docs/my-website/docs/mcp_control.md | Updated server_url to "litellm_proxy" in LiteLLM Proxy tabs, but the change under "URL-based Namespacing" removes the very URL namespacing being demonstrated, and adds an inaccurate description referencing a header not present in the code. |
| docs/my-website/docs/mcp.md | Adds new documentation section for calling the proxy's /v1/responses endpoint and sending custom headers to MCP servers. Content is clear and correctly demonstrates the litellm_proxy pattern and x-mcp-{server}-{header} header format. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_connect.tsx | Changed LiteLLM Proxy tab server_url from dynamic "${proxyBaseUrl}/mcp" to static "litellm_proxy". This is correct for the Responses API flow where the proxy intercepts the value internally. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Client sends request to<br>/v1/responses endpoint] --> B{server_url value?}
B -->|"litellm_proxy"| C[LiteLLM Proxy intercepts<br>and routes internally]
B -->|"full URL e.g. proxy.com/mcp"| D[Direct MCP connection<br>bypasses proxy routing]
C --> E{Custom headers?}
E -->|"x-mcp-{alias}-{header}"<br>in request headers| F[Proxy forwards header<br>to matching MCP server]
E -->|"headers" in tool config| G[Headers merged and<br>forwarded to MCP server]
E -->|None| H[Default routing<br>to all allowed servers]
F --> I[MCP Server]
G --> I
H --> I
Last reviewed commit: 36999b2
| @@ -335,7 +335,7 @@ curl --location '<your-litellm-proxy-base-url>/v1/responses' \ | |||
| }' | |||
| ``` | |||
|
|
|||
| This example uses URL namespacing to access all servers in the "dev_group" access group. | |||
| This example uses the `x-mcp-servers` header to access all servers in the "dev_group" access group. Use `server_url: "litellm_proxy"` when calling the proxy's `/v1/responses` endpoint—do not use the full proxy URL. | |||
There was a problem hiding this comment.
URL namespacing example no longer demonstrates URL namespacing
This code example is in the "Method 1: URL-based Namespacing" section, but server_url was changed from "<your-litellm-proxy-base-url>/dev_group/mcp" (which demonstrated URL namespacing) to "litellm_proxy" (which is the generic proxy shorthand). The example no longer illustrates URL-based namespacing at all.
Additionally, the description on line 338 says "This example uses the x-mcp-servers header to access all servers in the 'dev_group' access group" — but the code snippet does not include the x-mcp-servers header anywhere. The description doesn't match the code.
Consider either:
- Keeping the original URL namespacing example (
server_url: "<your-litellm-proxy-base-url>/dev_group/mcp") since this section is specifically about URL-based namespacing, or - If
litellm_proxyis intended here, add thex-mcp-servers: "dev_group"header to theheadersobject in the code example so the description is accurate.
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/test_litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes