MCP HubMCP Hub
jasonjmcghee

claude-debugs-for-you

by: jasonjmcghee

Enable any LLM (e.g. Claude) to interactively debug any language for you via MCP and a VS Code Extension

282created 17/01/2025
Visit
LLM
debugging

📌Overview

Purpose: To enable interactive debugging of code through Claude or other language models (LLMs) within the VS Code environment.

Overview: Claude Debugs For You is a language-agnostic MCP Server and VS Code extension designed to allow LLMs, notably Claude, to assist in debugging code interactively. This tool enhances the user’s debugging experience by leveraging capabilities of models to evaluate expressions and suggest fixes in real-time within the familiar setting of VS Code.

Key Features:

  • Interactive Debugging: Allows users to direct LLMs to debug their code step by step, evaluating expressions and understanding issues as they arise.

  • Language Agnostic Support: The extension operates seamlessly across multiple programming languages, requiring only valid debugger console support and a well-structured launch.json configuration in VS Code.


Claude Debugs For You

Badge

aka Vibe Debugging

Enable Claude (or any other LLM) to interactively debug your code

This is an MCP Server and VS Code extension which enables Claude to interactively debug and evaluate expressions.

It should also work with other models or clients, but is demonstrated here with Claude Desktop and Continue.

It's language-agnostic, assuming debugger console support and a valid launch.json for debugging in VSCode.

Getting Started

  1. Download the extension from releases or VS Code Marketplace.
  2. Install the extension:
    • If using .vsix directly, go to the three dots in "Extensions" in VS Code and choose "Install from VSIX..."
  3. A new status menu item "Claude Debugs For You" will appear indicating whether it is running properly.

You can click this status menu for available commands.

Setup Options

If using stdio (classic, required for Claude Desktop)

  1. Copy the stdio server path by searching VS Code commands for "Copy MCP Debug Server stdio path to clipboard".
  2. Paste the following (update the path accordingly) in your claude_desktop_config.json:
{
  "mcpServers": {
    "debug": {
      "command": "node",
      "args": [
        "/path/to/mcp-debug.js"
      ]
    }
  }
}
  1. Start Claude desktop (or other MCP client).
    • You may need to restart it if it was already running.
    • Skip this step if using Continue, Cursor, or other clients built into VS Code.

If using /sse (e.g. Cursor)

  1. Retrieve the MCP server SSE address by using the "Copy MCP Debug Server sse address to clipboard" command.
    • Or use a server URL like http://localhost:4711/sse, or whatever port you set in settings.
  2. Add this address in your client as needed.
    • You may need to refresh depending on client (required in Cursor).
  3. Start MCP client.
    • You may need to restart it if it was already running.
    • Skip this step if using Continue, Cursor, or other clients built into VS Code.

You're ready to debug!

VS Code Debugging Documentation

Open a project containing a .vscode/launch.json with the first configuration setup to debug a specific file with ${file}.

See Run an Example below, or watch a demo video.

Demo

Using Continue

Continue figures out the problem, then suggests a fix, which you can apply with a click.

How do I set this up with Continue? / Show MCP Configuration

Read the docs: https://docs.continue.dev/customize/tools

Example configuration:

{
  ...
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "node",
          "args": [
            "/Users/jason/Library/Application Support/Code/User/globalStorage/jasonmcghee.claude-debugs-for-you/mcp-debug.js"
          ]
        }
      }
    ]
  }
}

You'll also need to choose a model capable of using tools.

When the list of tools pops up, make sure to click "debug" and set it to "Automatic".

Troubleshooting

If you see MCP errors in Continue, try disabling and re-enabling the Continue plugin.

Using Claude Desktop

You can configure it to be very cautious (make no assumptions) or more flexible depending on your needs.

Developing

  • Clone or open this repo with VS Code.
  • Run npm run install and npm run compile.
  • Hit "run" which will open a new VSCode window.
  • Setup and usage are the same as in "Getting Started".
  • To rebuild, run npm run compile.

Packaging

vsce package

Run an Example

Open examples/python in a VS Code window.

Enter the prompt:

I am building `longest_substring_with_k_distinct` and for some reason it's not working quite right. Can you debug it step by step using breakpoints and evaluating expressions to figure out where it goes wrong? Make sure to use the debug tool to get access and debug! Don't make any guesses as to the problem up front. DEBUG!

Other Notes

When you start multiple VS Code windows, a pop-up will allow you to gracefully hand-off "Claude Debugs For You" between windows.

You can also disable autostart. Then you'll just need to click the status menu and select "Start Server".

Roadmap Ideas

  • Use ripgrep to find requested files instead of listing files and getting content.
  • Add support for conditional breakpoints.
  • Add a "fix" tool by allowing MCP to insert a CodeLens or auto-fix suggestion for user approval.
  • Your idea here!