LoopLoop

MCP Server

Zero-code IDE integration via the Model Context Protocol. Install in one command, get 9 agent tools.

MCP Server

Loop's MCP server gives AI agents direct access to Loop's issue tracking, dispatch queue, and signal ingestion through the Model Context Protocol. Install it in one command and get 9 tools that cover the full Loop workflow.

The MCP server is a thin wrapper around the Loop REST API. It requires a running Loop API instance and a valid LOOP_API_KEY. No additional infrastructure is needed.

Why MCP?

The Model Context Protocol lets AI agents discover and use tools without custom integration code. Instead of writing HTTP requests manually, agents call named tools like loop_get_next_task and loop_create_issue directly from their IDE or agent framework.

Loop's MCP server supports two transports:

  • Stdio -- for IDE integrations (Claude Code, Cursor, Windsurf, VS Code)
  • Streamable HTTP -- for embedding in your own Hono server

Quick Install

Add to your project's .mcp.json or global ~/.claude/mcp.json:

{
  "mcpServers": {
    "loop": {
      "command": "npx",
      "args": ["-y", "@dork-labs/loop-mcp"],
      "env": {
        "LOOP_API_KEY": "<your-api-key>",
        "LOOP_API_URL": "http://localhost:5667"
      }
    }
  }
}

Add to .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "loop": {
      "command": "npx",
      "args": ["-y", "@dork-labs/loop-mcp"],
      "env": {
        "LOOP_API_KEY": "<your-api-key>",
        "LOOP_API_URL": "http://localhost:5667"
      }
    }
  }
}

Add to .windsurf/mcp.json in your project root:

{
  "mcpServers": {
    "loop": {
      "command": "npx",
      "args": ["-y", "@dork-labs/loop-mcp"],
      "env": {
        "LOOP_API_KEY": "<your-api-key>",
        "LOOP_API_URL": "http://localhost:5667"
      }
    }
  }
}

Add to .vscode/mcp.json in your project root:

{
  "servers": {
    "loop": {
      "command": "npx",
      "args": ["-y", "@dork-labs/loop-mcp"],
      "env": {
        "LOOP_API_KEY": "<your-api-key>",
        "LOOP_API_URL": "http://localhost:5667"
      }
    }
  }
}

Run the MCP server directly via stdio:

LOOP_API_KEY=your-api-key LOOP_API_URL=http://localhost:5667 npx @dork-labs/loop-mcp

Replace <your-api-key> with your actual Loop API key. Generate one with pnpm run generate-key or node -e "console.log('loop_' + require('crypto').randomBytes(32).toString('hex'))".

Environment Variables

VariableRequiredDefaultDescription
LOOP_API_KEYYes--Bearer token for Loop API access
LOOP_API_URLNohttp://localhost:5667Base URL of the Loop API server

Available Tools

The MCP server registers 9 tools organized around the Loop workflow:

ToolDescriptionRead-only
loop_get_next_taskClaim the highest-priority unblocked issue with dispatch instructionsNo
loop_complete_taskMark an issue as done, record the outcome, find unblocked issuesNo
loop_create_issueCreate a new issue (signal, hypothesis, plan, task, or monitor)No
loop_update_issueUpdate an issue's status, priority, type, title, or descriptionNo
loop_list_issuesList issues with filters for status, type, and projectYes
loop_get_issueGet full issue details including labels, comments, and relationsYes
loop_ingest_signalSubmit a signal that creates a linked triage issueNo
loop_create_commentPost a comment on an issue as the agentNo
loop_get_dashboardGet system health metrics, issue counts, and queue statusYes

See the Tools Reference for complete parameter documentation and example responses.

Transports

Stdio (IDE Integration)

The default transport. The MCP server communicates over stdin/stdout, which is the standard for IDE integrations. This is what you get when you run npx @dork-labs/loop-mcp.

Streamable HTTP (Embedded)

For embedding the MCP server in your own Hono application:

import { Hono } from 'hono';
import { createMcpHandler } from '@dork-labs/loop-mcp/http';

const app = new Hono();

app.route('/mcp', createMcpHandler({
  apiKey: process.env.LOOP_API_KEY,
  apiUrl: process.env.LOOP_API_URL,
}));

export default app;

This mounts the MCP server at /mcp on your existing Hono app, allowing remote agents to connect over HTTP.

Programmatic Usage

You can also create the MCP server programmatically for custom transports or testing:

import { createLoopMcpServer } from '@dork-labs/loop-mcp';

const server = createLoopMcpServer({
  apiKey: 'loop_your_key_here',
  apiUrl: 'http://localhost:5667',
});

// Connect to any MCP transport
await server.connect(yourTransport);

Typical Agent Workflow

A standard agent session using the MCP server follows this pattern:

  1. Get next task -- call loop_get_next_task to claim the highest-priority issue
  2. Read the prompt -- the response includes hydrated instructions telling the agent what to do
  3. Execute the work -- the agent performs the task (write code, investigate, etc.)
  4. Report progress -- call loop_create_comment to post updates on the issue
  5. Complete the task -- call loop_complete_task to mark it done and record the outcome
  6. Repeat -- call loop_get_next_task again to get the next item

Next Steps