DebugAIdocs

VS Code agent mode

With the DebugAI extension installed, VS Code's agent mode already has the DebugAI tools. Nothing else to install.

VS Code's agent mode can call MCP servers, and the DebugAI extension brings one with it. Once the extension is installed and signed in, it registers a server named DebugAI with the same three tools the npm package has: lookup_error, debug_error and report_outcome.

You need VS Code 1.101 or later. You do not need Node.js for this one: the server runs on VS Code's own runtime.

Install the extension and sign in

Follow steps 1 and 2 of the VS Code quickstart. The server uses the key the extension stored when you signed in.

If VS Code starts the server before you have signed in, it shows DebugAI needs an API key to start the MCP server. Press Set API Key and sign in from there.

Find DebugAI in the server list

Open the Command Palette (Ctrl Shift P, or Cmd Shift P on a Mac) and run MCP: List Servers. DebugAI is in the list.

Check it works

In agent mode, hand the 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 the folder you have open in VS Code.

How the bundled server differs

It is the same protocol surface as @debugai/mcp on npm. A few things follow from living inside the extension:

  • It answers for the first folder open in VS Code. The agent's errors are filed under the same project as the ones you debug from the editor, so the agent and the DebugAI panel share one memory for that folder. Open a different folder and the extension updates the server to match. With no folder open, it reads no local files.
  • projectRoot is for an error from somewhere else, a folder that is not the one open in VS Code. A filePath does not pick the project here, as it does on the npm server.
  • Sign-in happens in the extension, not inside the chat. When the key is rejected, the server tells the agent to have you run DebugAI: Set API Key from the Command Palette.
  • Its footer says so. Each answer's footer carries DebugAI MCP <version> (VS Code), so you can tell which server replied.

Without the extension

To give VS Code's agent the tools without installing the extension, add the npm server:

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

Then run MCP: List Servers from the Command Palette to confirm it is there. This path needs Node.js 18.14.1 or later.

setup skips VS Code on purpose. With the extension installed, doctor says so:

· VS Code (native MCP) — no entry here, which is right with the DebugAI extension installed

One or the other

With the extension installed, a second entry in mcp.json makes every DebugAI tool show up twice. To take it back out: npx -y @debugai/mcp install --client=vscode --remove.

The entry goes under servers in mcp.json, in VS Code's user folder:

~/Library/Application Support/Code/User/mcp.json
Code/User/mcp.json
{
  "servers": {
    "debugai": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@debugai/mcp@latest"]
    }
  }
}
  • Your key is never written into this file. It lives in ~/.debugai/config.json with 0600 permissions.
  • 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.

Next

On this page