mcp-agent

Framework · Last verified 2026-09-30

TL;DR

mcp-agent is an Apache-2.0 Python framework from LastMile AI for building agents whose tools come from MCP servers, with ready-made router, parallel, orchestrator, evaluator-optimizer and swarm patterns and optional Temporal-backed durable runs. Its last push was 25 January 2026. It suits Python developers building MCP-centric agent workflows.

Key facts

mcp-agent key facts. Data as of 2026-09-30.
Type Framework
Languages / SDKs Python
License Apache-2.0
Pricing model Open source, free
Orchestration pattern Supervisor
GitHub stars 8,563 (as of 2026-09-30)
GitHub forks 891
Last push 2026-01-25
Latest release v0.0.21
Repository lastmile-ai/mcp-agent
Website docs.mcp-agent.com
Documentation docs.mcp-agent.com
Last verified 2026-09-30

Key features

  • Agents declare MCP servers by name (server_names) and the framework manages the connections; tools, resources, prompts, roots, sampling and elicitation are supported. (source)
  • Pattern helpers return composable AugmentedLLMs: parallel fan-out/fan-in, router, intent classifier, orchestrator-workers, deep research and evaluator-optimizer. (source)
  • create_orchestrator plans a goal (full upfront or iteratively), hands steps to worker agents and synthesizes the result. (source)
  • A Swarm pattern implements OpenAI Swarm-style handoffs between agents that keep conversation context. (source)
  • Switching execution_engine to temporal adds durable runs with pause/resume, retries and human input without changing workflow code. (source)
  • An MCPApp can itself be served as an MCP server, exposing its tools and workflows to MCP clients. (source)
  • The CLI scaffolds projects, deploys to the hosted mcp-c runtime, and registers deployed servers with clients such as Claude Code, Cursor and VS Code. (source)

Architecture and orchestration pattern

Pattern: Supervisor

An MCPApp holds configuration (MCP servers, model providers, logging) read from mcp_agent.config.yaml and mcp_agent.secrets.yaml. An Agent has an instruction and a list of MCP server names; entering the agent opens those connections, and attach_llm() returns an AugmentedLLM that can call the servers' tools in a loop.

Multi-agent behaviour comes from pattern helpers that each return another AugmentedLLM, so patterns nest: a router can send work to an orchestrator, an orchestrator step can fan out in parallel, and any result can pass through an evaluator-optimizer loop. The orchestrator-workers helper plans steps (all at once or one at a time), assigns them to worker agents and synthesizes the answer; a Swarm helper provides handoffs in the style of OpenAI Swarm. Control flow between patterns is ordinary Python (if, while) rather than a graph definition.

Each AugmentedLLM keeps conversation history in memory (SimpleMemory by default), which can be read, cleared or replaced. With the default asyncio engine, state lives in the process; with the Temporal engine, workflow state is persisted so runs can pause, resume and survive restarts. Long-term memory is not built in and is an open feature request.

Human in the loop

Workflows can ask a person for input with context.request_human_input(HumanInputRequest(...)); locally this can be answered through a console callback, and the README describes human input as a tool call an agent can make. With the Temporal engine the run waits durably until it is resumed, for example with mcp-agent cloud workflows resume ... --payload '{"content": "approve"}'. MCP elicitation also lets a server pause a tool call to request structured input from the user.

Harnesses it can drive

Protocols

MCP, A2A and AG-UI support for mcp-agent. See the full matrix.
ProtocolSupportNote
MCP Yes evidence
checked 2026-09-30
Client and server: agents connect to MCP servers over stdio, SSE, Streamable HTTP or WebSocket with tools, resources, prompts, roots, sampling and elicitation, and apps can be exposed as MCP servers.
A2A Unknown
checked 2026-09-30
README and docs llms.txt do not mention A2A; GitHub code search for a2a in lastmile-ai/mcp-agent returned no results.
AG-UI Unknown
checked 2026-09-30
README, docs llms.txt and GitHub code search for ag-ui returned nothing, and mcp-agent is not in the AG-UI README integration list.

Best for

  • Python agents whose tools live in several MCP servers, configured by name in one YAML file.
  • Long-horizon research runs using the deep research orchestrator with budgets and policy checks. (shortlist)
  • Workflows that must pause for approvals and resume later, backed by Temporal.
  • Packaging an agent workflow as an MCP server that Claude Code, Cursor or other MCP clients can call.

Not for

  • Teams that need a TypeScript or JVM SDK.
  • Projects that require an actively updated dependency; the repository has had no pushes since 25 January 2026.
  • Applications that need built-in long-term memory; it is still an open feature request.

Quickstart

pip install mcp-agent

Install not yet verified by this site. What this means

import asyncio

from mcp_agent.app import MCPApp
from mcp_agent.workflows.factory import AgentSpec, create_orchestrator

# mcp_agent.config.yaml must define a "fetch" MCP server; set OPENAI_API_KEY.
app = MCPApp(name="brief_writer")

async def main():
    async with app.run() as running_app:
        orchestrator = create_orchestrator(
            available_agents=[
                AgentSpec(name="reader", instruction="Fetch pages and pull out facts.", server_names=["fetch"]),
                AgentSpec(name="writer", instruction="Write a five-bullet brief from the facts."),
            ],
            plan_type="full", provider="openai", context=running_app.context,
        )
        print(await orchestrator.generate_str("Summarize https://modelcontextprotocol.io for a newcomer."))

asyncio.run(main())

Common pitfalls

  • Targets Python 3.10 or newer.
  • Model providers are extras: pip install "mcp-agent[openai]" (also anthropic, google, azure, bedrock).
  • MCP servers and providers are configured in mcp_agent.config.yaml; keys go in mcp_agent.secrets.yaml (keep it out of git) or environment variables. uvx mcp-agent init scaffolds both.
  • Pause/resume, durable history and human input across restarts need execution_engine: temporal plus a running Temporal worker.
  • The GitHub Releases page still shows v0.0.21 (May 2025) as latest, while tags and pyproject.toml are at 0.2.6; check the version you actually install.
  • The hosted mcp-c runtime is in open beta.

Official quickstart

Pros

  • Broad MCP coverage in one client: tools, resources, prompts, roots, sampling and elicitation across several transports. (source)
  • Workflow patterns are nestable building blocks, all returning the same AugmentedLLM interface. (source)
  • Durable execution through Temporal without rewriting workflow code. (source)
  • Any app can be exposed as an MCP server, so its workflows are callable from MCP clients. (source)
  • The hosted mcp-c runtime is free to use during its open beta. (source)

Cons

  • The repository's last push was on 25 January 2026; no commits have landed since then as of 30 September 2026. (source)
  • GitHub Releases stop at v0.0.21 (May 2025), while later versions up to v0.2.6 exist only as tags. (source)
  • Long-term memory support has been an open feature request since January 2025. (source)
  • An open bug reports that an exception inside @app.workflow_run leaves the Temporal run in a Running state instead of failing it. (source)
  • The managed cloud runtime (mcp-c) is still labelled open beta. (source)

Alternatives

FAQ

Does mcp-agent support MCP?

Yes, it is built around MCP: agents connect to MCP servers as clients with tools, resources, prompts, sampling and elicitation, and an app can be exposed as an MCP server. A2A and AG-UI support were not found.

Is mcp-agent still maintained?

The repository's last push was on 25 January 2026, and nothing has been pushed since as of 30 September 2026. No deprecation notice was found in the README.

Is mcp-agent free?

The framework is Apache-2.0 licensed. LastMile's hosted runtime, mcp-c, is described as open beta and free to use; model calls are billed by your provider.

Can mcp-agent be used from Claude Code?

Yes, as an MCP server: the CLI command mcp-agent install --client claude_code registers a deployed mcp-agent server in Claude Code's configuration.

How is mcp-agent different from OpenAI Swarm?

mcp-agent includes a handoff pattern that its docs describe as compatible with OpenAI Swarm, but adds MCP server management, other workflow patterns such as router and orchestrator, and optional Temporal durability.

Sources

Unknown fields: protocols.a2a and protocols.agui are unknown: the README and docs llms.txt do not mention either, GitHub code search in lastmile-ai/mcp-agent returned nothing for a2a or ag-ui, and mcp-agent is not in the AG-UI README integration list.

Something wrong or out of date, or do you maintain mcp-agent and want this page removed? Report a correction or request removal.