You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Most tools are safe, but you want to block a few dangerous ones
251
+
- You want to prevent expensive API calls
252
+
- You're gradually adding restrictions to an existing server
253
+
254
+
</TabItem>
255
+
</Tabs>
256
+
257
+
### Important Notes
258
+
259
+
- If you specify both `allowed_tools` and `disallowed_tools`, the allowed list takes priority
260
+
- Tool names are case-sensitive
194
261
195
262
## Using your MCP
196
263
@@ -771,22 +838,212 @@ When creating API keys, you can assign them to specific access groups for permis
771
838
/>
772
839
773
840
774
-
## Using your MCP with client side credentials
841
+
## Forwarding Custom Headers to MCP Servers
775
842
776
-
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.
843
+
LiteLLM supports forwarding additional custom headers from MCP clients to backend MCP servers using the `extra_headers` configuration parameter. This allows you to pass custom authentication tokens, API keys, or other headers that your MCP server requires.
777
844
845
+
### Configuration
778
846
779
-
### New Server-Specific Auth Headers (Recommended)
780
847
781
-
You can specify MCP auth tokens using server-specific headers in the format `x-mcp-{server_alias}-{header_name}`. This allows you to use different authentication for different MCP servers.
848
+
<Tabs>
849
+
<TabItem value="config" label="config.yaml">
850
+
Configure `extra_headers` in your MCP server configuration to specify which header names should be forwarded:
851
+
852
+
```yaml title="config.yaml with extra_headers" showLineNumbers
1. **Configuration**: Define `extra_headers` in your MCP server config with the header names you want to forward
1019
+
2. **Client Headers**: Include the corresponding headers in your MCP client requests
1020
+
3. **Header Forwarding**: LiteLLM automatically forwards matching headers to the backend MCP server
1021
+
4. **Authentication**: The backend MCP server receives both the configured auth headers and the custom headers
1022
+
1023
+
### Use Cases
1024
+
1025
+
- **Custom Authentication**: Forward custom API keys or tokens required by specific MCP servers
1026
+
- **Request Context**: Pass user identification, session data, or request tracking headers
1027
+
- **Third-party Integration**: Include headers required by external services that your MCP server integrates with
1028
+
- **Multi-tenant Systems**: Forward tenant-specific headers for proper request routing
1029
+
1030
+
### Security Considerations
1031
+
1032
+
- Only headers listed in `extra_headers` are forwarded to maintain security
1033
+
- Sensitive headers should be passed through environment variables when possible
1034
+
- Consider using server-specific auth headers for better security isolation
1035
+
1036
+
---
1037
+
1038
+
## Using your MCP with client side credentials
1039
+
1040
+
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.
1041
+
1042
+
1043
+
### New Server-Specific Auth Headers (Recommended)
1044
+
1045
+
You can specify MCP auth tokens using server-specific headers in the format `x-mcp-{server_alias}-{header_name}`. This allows you to use different authentication for different MCP servers.
1046
+
790
1047
**Benefits:**
791
1048
- **Server-specific authentication**: Each MCP server can use different auth methods
792
1049
- **Better security**: No need to share the same auth token across all servers
0 commit comments