Repository navigation
feat(xdebug): MCP tools to drive a session without an IDE - #395
Merged
Merged
Conversation
- xdebug_step (into/over/out), xdebug_continue: send the continuation and wait (<=30 s) for the next pause; return file, line, function and source, or that the script ended / still runs. - xdebug_stop: detach (default, script runs on) or stop (ends the request). - xdebug_wait: block (<=60 s) until a session pauses; returns at once when one already is. - Refused while an IDE drives the session. The agent's MCP client name is shown as last_continuation_agent; every call goes to the agent log. - xdebug.allow_control (XDEBUG_PROXY_ALLOW_CONTROL), default true; false keeps the tools read-only. GET /api/xdebug shows allow_control.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2 of "Xdebug without an IDE" (part 1 #392 is merged).
AI agents can now drive a debug session Buggregator runs itself (no IDE attached).
New MCP tools (behind
xdebug.allow_control, default on)xdebug_stepmode:into/over(default) /out; waits for the next pause (≤30 s) and returns file, line, function and source around it, or that the script endedxdebug_continuexdebug_break(); same waitxdebug_stopmode:detach(default, script runs to its end) orstop(ends the request now)xdebug_waitlast_continuation_agent, so the UI can show who stepped. Every call goes to the session's agent log, as the read tools do.xdebug.allow_control/XDEBUG_PROXY_ALLOW_CONTROL(defaulttrue);falsekeeps the Xdebug tools read-only.xdebug_evalstill needsallow_eval(defaultfalse).GET /api/xdebugshowsallow_control.Tests
modules/xdebug/control_mcp_test.go(in-memory MCP client + fake DBGp engine): step returns the new location and records the agent; continue to the end reportsstopped; stop detaches by default; all control tools refused while an IDE drives;xdebug_waittimes out, then catches a session that pauses later.TestMCPTools_EvalOffByDefaultalso checks the control tools are absent withallow_controloff.go test -race -count=3 ./modules/xdebug/ ./internal/app/ok.Made with harnsy