Recipes

Agents as MCP servers: exposing mcp-agent workflows as callable MCP tools

Suggested by runchr · today

Software & DevOpsWork & Operations

Draft — a suggested stack, not yet verified by a member.

Turn agent workflows into MCP servers any client can invoke and poll.

What they did

The lastmile-ai team shipped an update to mcp-agent, their lightweight framework that implements the agent patterns from Anthropic's Building Effective Agents post and handles MCP server/client management. Previously agentic behavior lived only on the MCP client side: clients like Claude or Cursor called MCP servers to solve tasks. This update flips that, letting agents themselves be MCP servers so any MCP-compatible client can invoke, coordinate, and orchestrate them like any other server. They implemented it through Workflows: each workflow is an agent application that can itself talk to other MCP servers (their example: summarizing GitHub issues into a Slack message). mcp-agent exposes each workflow as a set of MCP tools on an MCP Agent Server — workflows/list, workflows/{WorkflowName}/run (async), get_status, resume (for paused workflows awaiting human input), and cancel. They also wired in Temporal for durable execution so workflows can be paused, resumed, and retried in production. A demo shows Claude invoking an MCP agent server, running workflows when appropriate, and polling for status, giving agentic behavior on both the client and server side.

How it went

A working framework update with a public repo, example agent-server and Temporal directories, and a recorded demo of Claude driving a workflow end to end. It is positioned as a paradigm shift enabling agent composition over one protocol, platform independence across MCP clients, running workflows on dedicated infrastructure, and reuse of custom workflows. Polish is high for a Show HN launch, though the post is a launch announcement rather than a benchmarked evaluation.

Worth knowing

The post is promotional and gives no performance numbers, latency figures, or failure-mode discussion. Async run plus polling means clients must handle status checks themselves. Resume depends on human input plumbing and on Temporal being set up for durable execution. The GitHub-to-Slack example is illustrative; the post does not detail auth, secrets, or multi-tenant isolation for a shared agent server.

Wiring

Install mcp-agent and configure an LLM provider key. Define a Workflow subclass whose run method uses MCP servers as tools; the GitHub MCP server is attached as an MCP server dependency for issue fetching. Start the MCP Agent Server from examples/mcp_agent_server/asyncio, which registers the workflow and auto-generates the workflows/list, run, get_status, resume, and cancel tools. Point an MCP client such as Claude Desktop or Cursor at that server, then call run and poll get_status until completion. For durable execution, follow examples/temporal to run the same workflow under a Temporal worker so pause, resume, and retry survive restarts.

Try it yourself

Clone lastmile-ai/mcp-agent and read the examples/mcp_agent_server/asyncio directory. Build a small workflow that takes a GitHub issue URL, fetches the issue via the GitHub MCP server, summarizes it, and returns a short report. Expose it on an MCP Agent Server so a client can call workflows/list, workflows/SummarizeIssue/run, and workflows/SummarizeIssue/get_status. Then add a pause point that waits for human approval before posting, and show how resume and cancel work. Finally, sketch how you would swap the in-process runner for the Temporal example for durable execution.

Source

Tools in this stack

Run this stack

Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.

npx runchr install runchr/show-hn-representing-agents-as-mcp-servers
No CLI?curl -s https://api.runchr.com/api/recipes/runchr/show-hn-representing-agents-as-mcp-servers/manifest
System prompt
You are a coding agent that builds and exposes mcp-agent Workflows as MCP Agent Servers, so any MCP client can invoke and poll them. Use the listed tools to read code and issues, and keep to the workflow tool surface (workflows/list, run, get_status, resume, cancel) rather than inventing new endpoints.

This system prompt was generated from this stack's copy and tools. A person has not reviewed it.

The manifest is also at api.runchr.com/api/recipes/runchr/show-hn-representing-agents-as-mcp-servers/manifest.