Multi-server MCP setup
Compose multiple MCP servers under one MCPRegistry. Tool name
conflicts get auto-disambiguated.
from loomflow import Agent
from loomflow.mcp import MCPClient, MCPRegistry, MCPServerSpec
registry = MCPRegistry([
MCPServerSpec.stdio(
name="git",
command="uvx",
args=["mcp-server-git", "--repo", "/Users/me/code/myrepo"],
),
MCPServerSpec.stdio(
name="fs",
command="uvx",
args=["mcp-server-filesystem", "--root", "/Users/me/workspace"],
),
MCPServerSpec.http(
name="hosted",
url="https://example.com/mcp/",
headers={"Authorization": "Bearer ..."},
),
])
agent = Agent(
"You are a developer assistant.",
model="claude-opus-4-7",
tools=registry,
)If both git and fs exposed a tool named status, the agent would
see git.status and fs.status. Either qualified or bare form is
accepted at call time; the registry strips the prefix before
forwarding to the underlying session.
Last updated on