# Editor and MCP

Find the heading that matches what you see.

## `doctor` reports a failure but your setup is fine

### Cause

`doctor` exits 1 in two situations that are not faults:

- If VS Code is installed, `doctor` looks for `.vscode/mcp.json` in the directory you ran it from.
  In any directory that is not a VS Code project you set up, that check fails and `doctor` exits 1
  even though your setup is fine.
- It also reports a failure when it finds no supported editors at all, which is the expected state
  if you use the CLI for collectors and never wire up an editor.

### Fix

Read the individual lines rather than the exit code.

## An editor stopped connecting after `setup-ide`

### Cause

Most `setup-ide` runs issue a new key and revoke the old one, as
[Run `setup-ide` with no flags](/docs/integrations/editor/#wire-up-your-editor) explains.  If a
run narrows what gets written, your other editors keep a revoked key.  They
stop connecting, and `doctor` still reports them `[ OK ]`, because it checks that the config entry
exists but does not test the key inside it.

### Fix

Run plain `dbgorilla setup-ide`.  It issues a new key and writes it to every editor it finds in one
pass, so they all use the same key.  The danger is only in the flags that narrow which editors get
written.

:::tip[When a new key is the right answer]

If you have lost the key entirely, or want to invalidate one that leaked, run plain
`dbgorilla setup-ide` too.
:::

### Check the fix worked

`doctor` cannot show this.  Ask each editor to list its MCP tools, as in
[The MCP server returns a 401](#the-mcp-server-returns-a-401).

## The MCP server returns a 401

A client reports the server as failed to start, or returns a 401.

### Cause

A 401 means the endpoint rejected the credential: the key may be wrong, replaced by a later
`setup-ide` run, or sent to the wrong URL.

### Fix

Check the key and the URL before assuming it was rotated.

### Check the fix worked

Ask the client to list its MCP tools.  A working connection exposes DBGorilla's tools by name; a
broken one usually reports the server as failed to start, or returns a 401.
`dbgorilla doctor` covers the clients it manages.  For a hand-wired client, use this check instead.