mcp-agent

MCP.Pizza Chef: lastmile-ai

mcp-agent is a Python toolkit for building agents that use MCP servers, based on the patterns Anthropic described in Building Effective Agents. It keeps the connections to your MCP servers alive for you, and gives you ready-made ways to run steps in parallel, route a request to the right specialist, or have one agent check another's work. The project ships examples for Claude Desktop, Streamlit apps including a Gmail agent, and plain Python scripts.

Coding

Use This MCP server To

Look up a file and turn it into a short post Run several checks at once and combine the results Send each request to the agent best suited to it Have a second agent review and improve the first draft Build a small assistant that reads my Gmail Reuse MCP servers I already have without wiring them up

README

Logo

Build effective agents with Model Context Protocol using simple, composable patterns.

Examples | Building Effective Agents | MCP

discord Pepy Total Downloads

Overview

mcp-agent is a simple, composable framework to build agents using Model Context Protocol.

Inspiration: Anthropic announced 2 foundational updates for AI application developers:

  1. Model Context Protocol - a standardized interface to let any software be accessible to AI assistants via MCP servers.
  2. Building Effective Agents - a seminal writeup on simple, composable patterns for building production-ready AI agents.

mcp-agent puts these two foundational pieces into an AI application framework:

  1. It handles the pesky business of managing the lifecycle of MCP server connections so you don't have to.
  2. It implements every pattern described in Building Effective Agents, and does so in a composable way, allowing you to chain these patterns together.
  3. Bonus: It implements OpenAI's Swarm pattern for multi-agent orchestration, but in a model-agnostic way.

Altogether, this is the simplest and easiest way to build robust agent applications. Much like MCP, this project is in early development. We welcome all kinds of contributions, feedback and your help in growing this to become a new standard.

mcp-agent FAQ

Do I need to write code?
Yes — it is a Python package you install with uv or pip and then build your agent in a script.
Do I need a key?
You supply a model key, such as OpenAI, in a separate secrets file that stays out of version control.
Can I use this to connect several MCP servers at once?
Yes — you list them in a config file and it manages the connections for you.
Which apps can it plug into?
The examples cover Claude Desktop, Streamlit and Marimo apps, and plain Python command-line tools.
What patterns does it support?
Running work in parallel, routing, intent classification, a planner with workers, and one agent evaluating another.
How hard is setup?
Developer-level: installing a Python package and editing two small config files.