Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
# Run tests that don't need server - fast feedback!
python tests/test_ci_quick.py
python -m pytest tests/test_plugins.py -v --tb=short || python tests/test_plugins.py
python -m pytest tests/test_proxy_plugin.py -v --tb=short
python tests/test_approaches.py
python tests/test_reasoning_simple.py
python tests/test_batching.py
Expand Down
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ The Model Context Protocol (MCP) plugin enables OptiLLM to connect with MCP serv
OptiLLM supports both **local** and **remote** MCP servers through multiple transport methods:
- **stdio**: Local servers (traditional)
- **SSE**: Remote servers via Server-Sent Events
- **WebSocket**: Remote servers via WebSocket connections
- **Streamable HTTP**: Remote servers via the MCP Streamable HTTP transport

#### What is MCP?

Expand Down Expand Up @@ -449,14 +449,17 @@ The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open
}
```

**Remote Server (WebSocket) - New Feature:**
**Remote Server (Streamable HTTP):**
```json
{
"mcpServers": {
"remote-ws": {
"transport": "websocket",
"url": "wss://api.example.com/mcp",
"description": "Remote WebSocket MCP server"
"remote-http": {
"transport": "streamable_http",
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer ${API_TOKEN}"
},
"description": "Remote Streamable HTTP MCP server"
}
},
"log_level": "INFO"
Expand All @@ -482,8 +485,8 @@ The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open
"description": "GitHub MCP server"
},
"remote-api": {
"transport": "websocket",
"url": "wss://api.company.com/mcp",
"transport": "streamable_http",
"url": "https://api.company.com/mcp",
"description": "Company internal MCP server"
}
},
Expand All @@ -495,7 +498,7 @@ The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open

**Common Parameters:**
- **Server name**: A unique identifier for the server (e.g., "filesystem", "github")
- **transport**: Transport method - "stdio" (default), "sse", or "websocket"
- **transport**: Transport method - "stdio" (default), "sse", or "streamable_http"
- **description** (optional): Description of the server's functionality
- **timeout** (optional): Connection timeout in seconds (default: 5.0)

Expand All @@ -509,8 +512,12 @@ The [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open
- **headers** (optional): HTTP headers for authentication
- **sse_read_timeout** (optional): SSE read timeout in seconds (default: 300.0)

**websocket Transport (WebSocket):**
- **url**: The WebSocket endpoint URL
**streamable_http Transport (Streamable HTTP):**
- **url**: The MCP endpoint URL
- **headers** (optional): HTTP headers for authentication
- **sse_read_timeout** (optional): Read timeout in seconds (default: 300.0)

The `websocket` transport was removed in MCP Python SDK 2.x and is no longer supported; use `streamable_http` or `sse` instead.

**Environment Variable Expansion:**
Headers and other string values support environment variable expansion using `${VARIABLE_NAME}` syntax. This is especially useful for API keys:
Expand All @@ -536,12 +543,12 @@ You can use any of the [official MCP servers](https://modelcontextprotocol.io/ex
- **SQLite**: `@modelcontextprotocol/server-sqlite` - SQLite database access
- **Brave Search**: `@modelcontextprotocol/server-brave-search` - Web search capabilities

##### Remote MCP Servers (SSE/WebSocket transport)
##### Remote MCP Servers (SSE/Streamable HTTP transport)

Remote servers provide centralized access without requiring local installation:

- **GitHub MCP Server**: `https://api.githubcopilot.com/mcp` - Repository management, issue tracking, and code analysis
- **Third-party servers**: Any MCP server that supports SSE or WebSocket protocols
- **Third-party servers**: Any MCP server that supports the SSE or Streamable HTTP transports

##### Example: Comprehensive Configuration

Expand Down Expand Up @@ -627,7 +634,7 @@ Check this log file for connection issues, tool execution errors, and other diag

2. **Access denied**: For filesystem operations, ensure the paths specified in the configuration are accessible to the process.

**Remote Server Issues (SSE/WebSocket transport):**
**Remote Server Issues (SSE/Streamable HTTP transport):**

3. **Connection timeout**: Remote servers may take longer to connect. Increase the `timeout` value in your configuration.

Expand All @@ -641,7 +648,7 @@ Check this log file for connection issues, tool execution errors, and other diag

7. **Method not found**: Some servers don't implement all MCP capabilities (tools, resources, prompts). Verify which capabilities the server supports.

8. **Transport not supported**: Ensure you're using a supported transport: "stdio", "sse", or "websocket".
8. **Transport not supported**: Ensure you're using a supported transport: "stdio", "sse", or "streamable_http".

**Example: Testing GitHub MCP Connection**

Expand Down
2 changes: 1 addition & 1 deletion optillm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Version information
__version__ = "0.3.22"
__version__ = "0.4.0"

import os as _os

Expand Down
Loading
Loading