Skip to main content
Glama

delve-mcp

MCP server for Delve debugger integration

This is a TypeScript-based MCP server that provides a complete interface to the Delve debugger for Go programs. It implements all major Delve commands and capabilities through MCP tools.

Features

Resources

  • List and access debug sessions via delve:// URIs

  • Each session has metadata about its type, target, and port

  • JSON representation for session details and state

Tools

Debug, trace, and analyze Go programs with:

  • Debug commands (debug, attach, exec, test)

  • Core dump analysis

  • Program tracing

  • Replay debugging with rr

  • DAP server support

  • Breakpoint management with conditions

  • Execution control (continue, step, next)

  • Variable inspection and evaluation

  • Backend selection (native, lldb, rr)

  • Logging configuration

  • Session management

Environment Setup

The server requires:

  • Go installed with Delve (go install github.com/go-delve/delve/cmd/dlv@latest)

  • For replay functionality: Mozilla rr (https://github.com/mozilla/rr)

  • Node.js and npm

Related MCP server: MCP-Typescribe

Installation

To install Delve MCP server:

npm install @dwisiswant0/delve-mcp

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Configuration

To use with Claude Desktop, add the server config:

  • On Linux: ~/.config/Claude/claude_desktop_config.json.

  • On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json.

  • On Windows: %APPDATA%/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "delve-mcp": {
      "command": "/path/to/delve-mcp/build/index.js"
    }
  }
}

Available Tools

Debug Commands

  • debug - Debug a Go package in current directory or specified package

  • attach - Attach to a running process by PID

  • exec - Execute and debug a precompiled binary

  • test - Debug tests in current package or specified package

  • core - Examine a core dump file with associated executable

  • dap - Start a Debug Adapter Protocol (DAP) server

  • replay - Replay an rr trace recording

  • trace - Trace program execution with function matching

Control Commands

  • setBreakpoint - Set a breakpoint with optional condition

  • removeBreakpoint - Remove an existing breakpoint

  • continue - Continue program execution

  • next - Step over to next line

  • step - Step into function call

  • stepout - Step out of current function

  • variables - List local variables in current scope

  • evaluate - Evaluate expression in current scope

Configuration Commands

  • version - Get Delve version information

  • setBackend - Configure debug backend (native, lldb, rr)

  • configureLogging - Configure debug logging components

Usage Examples

Starting a Debug Session

// Debug current package
{ name: "debug" }

// Debug with specific package and build flags
{
  name: "debug",
  arguments: {
    package: "./cmd/myapp",
    buildFlags: "-tags=integration"
  }
}

Managing Breakpoints

// Set a breakpoint
{
  name: "setBreakpoint",
  arguments: {
    sessionId: "abc123",
    file: "main.go",
    line: 42,
    condition: "count > 5"
  }
}

Inspecting State

// List variables
{
  name: "variables",
  arguments: {
    sessionId: "abc123"
  }
}

// Evaluate expression
{
  name: "evaluate",
  arguments: {
    sessionId: "abc123",
    expr: "myVar.Field"
  }
}

License

MIT.

Available Tools

19 tools
attachC

Attach to a running process

Inputs: pid (required).

configureLoggingC

Configure debug logging

Inputs: components (required), destination.

continueC

Continue program execution

Inputs: sessionId (required).

coreB

Examine a core dump

Inputs: executable (required), corePath (required).

dapC

Start a DAP (Debug Adapter Protocol) server

Inputs: clientAddr.

debugC

Start debugging a Go package

Inputs: package, buildFlags.

evaluateC

Evaluate an expression in current scope

Inputs: sessionId (required), expr (required).

execC

Debug a precompiled binary

Inputs: binary (required), args.

nextC

Step over to next line

Inputs: sessionId (required).

removeBreakpointC

Remove a breakpoint

Inputs: sessionId (required), breakpointId (required).

replayC

Replay an rr trace

Inputs: tracePath (required), onProcess.

setBackendC

Set the backend for debugging

Inputs: backend (required).

setBreakpointB

Set a breakpoint in the debugged program

Inputs: sessionId (required), file (required), line (required), condition.

stepC

Step into function call

Inputs: sessionId (required).

stepoutB

Step out of current function

Inputs: sessionId (required).

testC

Debug tests in a package

Inputs: package, testFlags.

traceC

Trace program execution

Inputs: regexp (required), pkg, ebpf, stack, +1 more.

variablesC

List local variables in current scope

Inputs: sessionId (required).

versionB

Get Delve version information

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 19 tools

    Disambiguation4/5

    Tools have distinct purposes with clear descriptions. Some potential confusion exists between 'debug', 'exec', 'test', and 'attach' as different ways to start debugging, but descriptions differentiate them. Overall, agents can reliably distinguish tools.

    Naming Consistency5/5

    All tools use a consistent single-word lowercase naming pattern (e.g., 'continue', 'step', 'setBreakpoint'). While not verb_noun, the pattern is uniform and predictable, making it easy for agents to understand.

    Tool Count3/5

    19 tools is on the higher end for a debugger MCP server. While each tool serves a legitimate debugging function, the count exceeds the typical 3-15 range, making it somewhat heavy but still manageable.

    Completeness3/5

    Covers core debugging workflows like starting, stepping, breakpoints, and evaluation. However, missing common operations like listing breakpoints, viewing stack traces, and goroutine inspection indicate notable gaps for comprehensive debugging.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables LLMs to understand and work with TypeScript APIs they haven't been trained on by providing structured access to TypeScript type definitions and documentation.
      44 npm
      46
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A standalone MCP server that provides TypeScript type inference and hover information using tsgo, enabling AI agents to get type details, diagnostics, references, and more without needing an editor.
      8 npm
      1
      MIT