Undo AI in Visual Studio Code

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

Configuring AI agents to use the Undo MCP server

Added in version 10.0.

Changed in version 10.2: The Undo: Configure Coding Agents command supersedes Undo: Configure MCP Server Auto-Configuration and can also configure Claude Code and Codex.

The Undo: Configure Coding Agents command adds the Undo MCP server to the AI agents it detects, or removes it from them. It lists:

  • The agent built into the editor: GitHub Copilot in Visual Studio Code or Cursor. The extension registers the server with the editor each time it starts.

  • The agents that undo init detects on the machine, currently Claude Code and Codex. The command changes their configuration files.

Prerequisites

  • Time Travel Debug for C/C++ extension version 3.1.0 or later.

  • UDB with AI features licensed, on your PATH. Run undo mcp --check to verify that AI features are enabled in your installation. To use a UDB that is not on your PATH, see Custom UDB path.

  • A capable model: newer, more capable models generally produce better results. See Choosing a model.

For the editor’s agent, you also need:

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

  • An account with MCP support enabled:

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

Running the command

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

  2. Run Undo: Configure Coding Agents.

  3. Choose an agent from the list. Each agent shows whether it is already configured and where the command changes its configuration.

  4. Choose Enable to add the Undo MCP server to the agent, or Disable to remove it.

List of AI agents shown by the Undo: Configure Coding Agents command

Restart any running Claude Code or Codex sessions so that they use the new configuration.

You can then ask the agent about an Undo recording, and it uses the server when needed. See Using AI effectively for how to frame questions.

Note

The command configures agents on the machine where the extension runs. If you use the Remote - SSH extension, that is the remote host, so run the command again for each new host.

Verifying the Undo MCP server registration

To confirm the server has been registered with the editor’s agent:

  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

To confirm the server has been registered with Claude Code or Codex, run /mcp in a session and look for a server named undo. If it is missing or not connected, see Troubleshooting in Using Undo from your AI agent.

Troubleshooting

Server not appearing in the editor’s tool list, or “UDB was not found”

Confirm that the editor’s agent is enabled in Undo: Configure Coding Agents 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 too old

The extension reports that a newer UDB is required when the udb it found is older than 10.2.0 or was not built with AI features. Update UDB to 10.2.0 or later, 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.

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 Undo: Set UDB MCP Launcher Path.

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

This path is stored per machine, so if you use the Remote - SSH extension, set it again on each new host.

AI in the debug terminal

Added in version 10.2.

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.1.0 or later.

  • UDB with AI features licensed.

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

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