-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Feat] MCP - Allow connecting to MCP with authentication headers + Allow clients to specify MCP headers (#11890) #11891
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
Conversation
Co-authored-by: wagnerjt <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
) | ||
return tool_result | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you want to update the docs to leverage this client somewhere around the line 500 mark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you elaborate, wdym ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples
litellm/docs/my-website/docs/mcp.md
Line 484 in 677ef3c
from litellm import experimental_mcp_client |
MCP - Allow connecting to MCP with authentication headers + Allow clients to specify MCP headers
Adds the following:
x-mcp-auth
as a header to authenticate to the MCP ServerUsing your MCP with client side credentials
Use this if you want to pass a client side authentication token to LiteLLM to then pass to your MCP to auth to your MCP.
You can specify your MCP auth token using the header
x-mcp-auth
. LiteLLM will forward this token to your MCP server for authentication.Connect via OpenAI Responses API with MCP Auth
Use the OpenAI Responses API and include the
x-mcp-auth
header for your MCP server authentication:Connect via LiteLLM Proxy Responses API with MCP Auth
Use this when calling LiteLLM Proxy for LLM API requests to
/v1/responses
endpoint with MCP authentication:Connect via Cursor IDE with MCP Auth
Use tools directly from Cursor IDE with LiteLLM MCP and include your MCP authentication token:
Setup Instructions:
⇧+⌘+J
(Mac) orCtrl+Shift+J
(Windows/Linux)Cmd+S
orCtrl+S
Connect via Streamable HTTP Transport with MCP Auth
Connect to LiteLLM MCP using HTTP transport with MCP authentication:
Server URL:
Headers:
This URL can be used with any MCP client that supports HTTP transport. The
x-mcp-auth
header will be forwarded to your MCP server for authentication.Connect via Python FastMCP Client with MCP Auth
Use the Python FastMCP client to connect to your LiteLLM MCP server with MCP authentication:
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature
✅ Test
Changes