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.

OpenMontage: The First Open-Source, Agentic Video Production System

OpenMontage: The First Open-Source, Agentic Video Production System

June 29, 2026

OpenMontage is the world's first open-source, agentic video production system, designed to transform your AI coding assistant into a full video production studio. It features 12 pipelines, 52 tools, and over 500 agent skills, enabling end-to-end video creation from a simple prompt. This powerful tool handles research, scripting, asset generation, editing, and final composition, including the unique ability to produce real video from stock footage.

agentic-aivideo-productionopen-source
MarkLLM: An Open-Source Toolkit for LLM Watermarking

MarkLLM: An Open-Source Toolkit for LLM Watermarking

June 23, 2026

MarkLLM is an open-source toolkit designed to simplify the research and application of watermarking technologies for large language models (LLMs). It offers a unified framework for implementing various watermarking algorithms, alongside robust visualization and comprehensive evaluation tools. This toolkit helps researchers and the broader community understand and assess the authenticity and origin of machine-generated text.

large-language-modelsllmsafety
Agent-Reach: Empower Your AI Agents with Internet Access, Zero API Fees

Agent-Reach: Empower Your AI Agents with Internet Access, Zero API Fees

June 21, 2026

Agent-Reach is a powerful GitHub repository that equips AI agents with the ability to access and search the entire internet, including platforms like Twitter, Reddit, YouTube, and Bilibili. It provides a streamlined CLI experience, eliminating the need for complex API configurations and associated fees. This project ensures your AI agent can "see" and interact with web content effortlessly.

ai-agentagent-infrastructureai-search
REAL Video Enhancer: AI-Powered Video Interpolation, Upscaling, and Denoising

REAL Video Enhancer: AI-Powered Video Interpolation, Upscaling, and Denoising

June 19, 2026

REAL Video Enhancer is a powerful open-source application designed to enhance video quality across Linux, Windows, and macOS. It leverages AI models for advanced video processing tasks such as frame interpolation, upscaling, decompression, and denoising. This tool provides a modern alternative to older software, making high-quality video enhancement accessible to a wider audience.

video-enhancementaiupscaling

Source repository

Open the original repository on GitHub.

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 ❤️