Usage
Testing with in-memory server
For testing, pass a fastMCP server object directly (no HTTP needed):MCPToolAdapter.load_tools() fetches the tool list from the MCP server and wraps each as a LangChain BaseTool.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Connect to MCP-compatible tool servers and use their tools inside any agent. MCPClient and MCPToolAdapter for seamless integration.
pip install orxhestra[mcp]
from orxhestra.integrations.mcp import MCPClient, MCPToolAdapter
# Connect to an MCP server (HTTP or in-memory)
client = MCPClient("http://localhost:8001/mcp")
# Wrap MCP tools as LangChain tools
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.",
)
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.Was this page helpful?