mcp-agent: Build Effective AI Agents with Model Context Protocol in Python

This repository profile is provided by osrepos.com, an open source repository discovery platform.

mcp-agent: Build Effective AI Agents with Model Context Protocol in Python

Summary

mcp-agent is a powerful Python framework designed to help developers build effective AI agents using the Model Context Protocol (MCP) and simple, composable workflow patterns. It fully implements MCP, providing robust support for agent lifecycle management and integrating patterns from Anthropic's 'Building Effective Agents'. This framework simplifies the creation of durable, production-ready agent applications.

Repository Information

Analyzed by OSRepos on December 7, 2025

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

mcp-agent is a powerful and composable Python framework for building effective AI agents. It leverages the Model Context Protocol (MCP) to provide a streamlined approach, allowing developers to focus on agent behavior rather than boilerplate. This framework fully implements MCP, handling server connections and offering robust patterns for creating intelligent, durable agents that scale to production workloads.

Installation

To get started with mcp-agent, we recommend using uv for Python project management.

uv add "mcp-agent"

Alternatively, you can use pip:

pip install mcp-agent

Remember to add optional packages for specific LLM providers, for example:

uv add "mcp-agent[openai, anthropic, google, azure, bedrock]"

Examples

mcp-agent provides a simple and composable way to build agents. Here is a minimal example demonstrating how to create an agent that uses filesystem and fetch servers:

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="hello_world")

async def main():
    async with app.run():
        agent = Agent(
            name="finder",
            instruction="Use filesystem and fetch to answer questions.",
            server_names=["filesystem", "fetch"],
        )
        async with agent:
            llm = await agent.attach_llm(OpenAIAugmentedLLM)
            answer = await llm.generate_str("Summarize README.md in two sentences.")
            print(answer)


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

For a quick start, you can scaffold a new project using the CLI:

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

The project also includes a "finder" agent example that can read local files or fetch URLs, then summarize content into a tweet. More examples are available in the official documentation.

Why Use mcp-agent?

In a landscape of many AI frameworks, mcp-agent stands out as the only one purpose-built for the Model Context Protocol (MCP). It combines Anthropic’s "Building Effective Agents" patterns with a comprehensive MCP runtime, allowing you to concentrate on agent behavior. Key reasons to choose mcp-agent include:

  • Composable: Every pattern is a reusable workflow that can be mixed and matched.
  • MCP-native: Seamlessly connects to any MCP server, such as filesystem, fetch, Slack, Jira, or FastMCP apps, without custom adapters.
  • Production Ready: Features like Temporal-backed durability, structured logging, token accounting, and Cloud deployments are first-class.
  • Pythonic: Utilizes simple decorators and context managers for elegant integration.

Links

Related repositories

Similar repositories that may be relevant next.

Vicoa: Agentic IDE for Orchestrating Coding Agents Across Devices

Vicoa: Agentic IDE for Orchestrating Coding Agents Across Devices

September 29, 2026

Vicoa is an open-source, self-hostable agentic IDE designed to orchestrate a team of coding agents. It enables developers to run and steer multiple AI agents from various devices, including desktop, mobile, and remote servers, providing a unified command center for development workflows.

ai-agentsidedeveloper-tools
Open ACE: Self-Hosted AI Coding Agent Workspace and Governance Platform

Open ACE: Self-Hosted AI Coding Agent Workspace and Governance Platform

September 28, 2026

Open ACE is an open-source, self-hosted platform designed for managing AI coding agents within enterprise environments. It provides a unified workspace for various AI tools, enabling remote execution and robust governance features for API keys, costs, and compliance. This platform is ideal for organizations integrating AI coding agents into their development workflows, especially those requiring private deployment and centralized control.

ai-governanceai-workspaceenterprise-ai
Spec Kitty: Spec-Driven Development for AI Coding Agents and Software Factories

Spec Kitty: Spec-Driven Development for AI Coding Agents and Software Factories

September 27, 2026

Spec Kitty is an open-source CLI that enables spec-driven development for AI coding agents and multi-agent workflows. It transforms product intent into a structured, repo-native AI coding workflow, providing isolated git worktrees and a clear lifecycle for development tasks. This tool helps teams build governed software factories, ensuring visibility and traceability in AI-assisted software development.

agentic-codingai-agentsai-coding-workflow
Graphon: A Python Graph Execution Engine for Agentic AI Workflows

Graphon: A Python Graph Execution Engine for Agentic AI Workflows

September 26, 2026

Graphon is an innovative Python-based graph execution engine designed for building agentic AI workflows. It provides a robust framework for orchestrating complex AI tasks, featuring event-driven execution, graph validation, and shared runtime state. This evolving repository already includes a functional engine, built-in nodes, and end-to-end examples for developers.

agentaidify

Source repository

Open the original repository on GitHub.

30 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️