# Exposing Agents as MCP Servers with mcp-agent

Sarmad Qadri, Last Mile AI | AI Engineer World's Fair 2025 | 18:05

Source: https://www.youtube.com/watch?v=uFPAtKIN-FQ
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/exposing-agents-as-mcp-servers-with-mcp-agent
Published: 2025-06-11
Tags: agents, mcp, multi-agent, tool-use, workflows

## TL;DR
- Agents can be exposed as MCP servers so MCP clients such as Claude Desktop and Cursor can invoke and coordinate them.
- MCP-agent implements composable agent patterns and treats agents as asynchronous workflows that can pause, resume, retry, and wait for human input.
- Running agent workflows on dedicated infrastructure separates execution from the client and allows the same agent to be used from any MCP-compatible application.

## Summary
Sarmad Qadri describes an agent stack built from better models, Model Context Protocol, and simpler application patterns. He argues that MCP servers should expose more than individual REST-style tools. An agent can itself be an MCP server, allowing clients such as Claude Desktop and Cursor to invoke it, coordinate several agents, and connect those agents to ordinary MCP servers. Qadri's mcp-agent framework implements patterns from Anthropic's Building Effective Agents, including augmented LLMs, evaluator loops, fan-out and fan-in, and dynamic orchestration. It models agents as asynchronous workflows backed by Temporal, so tasks can be scheduled, paused, resumed, retried, or continued after a client disconnects. In the demo, an orchestrator assigns agents to fetch a student's story, proofread it, check facts, enforce APA style, and write a report. The same workflow is then exposed through MCP and invoked from Claude Desktop.

## Key ideas
### The 2025 agent stack relies on better models, MCP, and simpler patterns
[02:28](https://www.youtube.com/watch?v=uFPAtKIN-FQ&t=148s)
Qadri describes three changes that make agent development easier. Reasoning models and test-time compute move some complexity from application frameworks into model inference. MCP provides one standardized interface for connecting language models to tools, data, and resources, replacing many platform-specific connectors. He also argues that agents can now be built from simple, well-defined patterns rather than monolithic frameworks. In this model, an agent is an orchestrator that connects a capable model to MCP tools and resources.

### Augmented LLMs are the base pattern for more complex agents
[06:09](https://www.youtube.com/watch?v=uFPAtKIN-FQ&t=369s)
Qadri starts with Anthropic's augmented LLM pattern. The model receives an input, calls tools or retrieves data when needed, runs through several iterations, and returns a response. More complex systems can connect one augmented LLM to another, such as an optimizer that generates a response and an evaluator that gives feedback until the result is good enough. Other patterns include fanning out work to several subagents and aggregating their results, or using an orchestrator that creates a plan, assigns tasks dynamically, and synthesizes the outputs.

### mcp-agent assumes that agents and services will be MCP-native
[08:24](https://www.youtube.com/watch?v=uFPAtKIN-FQ&t=504s)
Qadri built mcp-agent to implement the patterns in Anthropic's Building Effective Agents and to make MCP a central application boundary. He expects business applications such as Notion, Google Docs, Cursor, and Claude to become MCP clients, while services such as Linear and GitHub expose MCP servers. His framework treats agents as microservices that can also be deployed as MCP servers. This lets an agent be reused by different clients and composed with other MCP services.

### An agent exposed through MCP can coordinate other agents
[10:03](https://www.youtube.com/watch?v=uFPAtKIN-FQ&t=603s)
Today, Qadri says, agentic behavior usually happens inside an MCP client such as Claude or Cursor, which calls MCP servers. If an agent is exposed as an MCP server, the client can invoke it and use it in the same way as any other server. The agent can call ordinary MCP servers such as GitHub, Slack, or Linear, and it can invoke other agent servers. This creates a network in which one user command can activate several agents through the same protocol.

### Dedicated execution makes agents independent of the client session
[11:32](https://www.youtube.com/watch?v=uFPAtKIN-FQ&t=692s)
Qadri gives three practical effects of exposing agents as MCP servers. Agents can be composed into multi-agent systems over MCP. They can be built once and reused from any MCP-compatible client. Their workflows can run on dedicated infrastructure, separating the place where computation happens from the client used to start the task. He connects this separation to scalability, performance, and durability, while keeping the client as an interface for invocation and results.

### Agent work should be modeled as an asynchronous workflow
[12:13](https://www.youtube.com/watch?v=uFPAtKIN-FQ&t=733s)
An agent may pause for human feedback, fail and need a retry, or run from a webhook or scheduled job rather than a chat message. Qadri therefore models agents as asynchronous workflows. mcp-agent uses Temporal as the durable execution backend for agent computation and orchestration. This model also allows a workflow to continue after the original client disconnects, then provide its result when the client returns.

### The demo combines specialist agents under a planning orchestrator
[12:53](https://www.youtube.com/watch?v=uFPAtKIN-FQ&t=773s)
The demo asks an agent to load a student's short story from a Markdown file, grade it for proofreading, factual and logical consistency, and APA style, then write a graded report to another file. The system connects to fetch and filesystem MCP servers. It defines finder, writer, proofreader, fact-checker, style-enforcer, and orchestrator agents. The roughly 100-line workflow generates a plan, assigns each step, runs it through Temporal, and displays a workflow graph that can fail, retry, terminate, or await feedback.

### The same workflow can be invoked from Claude Desktop through MCP
[16:31](https://www.youtube.com/watch?v=uFPAtKIN-FQ&t=991s)
Qadri then exposes the grading agent as an MCP server and connects it to Claude Desktop. Claude submits the story, while the workflow runs in a separate execution environment. The client polls the workflow status and retrieves the report after completion. Because the workflow is asynchronous, Qadri can close the client and return later to check its status. The agent still works in a chatbot interface, but it is also available from any MCP-compatible application.

## Notable quotes
- "MCP servers can be a lot more than that. They could even be agents." (00:23)
- "Agents should be thought of as microservices and they can be deployed as MCP servers themselves." (09:02)
- "The right way to model all of this is as asynchronous workflows." (12:34)
- "I can run this agent anywhere that is MCP compatible." (17:42)

## Tools & references mentioned
- Last Mile AI
- Model Context Protocol
- MCP-agent
- Anthropic
- Building Effective Agents
- Language Server Protocol
- Microsoft
- Claude
- Claude Desktop
- Cursor
- Notion
- Google Docs
- Linear
- GitHub
- Slack
- Temporal
- Airflow

## Who should watch
- You are building an agent that currently works only inside one client and want to make it callable from Claude, Cursor, or another MCP client.
- Your workflow needs retries, scheduling, human approval, or execution that continues after a chat session closes.
- You are designing a multi-agent system and want its agents to call one another and ordinary tools through a shared protocol.

## Related talks

- [Building Agents (the hard parts!)](https://aietalks.com/talks/building-agents-the-hard-parts) (Rita Kozlov, Cloudflare, 21:12)
- [Bending a Public MCP Server Without Breaking It](https://aietalks.com/talks/bending-a-public-mcp-server-without-breaking-it) (Nimrod Hauser, Baz, 40:50)
- [MCP Is Not Good Yet](https://aietalks.com/talks/mcp-is-not-good-yet) (David Cramer, Sentry, 16:41)
- [A2A & MCP Workshop: Automating Business Processes with LLMs](https://aietalks.com/talks/a2a-mcp-workshop-automating-business-processes-with-llms) (Damien Murphy, Bench, 1:23:14)
- [Your MCP Server is Bad (and you should feel bad)](https://aietalks.com/talks/your-mcp-server-is-bad-and-you-should-feel-bad) (Jeremiah Lowin, Prefect, 54:33)
