Skip to content
mcp-agent logo

mcp-agent

Verified

Composable Python framework for building agents via Model Context Protocol.

Autonomous AgentsGeneral-Purpose 8.4kOpen source
View on GitHub
Updated 2026-06-15
mcp-agent GitHub repository

What is mcp-agent?

mcp-agent is an open-source framework that connects language models to MCP servers through straightforward, reusable patterns. It manages connection lifecycles automatically and includes implementations of established agent workflows such as routing, evaluation, and orchestration.

The library works for basic agents while also supporting advanced setups via Temporal for pause, resume, and recovery capabilities. Agents can be exposed as MCP servers themselves, and the system emphasizes minimal code changes when moving from simple to production-grade deployments.

It targets developers who want reliable agent applications using existing MCP tools and resources, especially those familiar with Python and seeking to avoid overly intricate agent frameworks.

What you can build with mcp-agent

File and web research agent

Attach an agent to filesystem and fetch MCP servers to summarize documents or retrieve online content in response to natural language queries.

Workflow orchestration

Chain patterns such as map-reduce or evaluator-optimizer to process multi-step tasks while maintaining state across runs.

Agent as MCP server

Expose a custom agent as an MCP server endpoint so other tools or applications can call it through the standard protocol.

Install mcp-agent

Install
pip install mcp-agent
Quick start
> mkdir hello-mcp-agent && cd hello-mcp-agent
> uvx mcp-agent init
> uv init
> uv add "mcp-agent[openai]"
> # Add openai API key to `mcp_agent.secrets.yaml` or set `OPENAI_API_KEY`
> uv run main.py
>
  1. 1Install via pip with the mcp-agent package.
  2. 2Create an MCPApp instance and define an Agent with desired server names.
  3. 3Attach an LLM implementation such as OpenAIAugmentedLLM inside the agent context.
  4. 4Call generate methods on the LLM to process prompts using connected MCP tools.
  5. 5Add API keys to mcp_agent.secrets.yaml or environment variables before running.

mcp-agent: pros & cons

Pros

  • +Handles MCP server connections and lifecycle automatically
  • +Offers composable versions of proven agent patterns
  • +Supports durable execution through Temporal without API changes
  • +Allows agents to be published as MCP servers

Cons

  • Primarily documented for Python usage
  • Advanced durability requires separate Temporal setup
  • Depends on external MCP servers being available and configured
Did you find this helpful?

Frequently asked questions

An MCPApp context, an Agent configured with server names, and an attached LLM class plus valid API credentials.

User reviews

Verified reviews from the community shape this listing's rating.

Loading reviews…

Sign in to review

Promote mcp-agent

Add this badge to your website, or share the tool.

DFeatured on Dhanasvimcp-agent 0