Installing and registering the MCP server

The MCP server is DelphiDebuggerMcp.exe. Registering it means telling your agent where that executable is; the agent starts it and talks to it over stdio. Registration is per user, not per project. How much of it you do yourself depends on how you installed the debugger.

With the Marketplace extension

The extension from the VS Code Marketplace bundles DelphiDebuggerMcp.exe.

  • Agents hosted by VS Code (VS Code 1.101 or later) see it as delphi-debugger through the editor’s own MCP registry. No mcp.json to edit, and it updates with the extension.
  • Agents outside VS Code need a path that does not change with every extension update, so the extension keeps a copy at a stable location, %LOCALAPPDATA%\DelphiWin64Debugger\DelphiDebuggerMcp.exe, and refreshes it whenever the bundled exe is newer.

Claude Code is registered for you

Since 0.7.3, the first time VS Code starts after the extension is installed or reinstalled, the extension registers the stable copy with Claude Code without asking, at user scope, and shows one notification — provided the claude CLI is on PATH and nothing is registered as delphi-debugger yet:

claude mcp add delphi-debugger -s user -- "%LOCALAPPDATA%\DelphiWin64Debugger\DelphiDebuggerMcp.exe"

A delphi-debugger registration that points at another executable, such as a development build, is never touched. The check runs once per install, so a registration you remove by hand stays removed until the next install. Restart Claude Code to pick the server up.

Updates need nothing. Since 0.7.3 the extension activates at VS Code startup and refreshes the stable copy then (0.7.2 waited for the first Delphi debug session); the registration keeps working because the path does not change. A Claude Code session that is already running keeps the old server until it is restarted.

Uninstalling the extension removes the Claude Code registration and the stable copy (since 0.7.3), through the extension’s uninstall hook. VS Code runs that hook only when it deletes the extension from disk, at a restart after the uninstall — after a command-line uninstall, the second start — and it removes nothing while another VS Code-family editor still has the extension. Registrations pointing elsewhere are kept.

Registering by hand

The command Delphi: Register MCP Server with Claude Code, in the Command Palette (Ctrl+Shift+P), runs the same claude mcp add on the stable copy, replacing whatever delphi-debugger pointed at, after removing a registration under the legacy name delphi-win64-debugger. It is the way on 0.7.2, and the way to restore a registration you removed. It needs the claude CLI on PATH; without it, the command registers nothing and shows the line to run by hand instead. Restart Claude Code afterwards.

With the setup zip

Setup.exe offers to register the MCP server at the end of an install. Say yes and there is nothing else to do: it copies the server to the same stable folder, %LOCALAPPDATA%\DelphiWin64Debugger\, and registers it with Claude Code through register-mcp.ps1, described below. This is the route for a machine without VS Code, for Claude Desktop and for offline installs — Getting started covers the install itself.

  • Since 0.7.3 it no longer writes VS Code’s user mcp.json: the extension registers the server with VS Code itself, and an mcp.json entry beside it listed the server twice.
  • When an editor keeps its own copy of the extension — one from the Marketplace, or a newer one — Setup.exe skips the MCP step: that copy looks after the stable folder and the Claude Code registration.
  • Setup.exe 0.7.0 to 0.7.2 skipped this registration even when you said yes, because it looked for the script in the wrong folder; it is fixed in 0.7.3. After one of those versions, register by hand as below.
  • Setup.exe --uninstall (since 0.7.3) removes the extension from each editor and then, unless an editor still has it, the Claude Code registration and the stable folder.

Registering it yourself

To register a copy the installer did not, run the same script the installer uses. In the setup zip it sits next to Setup.exe; run it from the folder you extracted the zip into:

powershell -ExecutionPolicy Bypass -File register-mcp.ps1 ^
  "%LOCALAPPDATA%\DelphiWin64Debugger\DelphiDebuggerMcp.exe"

From a source checkout the script is scripts\register-mcp.ps1. Build the server first; -VsCode also points VS Code at the build output (see below):

cmd /c scripts\build_mcp.bat

powershell -ExecutionPolicy Bypass -File scripts\register-mcp.ps1 ^
  MCPDebugger\Win64\Debug\DelphiDebuggerMcp.exe -VsCode

The script takes the path to DelphiDebuggerMcp.exe as its argument, resolves it to an absolute path, and registers it under the name delphi-debugger; a registration under the earlier name delphi-win64-debugger is removed. It is idempotent — re-running it is safe and simply refreshes the registration.

To remove it:

powershell -ExecutionPolicy Bypass -File register-mcp.ps1 -Unregister ^
  "%LOCALAPPDATA%\DelphiWin64Debugger\DelphiDebuggerMcp.exe"

With a path, -Unregister removes only the registrations that point at that exe, so a development build registered under the same name is kept. Without a path it removes the names whatever they point at.

Restart Claude Code, or reload VS Code, for either change to take effect.

What the script actually registers

Two targets, handled differently because they configure MCP differently.

Claude Code

Registered through the claude CLI at user scope, which is the equivalent of running:

claude mcp add delphi-debugger -s user -- "C:\path\to\DelphiDebuggerMcp.exe"

after removing any previous registration, including one under the legacy name delphi-win64-debugger. If the claude CLI is not on PATH, the script skips this step and prints that command for you to run yourself rather than failing the whole registration.

VS Code and VS Code Insiders

Only with -VsCode, which is meant for a development build (scripts\install-dev.bat passes it): the script merges an entry into the user mcp.json, in the format VS Code 1.102 and later expects. No CLI is needed.

%APPDATA%\Code\User\mcp.json
%APPDATA%\Code - Insiders\User\mcp.json
{
  "servers": {
    "delphi-debugger": {
      "type": "stdio",
      "command": "C:\\path\\to\\DelphiDebuggerMcp.exe",
      "args": []
    }
  }
}

It merges rather than overwrites: other servers already in the file are left alone. An editor that is not installed is skipped, and if neither is found the script says so.

Without -VsCode the script only removes the mcp.json entries that point at the given exe — the duplicates earlier Setup.exe versions wrote. With the extension installed, VS Code 1.101 or later already sees the bundled server through its MCP registry, and an entry here would list it twice.

Any other MCP client is configured the same way — point it at DelphiDebuggerMcp.exe as a stdio server with no arguments. The server itself has no client-specific behaviour; only the configuration file format differs.

Checking it worked

Restart the agent and ask it to list running processes — that maps to list_debuggable_processes, needs no debug session, and either answers or makes it obvious the server is not connected. From there, Example prompts has eleven things worth trying, and Tool reference lists everything the server exposes.