Build effective agents with Model Context Protocol using simple, composable patterns.
mcp-agent is a simple, composable framework for building AI agents using the Model Context Protocol (MCP). It implements Anthropic’s Building Effective Agents patterns in a model-agnostic way, allowing you to create robust agent applications that can leverage any MCP-compatible tools and services.
mcp-agent bridges the gap between the low-level Model Context Protocol and high-level agent patterns. It handles the complex mechanics of managing MCP server connections, tool orchestration, and workflow patterns so you can focus on building your application logic.
Seamless connection to any MCP server with tools, resources, prompts, and file system roots
Pre-built implementations of proven agent workflow patterns
Works with OpenAI, Anthropic, Azure, AWS Bedrock, Google, and Ollama
Chain workflow patterns together for complex behaviors
Built-in support for human input and workflow signaling
Comprehensive logging and telemetry support
As more services become MCP-aware, you can use mcp-agent to build agents that leverage these tools out-of-the-box. mcp-agent is the only framework purpose-built for the MCP protocol, making it the simplest way to build robust agent applications.
mcp-agent implements every pattern from Anthropic’s research on building effective agents:
Fan-out tasks to multiple agents
Route inputs to appropriate handlers
Intent classification with confidence scoring
Iteratively improve responses
Plan and execute complex tasks
Multi-agent collaboration
Here’s a simple agent that can read files and fetch web content:
Get Started
Core Concepts
Understand agents, MCP servers, and Augmented LLMs
MCP Servers
Work with tools, resources, prompts, and roots
Workflow Patterns
Integrations
Build applications with Streamlit, Claude Desktop, and more
Advanced Features
Composition, Monitoring and Temporal
Source code, issues, and contributions
Join our community for support
30+ working examples to learn from
Let’s install mcp-agent and build your first agent!