Exposing Agents as MCP servers with mcp-agent: Sarmad Qadri

By AI Engineer

AITechnologyStartup
Share:

Key Concepts

  • Model Context Protocol (MCP)
  • Agent Tech Stack 2025
  • Agents as MCP Servers
  • Asynchronous Workflows for Agents
  • Composable Agents
  • Platform Agnostic Agents
  • Scalable Agents
  • Augmented LLM
  • Orchestrator Agent Pattern
  • Workflow Orchestration (Temporal)

Agent Tech Stack in 2025

  • Better Models: Reasoning models and LLMs are more reliable, shifting complexity from the framework layer to the inference layer. Test-time compute enables this shift.
  • Model Context Protocol (MCP): A standardized interface for connecting LLMs to tools, data, and resources. It provides a single interface, unlike the fragmented data connectors of the past. Major companies like Google, OpenAI, and Microsoft are adopting it.
  • Simpler Architectures: Agents are now orchestrators of better models and MCP, eliminating the need for monolithic AI frameworks. Simple agent patterns can be implemented with standard protocols and good LLMs.

Model Context Protocol (MCP) Explained

  • MCP is a standardized interface for connecting LLMs to external resources.
  • It aims to solve the problem of fragmented data connectors by providing a single, unified way for LLMs to access tools, data, and other services.
  • The speaker believes MCP will become the de facto standard for LLM integration.

Agent Patterns

Based on Anthropic's "Building Effective Agents" blog post, the speaker highlights several agent patterns:

  • Augmented LLM: A basic building block where an LLM has access to tools and data and operates in a loop, calling tools and retrieving data to complete a task.
  • Optimizer/Evaluator: An augmented LLM generates a response, and another augmented LLM evaluates its quality, providing feedback for improvement over multiple iterations.
  • Fan-out/Fan-in: Distributes tasks to multiple sub-agents and then aggregates the results.
  • Orchestrator: An LLM generates a plan and dynamically assigns tasks to sub-agents, synthesizing the results before responding to the user. This pattern involves a planner that reasons and decides what to do next.

MCP Agent Library

  • The speaker created an agent library called MCP Agent, available on GitHub, during his Christmas break.
  • It implements the agent patterns from Anthropic's blog post and is designed to be MCP-native.
  • Key assumptions:
    • MCP will be ubiquitous, with line-of-business applications and services having MCP-compatible clients and servers.
    • Agents should be microservices deployed as MCP servers.
    • Agents are asynchronous workflows and should be modeled as such.

Agents as MCP Servers

  • Exposing agents as MCP servers allows MCP clients to invoke and coordinate them.
  • It enables multi-agent communication over MCP, where agents can invoke other agents.
  • Benefits:
    • Composable Agents: Complex multi-agent systems can operate over the standard MCP protocol.
    • Platform Agnostic Agents: Agents can be built once and reused anywhere that is MCP compatible.
    • Scalable Agents: Agent workflows can run on dedicated infrastructure, separating compute from the client.

Agents as Asynchronous Workflows

  • Agents can be paused, resumed, retried, and may require human feedback.
  • They can be triggered by various events, not just chat applications (e.g., webhooks, cron jobs).
  • MCP Agent uses Temporal as a durable execution backend for workflow orchestration.

Demo: Grading a Student's Short Story

  • The speaker demonstrates an agent that grades a student's short story based on proofreading, factual and logical consistency, and style adherence (APA style guide).
  • The agent connects to a fetch MCP server (for accessing URLs) and a file system MCP server.
  • The agent consists of several sub-agents: finder, writer, proofreader, fact checker, style enforcer, and an orchestrator.
  • The orchestrator generates a plan and orchestrates the sub-agents to complete the task.
  • The workflow is implemented in about 100 lines of code.
  • The demo shows the agent running using Temporal, generating a graded report in a markdown file.
  • The speaker also demonstrates exposing the agent as an MCP server and connecting it to a cloud desktop client.
  • The client can invoke the agent, which runs asynchronously, and retrieve the results later.

Conclusion

The speaker argues that MCP is revolutionizing agent development by providing a standardized interface for connecting LLMs to external resources. He advocates for building agents as microservices and modeling them as asynchronous workflows. The MCP Agent library and the demo illustrate the potential of this approach for creating composable, platform-agnostic, and scalable agents. The key takeaway is that MCP simplifies agent design and enables more robust and flexible agent architectures.

Chat with this Video

AI-Powered

Hi! I can answer questions about this video "Exposing Agents as MCP servers with mcp-agent: Sarmad Qadri". What would you like to know?

Chat is based on the transcript of this video and may not be 100% accurate.

Related Videos

Ready to summarize another video?

Summarize YouTube Video