Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

docs mcp tool spec

Ishaan Jaff9173685ec2b9
diff --git a/docs/my-website/docs/mcp.md b/docs/my-website/docs/mcp.md
index 176ccb504a6..4bdca6cf471 100644
--- a/docs/my-website/docs/mcp.md
+++ b/docs/my-website/docs/mcp.md
@@ -1,3 +1,7 @@
+import Image from '@theme/IdealImage';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
# /mcp Model Context Protocol [BETA]
## Overview
@@ -50,7 +54,38 @@ mcp_tools:
handler: "mcp_tools.get_current_time"
```
-### 2. Start LiteLLM Proxy Server
+
+### 3. Start LiteLLM Gateway
+
+<Tabs>
+<TabItem value="docker" label="Docker Run">
+
+Mount your `custom_logger.py` on the LiteLLM Docker container.
+
+```shell
+docker run -d \
+ -p 4000:4000 \
+ -e OPENAI_API_KEY=$OPENAI_API_KEY \
+ --name my-app \
+ -v $(pwd)/my_config.yaml:/app/config.yaml \
+ -v $(pwd)/custom_logger.py:/app/custom_logger.py \
+ my-app:latest \
+ --config /app/config.yaml \
+ --port 4000 \
+ --detailed_debug \
+```
+
+</TabItem>
+
+<TabItem value="py" label="litellm pip">
+
+```shell
+litellm --config config.yaml --detailed_debug
+```
+
+</TabItem>
+</Tabs>
+
### 3. Make an LLM API request
@@ -99,4 +134,48 @@ if __name__ == "__main__":
```
+## Specification for `mcp_tools`
+
+The `mcp_tools` section in your LiteLLM config defines tools that can be called by MCP-compatible clients.
+
+### Tool Definition Format
+
+```yaml
+mcp_tools:
+ - name: string # Required: Name of the tool
+ description: string # Required: Description of what the tool does
+ input_schema: object # Required: JSON Schema defining the tool's input parameters
+ handler: string # Required: Path to the function that implements the tool
+```
+### Field Details
+
+- `name`: A unique identifier for the tool
+- `description`: A clear description of what the tool does, used by LLMs to determine when to call it
+- `input_schema`: JSON Schema object defining the expected input parameters
+- `handler`: String path to the Python function that implements the tool (e.g., "module.submodule.function_name")
+
+### Example Tool Definition
+
+```yaml
+mcp_tools:
+ - name: "get_current_time"
+ description: "Get the current time in a specified format"
+ input_schema: {
+ "type": "object",
+ "properties": {
+ "format": {
+ "type": "string",
+ "description": "The format of the time to return",
+ "enum": ["short", "long", "iso"]
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The timezone to use (e.g., 'UTC', 'America/New_York')",
+ "default": "UTC"
+ }
+ },
+ "required": ["format"]
+ }
+ handler: "mcp_tools.get_current_time"
+```