Skip to main content
mcp-agent logo mcp-agent is your pattern library for building Model Context Protocol agents. It pairs Anthropic’s Building Effective Agents patterns with a batteries-included runtime so you can focus on agent behavior—not wiring.

Why teams pick mcp-agent

Composable patterns

Parallel, router, planner, evaluator—every pattern from Anthropic’s guide (plus OpenAI Swarm-style handoffs) ships as a first-class workflow.

MCP-native

Works with any MCP server. Drop in the filesystem, fetch, Slack, Jira, or your own FastMCP servers and start calling tools immediately.

Production ready

Durable execution with Temporal, structured logging, token accounting, observability hooks, and cloud deployment via the CLI.

Lightweight & Pythonic

Define an agent with a few lines of Python—mcp-agent handles the lifecycle, connections, and MCP server wiring for you.
import asyncio
from mcp_agent.app import MCPApp
from mcp_agent.agents.agent import Agent
from mcp_agent.workflows.llm.augmented_llm_openai import OpenAIAugmentedLLM

app = MCPApp(name="researcher")

async def main():
    async with app.run() as session:
        agent = Agent(
            name="researcher",
            instruction="Use available tools to gather concise answers.",
            server_names=["fetch", "filesystem"],
        )

        async with agent:
            llm = await agent.attach_llm(OpenAIAugmentedLLM)
            report = await llm.generate_str("Summarize the latest MCP news")
            print(report)

if __name__ == "__main__":
    asyncio.run(main())

Start building

Want to go deeper? Browse Core Components for API details or jump to MCP Servers to see how FastMCP integrates with agents.
I