Specify a webhook-driven task for OpenClaw
Describe event inputs, validation, deduplication, and intended actions before integration work.
5,471,078 AI resources indexedWorking toward the world’s largest AI resource index.
Connect orxhestra agents to MCP tool servers using MCPClient and MCPToolAdapter.
---
name: mcp-integration-2d9aaa0a3536
description: Connect orxhestra agents to MCP tool servers using MCPClient and MCPToolAdapter.
---
# MCP Integration
Connect to any MCP-compatible tool server.
```bash
pip install orxhestra[mcp]
```
## Usage
```python
from orxhestra.integrations.mcp import MCPClient, MCPToolAdapter
client = MCPClient("http://localhost:8001/mcp")
adapter = MCPToolAdapter(client)
mcp_tools = await adapter.load_tools()
agent = LlmAgent(
name="MCPAgent",
model=model,
tools=mcp_tools,
instructions="Use the available tools to answer questions.",
)
```
## Testing with in-memory server
Pass a FastMCP server object directly (no HTTP needed):
```python
from fastmcp import FastMCP
server = FastMCP("TestServer")
@server.tool
def add(a: int, b: int) -> int:
"""Add two numbers."""
return a + b
client = MCPClient(server) # in-memory, no network
adapter = MCPToolAdapter(client)
tools = await adapter.load_tools()
```
`MCPToolAdapter.load_tools()` fetches the tool list from the MCP server and wraps each as a LangChain `BaseTool`.
## In YAML Composer
```yaml
tools:
weather:
mcp:
url: "http://localhost:8001/mcp"
local:
mcp:
server: "myapp.mcp_server.server" # dotted import to FastMCP instance
```
---
name: mcp-integration-2d9aaa0a3536
description: Connect orxhestra agents to MCP tool servers using MCPClient and MCPToolAdapter.
---
# MCP Integration
Connect to any MCP-compatible tool server.
```bash
pip install orxhestra[mcp]
```
## Usage
```python
from orxhestra.integrations.mcp import MCPClient, MCPToolAdapter
client = MCPClient("http://localhost:8001/mcp")
adapter = MCPToolAdapter(client)
mcp_tools = await adapter.load_tools()
agent = LlmAgent(
name="MCPAgent",
model=model,
tools=mcp_tools,
instructions="Use the available tools to answer questions.",
)
```
## Testing with in-memory server
Pass a FastMCP server object directly (no HTTP needed):
```python
from fastmcp import FastMCP
server = FastMCP("TestServer")
@server.tool
def add(a: int, b: int) -> int:
"""Add two numbers."""
return a + b
client = MCPClient(server) # in-memory, no network
adapter = MCPToolAdapter(client)
tools = await adapter.load_tools()
```
`MCPToolAdapter.load_tools()` fetches the tool list from the MCP server and wraps each as a LangChain `BaseTool`.
## In YAML Composer
```yaml
tools:
weather:
mcp:
url: "http://localhost:8001/mcp"
local:
mcp:
server: "myapp.mcp_server.server" # dotted import to FastMCP instance
```
Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.