mcp-agent
Build effective agents using Model Context Protocol and simple workflow patterns
Install / Use
claude mcp add lastmile-ai -- npx -y github:lastmile-ai/mcp-agentIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Our assessment of mcp-agent
mcp-agent scores 89/100 on our quality scale, 1316th of 2,874 Automation skills we index (top 46%).
Its MCP Server is 34 KB long, well organised into 48 sections with 23 code examples: a thorough specification that gives an agent plenty to work with.
With 8,577 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 9 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-10-17 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 89/100, with 2 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
mcp-agent compared with similar skills
All 4 of these similar skills score higher than mcp-agent; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| mcp-agent (this skill)by lastmile-ai | 89 | 8.6k | 9mo ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 109.3k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.0k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.8k | 1d ago | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 98.3k | today | MCP Server |
Frequently asked questions
- How do I install mcp-agent?
- Run
claude mcp add lastmile-ai -- npx -y github:lastmile-ai/mcp-agent. The install tabs above show the steps for each supported agent. - Which AI agents does mcp-agent work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is mcp-agent safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 89/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is mcp-agent still maintained?
- The repository was last updated about 9 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubOverview
mcp-agent is a simple, composable framework to build effective agents using Model Context Protocol.
[!Note] mcp-agent's vision is that MCP is all you need to build agents, and that simple patterns are more robust than complex architectures for shipping high-quality agents.
mcp-agent gives you the following:
- Full MCP support: It fully implements MCP, and handles the pesky business of managing the lifecycle of MCP server connections so you don't have to.
- Effective agent patterns: It implements every pattern described in Anthropic's Building Effective Agents in a composable way, allowing you to chain these patterns together.
- Durable agents: It works for simple agents and scales to sophisticated workflows built on Temporal so you can pause, resume, and recover without any API changes to your agent.
<u>Altogether, this is the simplest and easiest way to build robust agent applications</u>.
We welcome all kinds of contributions, feedback and your help in improving this project.
<a id="minimal-example"></a> Minimal example
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())
# Add your LLM API key to `mcp_agent.secrets.yaml` or set it in env.
# The [Getting Started guide](https://docs.mcp-agent.com/get-started/overview) walks through configuration and secrets in detail.
At a glance
<table> <tr> <td width="50%" valign="top"> <h3>Build an Agent</h3> <p>Connect LLMs to MCP servers in simple, composable patterns like map-reduce, orchestrator, evaluator-optimizer, router & more.</p> <p> <a href="https://docs.mcp-agent.com/get-started/overview">Quick Start ↗</a> | <a href="https://docs.mcp-agent.com/mcp-agent-sdk/overview">Docs ↗</a> </p> </td> <td width="50%" valign="top"> <h3>Create any kind of MCP Server</h3> <p>Create MCP servers with a FastMCP-compatible API. You can even expose agents as MCP servers.</p> <p> <a href="https://docs.mcp-agent.com/mcp-agent-sdk/mcp/agent-as-mcp-server">MCP Agent Server ↗</a> | <a href="https://docs.mcp-agent.com/cloud/use-cases/deploy-chatgpt-apps">🎨 Build a ChatGPT App ↗</a> | <a href="https://github.com/lastmile-ai/mcp-agent/tree/main/examples/mcp_agent_server">Examples ↗</a> </p> </td> </tr> <tr> <td width="50%" valign="top"> <h3>Full MCP Support</h3> <p><b>Core:</b> Tools ✅ Resources ✅ Prompts ✅ Notifications ✅<br/> <b>Advanced</b>: OAuth ✅ Sampling ✅ Elicitation ✅ Roots ✅</p> <p> <a href="https://github.com/lastmile-ai/mcp-agent/tree/main/examples/mcp">Examples ↗</a> | <a href="https://modelcontextprotocol.io/docs/getting-started/intro">MCP Docs ↗</a> </p> </td> <td width="50%" valign="top"> <h3>Durable Execution (Temporal)</h3> <p>Scales to production workloads using Temporal as the agent runtime backend <i>without any API changes</i>.</p> <p> <a href="https://docs.mcp-agent.com/mcp-agent-sdk/advanced/durable-agents">Docs ↗</a> | <a href="https://github.com/lastmile-ai/mcp-agent/tree/main/examples/temporal">Examples ↗</a> </p> </td> </tr> <tr> <td width="50%" valign="top"> <h3>☁️ Deploy to Cloud</h3> <p><b>Beta:</b> Deploy agents yourself, or use <b>mcp-c</b> for a managed agent runtime. All apps are deployed as MCP servers.</p> <p> <a href="https://www.youtube.com/watch?v=0C4VY-3IVNU">Demo ↗</a> | <a href="https://docs.mcp-agent.com/get-started/cloud">Cloud Quickstart ↗</a> | <a href="https://github.com/lastmile-ai/mcp-agent/tree/main/examples/cloud">Examples ↗</a> </p> </td> </tr> </table>Documentation & build with LLMs
mcp-agent's complete documentation is available at docs.mcp-agent.com, including full SDK guides, CLI reference, and advanced patterns. This readme gives a high-level overview to get you started.
llms-full.txt: contains entire documentation.llms.txt: sitemap listing key pages in the docs.- docs MCP server
Table of Contents
- Overview
- Minimal example
- Quickstart
- Why mcp-agent
- Core concepts
- Workflow patterns
- CLI reference
- Authentication
- Advanced
- Cloud deployment
- Examples
- FAQs
- Community & contributions
Get Started
[!TIP] The CLI is available via
uvx mcp-agent. To get up and running, scaffold a project withuvx mcp-agent initand deploy withuvx mcp-agent deploy my-agent.You can get up and running in 2 minutes by running these commands:
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
Installation
We recommend using uv to manage your Python projects (uv init).
uv add "mcp-agent"
Alternatively:
pip install mcp-agent
Also add optional packages for LLM providers (e.g. uv add "mcp-agent[openai, anthropic, google, azure, bedrock]").
Quickstart
[!TIP] The
examplesdirectory has several example applications to get started with. To run an example, clone this repo (or generate one withuvx mcp-agent init --template basic --dir my-first-agent)cd examples/basic/mcp_basic_agent # Or any other example # Option A: secrets YAML # cp mcp_agent.secrets.yaml.example mcp_agent.secrets.yaml && edit mcp_agent.secrets.yaml uv run main.py
Here is a basic "finder" agent that uses the fetch and filesystem servers to look up a file, read a blog and write a tweet. Example link:
<details open> <summary>finder_agent.py</summary>import asyncio
import os
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_agent")
async def example_usage():
async with app.run() as mcp_agent_app:
logger = mcp_agent_app.logger
# This agent can read the filesystem or fetch URLs
finder_agent = Agent(
name="finder",
instruction="""You can read local files or fetch URLs.
Return the requested information when asked.""",
server_names=["fetch", "filesystem"], # MCP servers this Agent can use
)
async with finder_agent:
# Automatically initializes the MCP servers and adds their tools for LLM use
tools = await finder_agent.list_tools()
logger.info(f"Tools available:", data=tools)
# Attach an OpenAI LLM to the agent (defaults to GPT-4o)
llm = await finder_agent.attach_llm(OpenAIAugmentedLLM)
# This will perform a file lookup and read using the filesystem server
result = await llm.generate_str(
message="Show me what's in README.md verbatim"
)
logger.info(f"README.md contents: {result}")
# Uses the fetch server to fetch the content from URL
result = await llm.generate_str(
message="Print the first two paragraphs from https://www.anthropic.com/research/building-effective-agents"
)
logger.info(f"Blog intro: {result}")
# Multi-turn interactions by default
result = await llm.generate_str("Summarize that in a 128-char tweet")
logger.info(f"Tweet: {result}")
if __name__ == "__main__":
asyncio.run(example_usage())
</details>
<details>
<summary>mcp_agent.config.yaml</summary>
execution_engine: asyncio
logger:
transports: [console] # You can use [file, console] for both
level: debug
path: "logs/mcp-agent.jsonl" # Used for file transport
# For dynamic log filenames:
# path_settings:
# path_pattern: "logs/mcp-agent-{unique_id}.jsonl"
# unique_id: "timestamp" # Or "session_id"
# timestamp_format: "%Y%m%d_%H%M%S"
mcp:
servers:
fetch:
command: "uvx"
args: ["mcp-server-fetch"]
filesystem:
command: "npx"
args:
[
"-y",
"@modelcontextprotocol/server-filesystem",
"<add_your_directories>",
]
openai:
# Secrets (API keys, etc.) are stored in an mcp_agent.secrets.yaml file which can be gitignored
default_model: gpt-4o
</details>
<details>
<summary>Agent output</summary>
<img width="2398" alt="Image" src="hTruncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
109.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.8kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Scrapling
98.3k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
