MCP
Plug into the MCP ecosystem.
Model Context Protocol is becoming the open standard for AI agent tools. Agentmatic ships a first-class MCP client and server — no wrappers, no glue code.
MCP in one sentence: A standardized protocol so any AI agent can discover and call tools running in a separate process — think filesystem, git, browser, database — without writing per-tool adapters.
Connect to an MCP server
from agentmatic.tools.mcp import MCPClient
from agentmatic.prebuilt import create_react_agent
# Stdio transport — spawns the server as a subprocess.
mcp = MCPClient.stdio(["npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"])
tools = await mcp.list_tools_as_agentmatic() # filesystem.read, filesystem.write, ...
agent = create_react_agent(llm=OpenAI(), tools=tools)
print(await agent.invoke("Summarize the README at /tmp/project/README.md")) Expose your tools as an MCP server
from agentmatic.tools.mcp import serve_mcp
from my_tools import calculator, db_query
# Publish any Agentmatic tool registry as an MCP server over stdio.
if __name__ == "__main__":
serve_mcp([calculator, db_query], transport="stdio") Why MCP matters
- Process isolation. Tools that touch the filesystem or shell run out-of-process — safer than embedding them in your Python.
- Language-agnostic. An MCP server in Rust, Go, or TypeScript is callable from any Agentmatic SDK.
- Ecosystem. Filesystem, git, browser (Playwright), Postgres, GitHub, Slack, Gmail — there's an MCP server for it.
- Portability. The same tool you ship to your Agentmatic agent is reusable by Claude Desktop, Cursor, Cline, and anything else MCP-compatible.
Server discovery
Agentmatic respects mcp.json the same way Claude Desktop and Cursor do — drop a config and your agent finds the same servers your IDE uses.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"]
},
"git": { "command": "uvx", "args": ["mcp-server-git"] }
}
} MCP FAQ
Common MCP questions.
An open standard from Anthropic that lets LLM-based agents discover and call tools across processes. Think of it as USB-C for AI tools — a server exposes filesystem, git, browser, database access, etc., and any MCP-capable client (Agentmatic, Claude Desktop, Cursor, etc.) can use them.
stdio (subprocess) and SSE (HTTP server-sent events). The streamable HTTP transport from the 2025-03-25 spec is supported in 0.2+.
Yes. agentmatic.mcp.serve(tools, transport='stdio') publishes any tool registry as an MCP server. So you can ship your agent's toolset to Claude Desktop / Cursor / Cline users with one command.
MCP is process-isolated and language-agnostic; LangChain tools are in-process Python. We support both — from_langchain_tools() bridges LangChain into Agentmatic, and an MCP client connects to remote MCP servers. Use MCP for security-sensitive tools (filesystem, shell) and LangChain for fast in-process logic.
Ship your next agent in minutes, not weeks.
MIT licensed. Drop-in for LangGraph. Native SDKs in 5 languages. Battle-tested resilience primitives in the box.