XD

xhd2015/dlv-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

21 stars 5 forks 품질 47 트렌드 0MIT

사이트맵 Golang의 Delve Debugger를 노출하는 서버는 AI를 자체 디버그로 가능하게 합니다

개요

LLM을 허용하는 MCP 서버는 Delve Go debugger와 상호 작용합니다. 이 프로젝트는 Delve Go debugger와 통합하는 Model Context Protocol (MCP) 서버를 구현하여 AI Assistants를 디버깅 Go 애플리케이션에 구현합니다. 서버는 LLM을 시작, 제어 및 디버그 세션과 상호 작용할 수 있는 도구 세트를 노출합니다. EXAMPLE.md에서 작업 예제를 찾을 수 있습니다. - Go 프로그램에 대한 디버깅 세션 시작 - 코드 설정 - 코드를 통해 단계 (다음, 단계, 단계) - 디버깅 세션의 맥락에서 표현 - 변수를 검사하고 추적 - 여러 디버깅 세션 관리 - 1.21 이상 - Delve debugger 설치 (github.com/go-delve/delve/cmd/dlv@latest 설치) 그런 다음 커서 또는 MCP 클라이언트의 http://localhost:9097/sse,에서 MCP Server를 구성합니다.

개요(AI 번역)

LLM을 허용하는 MCP 서버는 Delve Go debugger와 상호 작용합니다.

묘사

이 프로젝트는 Delve Go debugger와 통합하는 Model Context Protocol (MCP) 서버를 구현하여 AI Assistants를 디버깅 Go 애플리케이션에 구현합니다. 서버는 LLM을 시작, 제어 및 디버그 세션과 상호 작용할 수 있는 도구 세트를 노출합니다.

EXAMPLE.md에서 작업 예제를 찾을 수 있습니다.

특징

  • Go 프로그램에 대한 디버그 세션 시작
  • 코드에 Breakpoints 설정
  • 코드를 통해 단계 (다음, 단계, 단계 아웃)
  • 디버그 세션의 맥락에서 표현
  • Inspect 변수 및 스택 추적
  • 여러 디버그 세션 관리

설치

# 필수품

  • 1.21이상
  • Delve 디버거 설치 (go install github.com/go-delve/delve/cmd/dlv@latest)

설치

사용법

MCP 서버 시작:

그런 다음 MCP Server를 http://localhost:9097/sse, Cursor 또는 MCP 클라이언트에서 구성합니다.

MCP 서버 검사

사용 가능한 도구

Debug 세션 관리

  • start_debug: 새로운 디버그 세션 시작
  • program: 디버그에 가기 위한 방법
  • args: (선택 사항)

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

Go Delve Debugger MCP Server

An MCP server that allows LLMs to interact with the Delve Go debugger.

Description

This project implements a Model Context Protocol (MCP) server that integrates with the Delve Go debugger to enable AI assistants to debug Go applications. The server exposes a set of tools that allow LLMs to start, control, and interact with debug sessions.

You can find a working example at EXAMPLE.md.

Features

  • Start debug sessions for Go programs
  • Set breakpoints in code
  • Step through code (next, step in, step out)
  • Evaluate expressions in the context of a debug session
  • Inspect variables and stack traces
  • Manage multiple debug sessions

Installation

Prerequisites

  • Go 1.21 or higher
  • Delve debugger installed (go install github.com/go-delve/delve/cmd/dlv@latest)

Install

go install github.com/xhd2015/dlv-mcp/cmd/dlv-mcp@latest

Usage

Start the MCP server:

dlv-mcp --listen :9097

Then configure MCP Server at http://localhost:9097/sse, in Cursor or any MCP client.

Inspect the MCP Server

bunx @modelcontextprotocol/inspector dlv-mcp

Available Tools

Debug Session Management

  • start_debug: Start a new debug session

    • program: Path to Go program to debug
    • args: Command line arguments for the program (optional)
    • mode: Debug mode (debug, test, or exec, default: debug)
  • terminate_debug: Terminate a debug session

    • session_id: ID of the debug session to terminate
  • list_debug_sessions: List active debug sessions

Breakpoint Management

  • set_breakpoint: Set a breakpoint in a debug session
    • session_id: ID of the debug session
    • file: Source file to set breakpoint in (absolute path)
    • line: Line number to set breakpoint at

Execution Control

  • continue: Continue execution in a debug session

    • session_id: ID of the debug session
  • next: Step over current line in a debug session

    • session_id: ID of the debug session
  • step_in: Step into function in a debug session

    • session_id: ID of the debug session
  • step_out: Step out of function in a debug session

    • session_id: ID of the debug session

Inspection

  • evaluate: Evaluate an expression in a debug session
    • session_id: ID of the debug session
    • expression: Expression to evaluate
    • frame_id: Stack frame ID (optional, default: 0)

Example Workflow

  1. Start a debug session:

    start_debug program=/path/to/program.go
    
  2. Set a breakpoint:

    set_breakpoint session_id=session-123456 file=/path/to/program.go line=15
    
  3. Continue to breakpoint:

    continue session_id=session-123456
    
  4. Evaluate an expression:

    evaluate session_id=session-123456 expression="myVariable"
    
  5. Step over a line:

    next session_id=session-123456
    
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →