CodeLoop

Cursor Setup

This guide covers setting up CodeLoop specifically for Cursor. Make sure you have your API key ready (see API Keys).

Automatic Setup (Recommended)

The fastest way to configure CodeLoop for Cursor:

cd your-project
npx codeloop init

This command auto-detects Cursor and creates the necessary config files.

Manual MCP Configuration

If you prefer manual setup, create .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "codeloop": {
      "command": "npx",
      "args": ["-y", "@codeloop/mcp-server"],
      "env": {
        "CODELOOP_API_KEY": "cl_live_your_key_here"
      }
    }
  }
}

Rule Files

CodeLoop creates rule files in .cursor/rules/ that guide the AI agent to use CodeLoop tools at the right moments:

core.mdc

Defines the core verification workflow: after any implementation step, always call codeloop_verify. If verification fails, callcodeloop_diagnose and fix the issues before moving on.

loop.mdc

Manages the verify-diagnose-fix loop. Tells the agent to continue iterating until the gate check passes with sufficient confidence.

recommendations.mdc

Guides the agent to use codeloop_release_readiness before marking work as complete, ensuring quality gates are met.

Expected Result

After setup, you should see these tools in Cursor's tool list:

ToolPurpose
codeloop_verifyRun build, lint, tests, screenshots
codeloop_diagnoseCategorize and prioritize failures
codeloop_gate_checkConfidence-scored quality gate
codeloop_section_statusMulti-section progress tracking
codeloop_visual_reviewScreenshot-based UI review
codeloop_design_compareCompare coded UI vs design specs
codeloop_release_readinessFinal release quality check

Troubleshooting

Tools don't appear in Cursor

  • Verify .cursor/mcp.json exists and is valid JSON
  • Check that CODELOOP_API_KEY is set in your environment
  • Restart Cursor after creating the config file
  • Check Cursor's MCP panel for connection errors

MCP server won't start

  • Ensure Node.js 18+ is installed: node --version
  • Try running manually: npx -y @codeloop/mcp-server
  • Check if another MCP server is using the same port

API key validation fails

  • Verify your key is correct: echo $CODELOOP_API_KEY
  • Check if your trial has expired at the dashboard
  • Ensure you have internet connectivity (first validation requires network)

Next Steps