AI Agents with MCP

To Nha Notes | Sept. 3, 2025, 10:34 a.m.

The mcp-agent project from LastMile AI offers an elegant and composable Python-centric framework for building AI agents using the Model Context Protocol (MCP). This protocol—introduced by Anthropic in November 2024—is emerging as a standardized, “USB-C of AI” interface for securely linking AI agents with diverse tools and data sources.


What Makes mcp-agent Stand Out

  • Purpose-built for MCP: Unlike heavy frameworks, mcp-agent purposefully wraps MCP’s complexity, handling connection lifecycles, tool orchestration, and server management so developers can focus on agent logic.

  • Composable architecture: Implements core patterns from Anthropic’s Building Effective Agents manifesto—such as Parallel, Router, Intent-Classifier, Evaluator-Optimizer—plus OpenAI’s Swarm pattern, all in a model-agnostic style.

  • Versatile deployment modes: Run as standalone scripts or notebooks, embed in MCP clients, or expose as an MCP server to be invoked by clients like Claude Desktop.


Real-World Examples

  • Claude Desktop integration: Wrap an agent as an MCP server, enabling Claude to invoke workflows—for example, multi-agent evaluation that analyzes and then aggregates feedback on a poem.

  • Streamlit-based Gmail agent: A practical demo that can read, send, or triage emails via text prompt by leveraging an MCP Gmail server.

  • Marimo notebook: An interactive, reactive UI inside a notebook environment, offering an alternative to Jupyter or Streamlit.


Insights from the Community

  • Joshua Berkowitz: Praises the framework’s pragmatism—lightweight code, familiar Python syntax, provider-agnostic patterns, and built-in telemetry for observing tool selection and outcomes.

  • Reddit contributors: Users report ease of use, for example building a financial-advisor-replacing agent with mcp-agent's orchestrator picking appropriate tools.


Roadmap & Future Potential

The project continues to be actively developed. Planned features include:

  • Durable execution (pausable, persistent workflows, potentially using Temporal)

  • Long-term memory

  • Streaming support

  • Expanded MCP capabilities beyond tool calls (resources, prompts, notifications)


TL;DR Summary

  • What is it? A Python framework for building AI agents using MCP, emphasizing interoperability, composability, and minimal infrastructure overhead.

  • Why use it? If you're working with MCP-aware tools or looking for modular, production-level agent patterns, this is one of the most developer-friendly paths.

  • How to start? Install with pip install mcp-agent or uv add "mcp-agent", explore the built-in examples (CLI, Streamlit Gmail, Marimo, etc.), and extend with your own MCP servers and workflows.


🔗 References