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
29 changes: 28 additions & 1 deletion examples/archive/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This example demonstrates how to use external MCP servers as tool providers with
```bash
# Install MCP CLI (if needed for other MCP servers)
uv pip install mcp

```

## Files

Expand Down Expand Up @@ -71,6 +71,33 @@ This will:
- **`MCPEnvironment`** - Environment that manages MCP server connections and tool execution
- **`MCPConnectionManager`** - Handles MCP server lifecycle and tool discovery

### Multiple MCP Servers

`MCPEnvironment` also supports routing tool calls across multiple named MCP servers:

```python
env = MCPEnvironment(
task={"question": "Find and summarize the latest updates."},
mcp_servers={
"search": {
"command": "npx",
"args": ["-y", "tavily-mcp@0.2.4"],
"env": {"TAVILY_API_KEY": "..."},
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
},
},
tool_name_to_server_name={
"tavily_search": "search",
"read_file": "filesystem",
},
)
```

Use `tool_name_to_server_name` when multiple servers expose the same public tool name, including underscore aliases for tools whose original MCP names contain hyphens.

### Integration with RLLM

The example follows standard RLLM patterns:
Expand Down
Loading
Loading