Gemini CLI
Add the DebugAI tools to Gemini CLI with one command.
Gemini CLI 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.
Run setup
npx -y @debugai/mcp setupIt 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, Gemini CLI included, and finishes by running doctor to check the result.
To change Gemini CLI's config and nothing else:
npx -y @debugai/mcp login
npx -y @debugai/mcp install --client=gemini-cliAdd --dry-run to the install line to print the change without writing anything.
Restart the session
Quit the Gemini CLI session you have open and start a new one.
Check it works
Run npx -y @debugai/mcp doctor. Under MCP clients you want this line:
✓ Gemini CLI — debugai configuredThen hand Gemini 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
Gemini 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 Gemini CLI connects, the server tells it what the tools are for. A rule in whatever instructions file your agent reads makes the habit dependable:
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 ~/.gemini/settings.json. On Windows, ~ is your user folder, C:\Users\<you>.
{
"mcpServers": {
"debugai": {
"command": "npx",
"args": ["-y", "@debugai/mcp@latest"]
}
}
}- Your key is never written into this file. It lives in
~/.debugai/config.jsonwith0600permissions, and every MCP client on the machine reads it from there. - Before changing the file,
installsaves a copy beside it, namedsettings.json.debugai-backup-<timestamp>. Every other setting in the file is kept. - If the file has comments, the rewrite drops them, and
installwarns you when it does. The backup keeps them. npx -y @debugai/mcp uninstalltakes the entry out of every client config again.
Next
- Work with your agent: the lookup, debug and report loop, and how to point an answer at the right project.
- MCP server troubleshooting:
doctoroutput, sign-in from inside a chat, and the errors an agent can get back.