Undo AI in Visual Studio Code

There are two ways to use Undo AI from Undo’s Time Travel Debug for C/C++ extension:

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. Run undo mcp --check to verify that AI features are enabled in your installation.

Enabling auto-configuration

Auto-configuration is disabled by default. To enable it:

  1. Open the command palette (Ctrl+Shift+P).

  2. Run UDB: Configure MCP Server Auto-Configuration.

  3. Select Enable.

_images/mcp-configure-command.png

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:

  1. Open the AI chat panel.

  2. Switch to Agent mode.

  3. 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.

  4. 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 tool list in Visual Studio Code

MCP server configured in Cursor with tools enabled:

MCP tool list in Cursor

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.

  1. Open the AI chat panel (Copilot Chat in Visual Studio Code, or the built-in chat in Cursor) and switch to Agent mode.

  2. Select a capable model (see Prerequisites above).

  3. 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.”

_images/mcp-chat-session.png

Troubleshooting

Server not appearing in the tool list

Confirm that auto-configuration is enabled and that udb is on the PATH that the editor uses. On Linux, both Visual Studio Code and Cursor inherit the environment they were launched from, not your shell’s PATH. Open the integrated terminal and run echo $PATH to check.

“UDB version 10.0.0 or later is required”

The extension found udb but 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:

  1. Open the command palette (Ctrl+Shift+P).

  2. Run UDB: Set UDB MCP Launcher Path.

  3. Use the file picker to choose the udb executable.

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 undo debug type. The ai command is not supported in cppdbg debug 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.