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
Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming:
121
+
122
+
**Server URL:**
123
+
```text showLineNumbers
124
+
<your-litellm-proxy-base-url>/mcp
125
+
```
126
+
127
+
**Headers:**
128
+
```text showLineNumbers
129
+
x-litellm-api-key: YOUR_LITELLM_API_KEY
130
+
```
131
+
132
+
This URL can be used with any MCP client that supports HTTP transport. Refer to your client documentation to determine the appropriate transport method.
133
+
134
+
</TabItem>
135
+
136
+
<TabItemvalue="fastmcp"label="Python FastMCP">
137
+
138
+
#### Connect via Python FastMCP Client
139
+
140
+
Use the Python FastMCP client to connect to your LiteLLM MCP server:
print(f"Available tools: {json.dumps([t.name for t in tools], indent=2)}")
187
+
188
+
# Example: Call a tool (replace 'tool_name' with an actual tool name)
189
+
if tools:
190
+
tool_name = tools[0].name
191
+
print(f"Calling tool: {tool_name}")
192
+
193
+
# Call the tool with appropriate arguments
194
+
result =await client.call_tool(tool_name, arguments={})
195
+
print(f"Tool result: {result}")
196
+
197
+
198
+
# Run the example
199
+
if__name__=="__main__":
200
+
asyncio.run(main())
201
+
```
202
+
203
+
</TabItem>
204
+
</Tabs>
205
+
206
+
28
207
## MCP Permission Management
29
208
30
209
@@ -49,8 +228,6 @@ When MCP clients connect to LiteLLM's MCP Gateway they can run the following MCP
49
228
2. Call Tools: Call a specific MCP tool with the provided arguments
50
229
51
230
52
-
#### Usage
53
-
54
231
#### 1. Define your tools on under `mcp_servers` in your config.yaml file.
55
232
56
233
LiteLLM allows you to define your tools on the `mcp_servers` section in your config.yaml file. All tools listed here will be available to MCP clients (when they connect to LiteLLM and call `list_tools`).
0 commit comments