DebugAIdocs

Cursor

Give Cursor's agent the DebugAI tools with one command, alongside or instead of the editor extension.

Cursor's agent gets the three DebugAI tools: lookup_error, debug_error and report_outcome. You need Node.js 18.14.1 or later. node -v prints your version.

Two ways into Cursor

DebugAI reaches Cursor two ways, and you can have either or both:

  • The extension, installed from Open VSX, gives you the editor commands: DebugAI: Analyze Error in the editor, DebugAI: Analyze Terminal Error from a right-click in the terminal, indexing, and fixes you preview and apply as a diff. See Cursor, Windsurf, VSCodium.
  • The MCP server, on this page, is for Cursor's agent. Its tool descriptions tell the agent to call DebugAI the moment something it ran fails.

The extension does not write anything into Cursor's MCP config. The MCP server is added by the command below.

Run setup

npx -y @debugai/mcp setup

It signs you in through your browser with a short code (free account, 10 debugs a day, no card). Then it adds DebugAI to every MCP client it finds on this machine, Cursor included, and finishes by running doctor to check the result.

To change Cursor's config and nothing else:

npx -y @debugai/mcp login
npx -y @debugai/mcp install --client=cursor

Add --dry-run to the install line to print the change without writing anything.

Let Cursor pick it up

Nothing to restart. Cursor reads the new entry on its own. Open Settings, then MCP, and look for a green dot beside debugai.

Check it works

Run npx -y @debugai/mcp doctor. Under MCP clients you want this line:

✓ Cursor — debugai configured

Then hand Cursor's agent an error and ask for the lookup by name:

Use the debugai lookup_error tool on this error: TypeError: Cannot read properties of undefined (reading 'name')

lookup_error makes no model call and does not count against your daily limit, so this check is free.

You'll know it worked when

The agent calls lookup_error and gets back a line like Not seen before in this project (shop). Call debug_error with the full error for an analysis. The name in brackets is your project's folder.

Make the agent reach for it

When Cursor connects, the server tells the agent what the tools are for. A rule makes the habit dependable. Add this to .cursorrules in your project, or to whichever rules file your setup reads:

.cursorrules
When a command fails, call the debugai lookup_error tool first: it is
instant and free. If it has no confirmed fix, call debug_error before
attempting your own, and pass the command that reproduces the failure
as reproCommand. After applying a fix, call report_outcome so the
project's error memory stays accurate.

The config it writes

setup adds one entry to mcpServers in ~/.cursor/mcp.json. On Windows, ~ is your user folder, C:\Users\<you>.

~/.cursor/mcp.json
{
  "mcpServers": {
    "debugai": {
      "command": "npx",
      "args": ["-y", "@debugai/mcp@latest"]
    }
  }
}
  • Your key is never written into this file. It lives in ~/.debugai/config.json with 0600 permissions, and every MCP client on the machine reads it from there.
  • Before changing the file, install saves a copy beside it, named mcp.json.debugai-backup-<timestamp>. Every other setting in the file is kept.
  • If the file has comments, the rewrite drops them, and install warns you when it does. The backup keeps them.
  • npx -y @debugai/mcp uninstall takes the entry out of every client config again.

Next

On this page