Undo AI in Visual Studio Code¶
There are two ways to use Undo AI from Undo’s Time Travel Debug for C/C++ extension:
Auto-configure GitHub Copilot in Visual Studio Code or Cursor to use UDB as an MCP server, so the AI agent can analyze Undo recordings from the chat panel.
When debugging with the undo debug type, ask questions inline from the debug terminal with the ai command.
MCP auto-configuration for GitHub Copilot and Cursor¶
Added in version 10.0.
Prerequisites¶
A compatible editor: either Visual Studio Code 1.101.0 or later, or Cursor. Earlier Visual Studio Code versions do not support the MCP functionality required by this integration.
Time Travel Debug for C/C++ extension, installed and activated: version 2.1.12 or later for Visual Studio Code, or version 3.0.5 or later for Cursor.
An AI agent with MCP support:
In Visual Studio Code, a Copilot account with MCP servers enabled. In larger organizations, MCP server support is controlled by a GitHub administrator; see the GitHub Copilot documentation for details.
In Cursor, an account with MCP support enabled. In larger organizations, MCP support is controlled by a plan administrator; see the Cursor documentation for details.
A capable model — newer, more capable models will generally produce better results. See Choosing a model.
UDB 10.0.0 or later on your
PATH, with AI features licensed — the extension checks the version at connection time and shows a warning if the requirement is not met. Runundo mcp --checkto verify that AI features are enabled in your installation.
Enabling auto-configuration¶
Auto-configuration is disabled by default. To enable it:
Open the command palette (Ctrl+Shift+P).
Run UDB: Configure MCP Server Auto-Configuration.
Select Enable.
Once enabled, the extension registers the MCP server each time the editor starts, and re-checks whenever you change any of the relevant settings described below.
Note
This setting is stored per machine. If you connect to a new remote host via the Remote - SSH extension, you must enable auto-configuration on that machine too. The same applies to Cursor’s remote SSH support.
Verifying the MCP server registration¶
To confirm the server has been registered:
Open the AI chat panel.
Switch to Agent mode.
Open the list of registered MCP servers:
In Visual Studio Code, click the slider icon next to the chat model selector.
In Cursor, open the command palette (Ctrl+Shift+P) and run Open MCPs.
Look for a server named Undo or UDB, and make sure its tools are available.
MCP server configured in Visual Studio Code with tools enabled:
MCP server configured in Cursor with tools enabled:
Using the MCP server¶
The server uses Undo recordings to investigate a program’s recorded execution history. It does not start an interactive debugging session in the editor.
Open the AI chat panel (Copilot Chat in Visual Studio Code, or the built-in chat in Cursor) and switch to Agent mode.
Select a capable model (see Prerequisites above).
Ask a question referencing an Undo recording you want to investigate. The AI agent will use the server automatically when appropriate.
If the AI agent does not reach for the UDB tools, prompt it explicitly: “Use the UDB MCP server to investigate this recording.”
Troubleshooting¶
- Server not appearing in the tool list
Confirm that auto-configuration is enabled and that
udbis on thePATHthat the editor uses. On Linux, both Visual Studio Code and Cursor inherit the environment they were launched from, not your shell’sPATH. Open the integrated terminal and runecho $PATHto check.- “UDB version 10.0.0 or later is required”
The extension found
udbbut it is too old or was not built with AI features. Update UDB to 10.0.0 or later with AI support, or contact Undo Support.- “AI features are not enabled”
Your UDB version meets the version requirement, but AI features are not enabled in your license. Contact Undo Support to upgrade your license.
- Remote SSH — server not starting
Auto-configuration and the UDB path are stored per machine. If you have connected to a new remote host, you may need to enable auto-configuration and set the UDB path again on that machine.
Custom UDB path¶
If UDB is not on your PATH, or you want to pin a specific installation:
Open the command palette (Ctrl+Shift+P).
Run UDB: Set UDB MCP Launcher Path.
Use the file picker to choose the
udbexecutable.
Note
This path is stored per machine. If you connect to a new remote host via the Remote - SSH extension, you will need to set the path again on that machine.
AI in the debug terminal¶
When using the undo debug type, the ai
command is available from the debug terminal. Type ai followed by your question:
recording> ai why is x null here?
The agent’s output is streamed into the terminal. To interrupt a long-running query, click the cancel button on the progress notification that Visual Studio Code shows while the command is running.
See Using AI in UDB for the details of the command itself.
Prerequisites¶
Time Travel Debug for C/C++ extension version 3.0.6 or later.
A launch configuration using the
undodebug type. The ai command is not supported incppdbgdebug sessions; the extension prompts you to migrate your launch configuration if you try it there.A supported AI agent selected with the config ai agent command, which lists the agents that are supported.
Limitations¶
Multi-line questions are not supported. Write longer questions on a single line, or use a command-line UDB session if you want multi-line question formatting.
The config ai agent command can only be used from the debug terminal in a Visual Studio Code debugging session with UDB 10.2 or later. With earlier versions, select the AI agent in a command-line UDB session instead.
Neither Ctrl+C or the toolbar pause button interrupt the ai command in the Visual Studio Code debug terminal. Use the progress notification’s cancel button instead.