Who Owns the Agent Loop? Harness vs Framework vs MCP Explained

Many teams building LLM‑powered agents get tangled when they hear the words harness, framework, and MCP used interchangeably. The confusion leads to wasted time picking the wrong tool, reinventing loops, or missing critical safety controls. The core issue is not knowing which layer owns the execution loop, state, tool transport, permissions, and recovery.

Here’s a straight‑forward way to decide: ask the single ownership question – which layer defines and enforces each responsibility?

  • Execution loop – an agent harness ships a fixed, product‑grade loop you cannot rewrite. A framework only gives you a loop skeleton; you fill in termination, handoffs, and turn caps. MCP has no loop at all.
  • Agent state and memory – the harness owns sessions, checkpointing, and compaction. Frameworks expose checkpointers and session stores but leave persistence policy to you. MCP’s core is stateless; any cross‑call state must be handled by the agent.
  • Tool transport – both harness and framework consume tools via an MCP client. MCP itself owns the transport: JSON‑RPC 2.0 over stdio or Streamable HTTP, with mandatory headers and cacheable tool lists.
  • Permissions and approvals – the harness owns the permission model (modes, hooks, sandbox). Frameworks expose guardrails or interrupt primitives but you write the approval logic and UI. MCP only carries the request; enforcement stays with the host.
  • Recovery – harnesses provide session resume, checkpoint rewind, and context compaction. Frameworks offer durable execution primitives that you must make safe (idempotent nodes, checkpointers). MCP’s Tasks extension covers long‑running tool calls only, not agent‑level recovery.

Practical guidance:

  1. If you need a ready‑made loop with built‑in sandboxing, permissions, and recovery, start with a harness (e.g., Claude Agent SDK, Codex app‑server).
  2. If you want to compose custom workflows, choose a framework (LangGraph, OpenAI Agents SDK, Microsoft Agent Framework) and add your own persistence, sandbox, and approval layers.
  3. Regardless of choice, always use MCP for tool communication – it is the shared substrate that every harness and framework already speaks.

By matching each responsibility to the layer that truly owns it, you avoid duplication, reduce bugs, and ship agents faster.

AI #ProductDevelopment #AgentArchitecture #MCP #LangGraph #OpenAIAgents