A tutorial example demonstrating how to build and deploy an MCP agent using mcp-agent. This simple todo assistant helps you manage your tasks through natural language interactions.
mcp-agent is a simple, composable framework to build agents using Model Context Protocol.
Inspiration: Anthropic announced 2 foundational updates for AI application developers:
- Model Context Protocol - a standardized interface to let any software be accessible to AI assistants via MCP servers.
- Building Effective Agents - a seminal writeup on simple, composable patterns for building production-ready AI agents.
mcp-agent puts these two foundational pieces into an AI application framework:
- It handles the pesky business of managing the lifecycle of MCP server connections so you don't have to.
- It implements every pattern described in Building Effective Agents, and does so in a composable way, allowing you to chain these patterns together.
- Bonus: It implements OpenAI's Swarm pattern for multi-agent orchestration, but in a model-agnostic way.
Altogether, this is the simplest and easiest way to build robust agent applications. Much like MCP, this project is in early development.
Prerequisites:
- Python 3.10+
- uv
- Initialize a new UV project:
uv init- Add the mcp-agent dependency:
uv add mcp-agent- Add the OpenAI dependency:
uv add openai-
Configure your OpenAI API key in
mcp_agent.secrets.yaml -
Login to your mcp-agent cloud account
uv run mcp-agent loginuv run main.pyuv run mcp-agent deploy --no-authAdd custom connector
example url: https://1m82g32x8nkoppinayx0k5ye12oar6vk.deployments.mcp-agent.com/sse
pizza-openai.mp4
Add custom connector
example url: https://1m82g32x8nkoppinayx0k5ye12oar6vk.deployments.mcp-agent.com/sse