Skip to content

feat: Host a local MCP server for the debug session - #410

Open
Fabrimat wants to merge 6 commits into
Mojang:mainfrom
Fabrimat:feat/mcp-server
Open

Fabrimat wants to merge 6 commits into
Mojang:mainfrom
Fabrimat:feat/mcp-server

Conversation

@Fabrimat

@Fabrimat Fabrimat commented Oct 13, 2026 •

Copy link
Copy Markdown

Adds an optional local Model Context Protocol server, so MCP clients can inspect and control a Minecraft debug session.

  • Disabled by default (minecraft-debugger.mcp.enabled). Listens only on 127.0.0.1 (minecraft-debugger.mcp.port, default 19180) and requires a bearer token kept in VS Code secret storage.
  • New commands: Minecraft Debugger: Copy MCP Server Config and Minecraft Debugger: Regenerate MCP Token.
  • Tools: session status, debugger output, live diagnostics stats, tabs and requests (e.g. profilers), entity queries, call stack, variables, evaluate, Minecraft commands, continue/pause/step, breakpoints, and waiting for a log line or a stop.
  • The home panel shows the server state and recent tool calls. The Live Diagnostics panel reports its tabs to the extension and accepts tab toggles, so tab changes made by a client are visible in the panel.
  • Adds the onStartupFinished activation event so the server is available before a debug session starts.
  • @modelcontextprotocol/sdk and zod are bundled as devDependencies. skipLibCheck is enabled because the SDK's type declarations reference DOM types.
  • Documented in the README, with vitest tests for the server and its buffers.

Adds an optional Model Context Protocol server (loopback only, bearer
token) that lets MCP clients read logs, stats, stack and variables,
evaluate expressions, run commands, control execution and manage
breakpoints. Tool calls are shown live in a new MCP Activity section of
the home panel.
…cation

set_breakpoint now resolves relative paths against the debug session's
localRoot, rejects missing files instead of leaving phantom breakpoints,
and returns the adapter's verified flag and message. wait_for_event
accepts sinceSeq to catch events emitted before the call.
…uffer resets

Pause sends a DAP pause to the first thread instead of the workbench command, which is a no-op without a thread context. Stack traces default to the thread that stopped. Event cursors from before a window reload read from the start.
set_diagnostics_active toggles collectors through the existing set-diagnostics-active event, so get_stats no longer depends on the Live Diagnostics panel being open.
Replaces set_diagnostics_active with get_diagnostics_tabs and set_diagnostics_tab, which drive the panel's tab switches so the change is visible in VS Code.
debugger_request sends the requests behind the Live Diagnostics buttons, get_entities lists entities through the scripting API while the game runs, and evaluate no longer requires a pause. get_stats includes each stat's group and table rows, and get_logs moves its cursor to the head when the read is not truncated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant