Article illustration 1

When the Model Context Protocol (MCP) first emerged, its primary focus was providing contextual grounding for large language models. Today, it represents a paradigm shift in agent orchestration. Recent enhancements—resumable streams, elicitation, sampling, and notifications—have transformed MCP into a robust foundation for complex, long-running agent-to-agent systems. This evolution addresses a critical misconception: that MCP is confined to simple request-response patterns. In reality, developers can now build resilient, interactive agents that communicate seamlessly across disconnections, request human input mid-task, and leverage AI assistance dynamically.

The Four Pillars of Agentic MCP Tools

For an MCP tool to behave as a true autonomous agent, it requires four foundational capabilities:

  1. Streaming & Partial Results
    Agents provide real-time progress updates and partial outputs during execution, enabling observability and adaptive workflows. MCP supports this via progress notifications, with ongoing proposals (like #776) enhancing partial result streaming.
    Example: A research agent streams chapter summaries during a book-generation task, allowing the orchestrator to redirect efforts based on early content.

  2. Resumability
    Session continuity across network interruptions is critical. MCP's StreamableHTTP transport with event replay ensures tasks resume seamlessly after disconnections. Implementation requires an EventStore for replaying missed events.

  3. Durability
    Persistent state survives server restarts. Tools return Resource Links that clients poll or subscribe to for results. While effective, scaling challenges are being addressed via proposals like #992 for webhook-based notifications.

  4. Multi-Turn Interactions
    Agents dynamically request input mid-execution using elicitation (human input) or sampling (AI-generated completions). This enables complex workflows like travel booking confirmations or AI-assisted research synthesis.

Implementing Long-Running Agents: A Python Blueprint

We built a demonstration server (GitHub Repository) featuring two agentic tools:
- Travel Agent: Simulates bookings with price confirmations via elicitation
- Research Agent: Performs tasks with AI-assisted summaries via sampling

Key implementation patterns:

Streaming Progress Updates

# Server-side: Travel agent streams step updates
for i, step in enumerate(steps):
    await ctx.session.send_progress_notification(
        progress_token=ctx.request_id,
        progress=i * 25,
        total=100,
        message=step
    )
    await anyio.sleep(2)  # Simulate work

Elicitation & Sampling

# Elicitation: Request user confirmation mid-task
elicit_result = await ctx.session.elicit(
  message=f"Confirm price: $1200 for {destination}",
  requestedSchema=PriceConfirmationSchema
)

# Sampling: Request AI summary during research
sampling_result = await ctx.session.create_message(
  messages=[SamplingMessage(role="user", content="Summarize findings")]
)

Resumable Sessions
Uses an EventStore to replay events after disconnections:

class SimpleEventStore(EventStore):
    async def replay_events_after(self, last_event_id, callback):
        # Replay missed events for session continuity
        ...

Scaling to Multi-Agent Ecosystems

Our implementation already demonstrates core agent-to-agent communication: host applications act as orchestrator agents invoking specialist agents (tools) via MCP. Scaling further requires:
- Intelligent task decomposition across specialized agents
- Multi-server coordination with centralized state management
- Resilience patterns for failures and retries
- Result synthesis from distributed agents

MCP’s protocol-level primitives—durable resources, interactive elicitation/sampling, and resumable streams—provide the scaffolding for these advanced architectures without sacrificing simplicity. As proposals like transport-agnostic resumption (#975) and enhanced partial results (#383) mature, MCP will further solidify its role as the connective tissue for next-generation agent ecosystems.

Source: Adapted from Microsoft DevBlogs' technical deep dive on MCP agent capabilities. Full code and specifications available at ModelContextProtocol.io.