{"name":"mcp-agent: Build Effective AI Agents with Model Context Protocol in Python","description":"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.","github":"https://github.com/lastmile-ai/mcp-agent","url":"https://osrepos.com/repo/lastmile-ai-mcp-agent","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/lastmile-ai-mcp-agent","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/lastmile-ai-mcp-agent.md","json":"https://osrepos.com/repo/lastmile-ai-mcp-agent.json","topics":["python","ai-agents","llm","mcp","agent-framework","model-context-protocol","artificial-intelligence"],"keywords":["python","ai-agents","llm","mcp","agent-framework","model-context-protocol","artificial-intelligence"],"stars":null,"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.","content":"## Introduction\n\n`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.\n\n## Installation\n\nTo get started with `mcp-agent`, we recommend using `uv` for Python project management.\n\nbash\nuv add \"mcp-agent\"\n\n\nAlternatively, you can use `pip`:\n\nbash\npip install mcp-agent\n\n\nRemember to add optional packages for specific LLM providers, for example:\n\nbash\nuv add \"mcp-agent[openai, anthropic, google, azure, bedrock]\"\n\n\n## Examples\n\n`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:\n\npython\nimport asyncio\n\nfrom mcp_agent.app import MCPApp\nfrom mcp_agent.agents.agent import Agent\nfrom mcp_agent.workflows.llm.augmented_llm_openai import OpenAIAugmentedLLM\n\napp = MCPApp(name=\"hello_world\")\n\nasync def main():\n    async with app.run():\n        agent = Agent(\n            name=\"finder\",\n            instruction=\"Use filesystem and fetch to answer questions.\",\n            server_names=[\"filesystem\", \"fetch\"],\n        )\n        async with agent:\n            llm = await agent.attach_llm(OpenAIAugmentedLLM)\n            answer = await llm.generate_str(\"Summarize README.md in two sentences.\")\n            print(answer)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n\n\nFor a quick start, you can scaffold a new project using the CLI:\n\nbash\nmkdir hello-mcp-agent && cd hello-mcp-agent\nuvx mcp-agent init\nuv init\nuv add \"mcp-agent[openai]\"\n# Add openai API key to `mcp_agent.secrets.yaml` or set `OPENAI_API_KEY`\nuv run main.py\n\n\nThe 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.\n\n## Why Use mcp-agent?\n\nIn 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:\n\n*   **Composable**: Every pattern is a reusable workflow that can be mixed and matched.\n*   **MCP-native**: Seamlessly connects to any MCP server, such as filesystem, fetch, Slack, Jira, or FastMCP apps, without custom adapters.\n*   **Production Ready**: Features like Temporal-backed durability, structured logging, token accounting, and Cloud deployments are first-class.\n*   **Pythonic**: Utilizes simple decorators and context managers for elegant integration.\n\n## Links\n\n*   **Official Documentation**: [docs.mcp-agent.com](https://docs.mcp-agent.com){target=\"_blank\"}\n*   **GitHub Repository**: [lastmile-ai/mcp-agent](https://github.com/lastmile-ai/mcp-agent){target=\"_blank\"}\n*   **PyPI**: [mcp-agent](https://pypi.org/project/mcp-agent/){target=\"_blank\"}\n*   **Discord Community**: [Join Discord](https://lmai.link/discord/mcp-agent){target=\"_blank\"}","metrics":{"detailViews":2,"githubClicks":4},"dates":{"published":null,"modified":"2025-12-07T00:01:23.000Z"}}