Skip to main content
Glama
Debug MCP Server

Debug MCP Server

by dheerajiiitv

Debug MCP Server

License: MIT npm version PyPI version

Share debugging session variables with AI assistants (Cursor, Claude, etc.) via Model Context Protocol (MCP).

Features

  • Multi-language support: Python, Node.js/TypeScript (more coming)

  • Easy to use: Just share(variable) in your debug console

  • Extensible: Add support for any language via the standard API

  • Works everywhere: Cursor, Claude Desktop, any MCP-compatible client

Related MCP server: DebugMCP

Quick Start

1. Install the MCP Server

Add to your MCP client configuration:

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "debug": {
      "command": "npx",
      "args": ["@debug-mcp/server"]
    }
  }
}

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "debug": {
      "command": "npx",
      "args": ["@debug-mcp/server"]
    }
  }
}

2. Install the Language Helper

Python:

pip install debug-mcp

Node.js/TypeScript:

npm install -D @debug-mcp/helper-node

3. Share Variables in Debug Session

Python (in Debug Console):

from debug_mcp import share
share(my_variable)
share(response.data, "api_response")

Node.js (in Debug Console):

const { share } = require('@debug-mcp/helper-node');
share(myVariable);
share(myObject, 'customName');

4. Ask the AI

Now in Cursor or Claude, just ask:

  • "What's in the my_variable debug variable?"

  • "Evaluate len(response.data) in the Python debug session"

  • "Show me all shared variables"

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                       Your Debug Session                            │
│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐     │
│  │ Python :9753    │  │ Node.js :9754   │  │ Go :9755        │     │
│  │ share(var)      │  │ share(var)      │  │ share(var)      │     │
│  └────────┬────────┘  └────────┬────────┘  └────────┬────────┘     │
└───────────┼─────────────────────┼─────────────────────┼─────────────┘
            │ HTTP                │ HTTP                │ HTTP
            ▼                     ▼                     ▼
┌─────────────────────────────────────────────────────────────────────┐
│                    MCP Server (@debug-mcp/server)                   │
│  - Discovers language helpers automatically                        │
│  - Provides unified tools: get_variable, evaluate, list_sessions   │
│  - Communicates via MCP protocol (stdio)                           │
└─────────────────────────────────────────────────────────────────────┘
            │ MCP (stdio)
            ▼
┌─────────────────────────────────────────────────────────────────────┐
│                 AI Assistant (Cursor / Claude)                      │
│  "What's in my_variable?"                                           │
│  → Uses debug_get_variable("my_variable") tool                      │
│  → Gets serialized JSON response                                    │
└─────────────────────────────────────────────────────────────────────┘

Available MCP Tools

Tool

Description

debug_list_sessions

List all active debug sessions

debug_list_variables

List shared variables from a session

debug_get_variable

Get value of a specific variable

debug_evaluate

Evaluate an expression in debug context

debug_get_variable_info

Get type info and attributes

debug_get_locals

Get all local variables from debug frame

Language Helpers

Python (debug-mcp)

from debug_mcp import share, share_locals, list_shared

# Share a variable
share(my_variable)           # Auto-detect name
share(obj, "custom_name")    # Custom name

# Share all local variables
share_locals()

# List shared variables
list_shared()

# Quick aliases
from debug_mcp import s, sl, ls
s(my_var)   # = share()
sl()        # = share_locals()
ls()        # = list_shared()

Supported types: dict, list, tuple, set, dataclass, Pydantic models, Protobuf messages, NumPy arrays, Pandas DataFrames, any object with __dict__

Node.js/TypeScript (@debug-mcp/helper-node)

const { share, shareLocals, listShared } = require('@debug-mcp/helper-node');

// Share a variable
share(myVariable);
share(myObject, 'customName');

// Share local scope
shareLocals({ myVar, otherVar, config });

// List shared variables
listShared();

// Quick aliases
const { s, sl, ls } = require('@debug-mcp/helper-node');

Supported types: primitives, objects, arrays, Map, Set, Date, RegExp, Error, Buffer, class instances

Configuration

Environment Variables

Variable

Default

Description

DEBUG_MCP_PORT

9753 (Python), 9754 (Node)

Port for helper server

DEBUG_MCP_HOST

127.0.0.1

Host for helper server

Adding New Language Support

See docs/ADDING_LANGUAGE.md for a guide on implementing support for additional languages.

Development

# Clone the repo
git clone https://github.com/YOUR_USERNAME/debug-mcp-server.git
cd debug-mcp-server

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run the MCP server locally
node packages/mcp-server/dist/index.js

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to perform interactive Python debugging with breakpoints, step execution, and variable inspection using the Debug Adapter Protocol (DAP) through an MCP server interface.
      8
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to debug code inside VS Code by setting breakpoints, stepping through execution, inspecting variables, and evaluating expressions across multiple languages.
      588
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes VS Code's Debug Adapter Protocol as MCP tools, enabling AI coding agents to set breakpoints, step through code, inspect variables, and read exceptions in a real debug session.
      GPL 3.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to inspect active authenticated browser sessions and runtime state, capture user breadcrumbs and network/error telemetry, and generate Playwright/Cypress tests or MSW mock handlers through standard MCP tools.
      2
      MIT