Documentation for Loop loops
Documentation

The loop is the product. Your agent is the runtime.

Describe what should happen. We write the stage prompts and serve them over MCP. Your agent does the work with its own tools.

Connect your agent

Remote MCP endpoint

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "loop": {
      "type": "remote",
      "url": "https://hardwaremcp.com/mcp/",
      "oauth": false,
      "headers": {
        "Authorization": "Bearer YOUR_LOOP_TOKEN"
      }
    }
  }
}

Paste into your opencode config, then call get_loop, next_stage, and report_stage until the loop is done.

The product

What a loop is

A loop is a repeatable workflow: a title, an ordered list of stages, and a way to run it. Each stage has a prompt (what the agent does), tools it may use, and a done condition (what proves the stage is finished).

Loop writes those stages from a one-sentence goal, lets you edit them, and serves them over one MCP endpoint. Your agent calls get_loop, next_stage, and report_stage to run one stage at a time. No tool credentials ever reach us.

Flow

How a loop is built

  1. Describe. One or two sentences about the outcome and how often it should run.
  2. Generate. The model infers the stages and writes the prompt engineering for each one.
  3. Edit. Change the prompt, the tool list, or the finish condition. Add or remove stages.
  4. Connect. Copy the generated MCP config into opencode, Claude, Cursor, or another client.
  5. Run. The agent calls next_stage, executes the stage, and calls report_stage.
  6. Inspect. The loop page shows progress, stage results, and an append only activity log.

Anatomy

What is in a stage

  • Name. A short label such as Inspect, Plan, Build, or Report.
  • Prompt. The complete instruction the agent receives. It says what to inspect, what to do, the quality bar, and what to hand to the next stage.
  • Tools. Capability labels such as code, browser, shell, github, deploy, email, or payments. They describe what the stage needs. Your agent maps them to the tools it already has.
  • Done when. One observable condition. Vague stages are the main reason loops drift.

Every field is editable before the first connection and after a run is stopped.

Modes

Once or forever

Once is a finite project. The server returns each stage once, then marks the loop complete after the last stage.

Forever is an operating loop. After the last stage the server resets the stages and starts the next pass. You can set a maximum number of passes. A soft budget is included in the spec for the agent to check before spending money.

A failed stage stays current, so the agent can retry it. A stop call or the dashboard stop button ends the run.

Protocol

Four MCP tools

  • get_loop returns the full spec and progress. Call it once at the start.
  • next_stage returns the current stage prompt and done condition.
  • report_stage records done or failed, saves a short result, and returns the next stage.
  • stop_loop ends the run and records the reason.

The server speaks Streamable HTTP with JSON responses. It is stateless between calls and authenticates each request with a per loop bearer token.

Security

What we store, and what we do not

  • We store: your email, the loop goal, the generated stages, progress, and a random token per loop.
  • We do not store: GitHub, hosting, payments, email, or browser credentials. Your agent uses its own.
  • Tokens: a token grants access to one loop only. Rotate it any time from the loop page.
  • Secrets: the editor rejects text that looks like an API key or bearer token.
  • Logs: activity rows are append only. Stage results are capped and shown only to the owner.

Guardrails

Keep forever loops boring

  • Max passes. Forever mode can stop automatically after a fixed number of passes.
  • Soft budget. Put a dollar limit in the loop. The agent is instructed to check it before spending.
  • Stop conditions. Add a stage that inspects cost, errors, or risk, and stop when the condition trips.
  • Kill switch. stop_loop and the dashboard stop button end the run immediately.
  • Least access. Give your agent only the tools the loop actually needs.

Questions, answered

Does Loop run my loop for me?

No. Your agent runs it. We host the loop spec and progress, and serve it over MCP. That keeps your credentials in your environment and keeps the runtime yours.

Which clients work?

Any client that supports remote MCP servers over Streamable HTTP with custom headers. The first tested client is opencode. Claude and Cursor use the same connection shape with a different config file.

How does the agent know when a stage is done?

Each stage has a done condition. The agent reports done or failed with a short result. A failed stage stays current so it can retry. A done stage advances the loop.

Can I edit a running loop?

Stop it first. Editing a running loop would change the instructions under an agent that already holds them. Stopped loops can be edited and restarted with the same token, or you can rotate the token.

What happens if the agent goes silent?

The loop stays where it is. The last connection time and the activity log tell you when the agent last called. Nothing advances without an MCP call from the agent.

Chat a goal and get an MCP loop
Start

Chat a goal. Get a loop.

Describe the outcome. Edit the stages. Connect your agent.

Create an account →