microsoft / microsoft/DebugMCP
[RFC / Feature Request] Multi-session debugging support via optional sessionId
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 511
- Forks
- 60
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 18
Description
Summary
Currently, DebugMCP assumes a single active debug session model by binding operations to vscode.debug.activeDebugSession.
In complex application architectures (e.g. frontend + backend services launched via compound debug configurations, client/server setups, microservices, or parent/child worker processes), multiple DAP debug sessions run concurrently in the same VS Code workspace. When this happens, an AI agent cannot deterministically target or inspect a specific session without risking race conditions or relying on VS Code's global active session focus.
Motivation
For AI agents managing full-stack or multi-process debugging workflows:
- Targeted Inspection & Stepping: The agent needs to step or inspect variables in the backend service while the frontend service continues running (or vice-versa).
- Session Disambiguation: Without a session identifier, inspection tools (
get_variables_values,evaluate_expression) fail or hit the wrong target if another session steals focus.
Proposed Architecture & Prototype
We explored a working prototype of this approach on our fork here:
👉 Prototype Branch: https://github.com/ankitajha6475-jpg/DebugMCP/tree/feature/multi-session
👉 Key Implementation Commit: https://github.com/ankitajha6475-jpg/DebugMCP/commit/6943502a17a58fde7299bc89cecf126515488f1e
The core design in that prototype:
- Active Session Map in
DebuggingExecutor: Maintain a map of active debug sessions (Map<string, vscode.DebugSession>) updated viaonDidStartDebugSession/onDidTerminateDebugSession. - Optional
sessionId?: stringParameter: Add an optionalsessionIdto tool schemas:step_over,step_into,step_outcontinue_execution,pause_execution,restart_debuggingget_variables_values,evaluate_expression- (And now potentially
get_debug_status)
- Graceful Fallback: If
sessionIdis omitted, fall back tovscode.debug.activeDebugSession, keeping 100% backward compatibility for standard single-session workflows. - Session Enumeration: Provide an easy way for agents to list active sessions (their IDs, names, and types) to discover target IDs.
Status & Contribution Handoff
We validated this pattern in our own workflows and wanted to document the architecture and share the reference branch for anyone in the community interested in taking this forward.
Because we currently lack the bandwidth to drive this implementation to completion or actively shepherd a PR, we are leaving this RFC and prototype open for the maintainers or any community contributor to adopt, adapt, or build upon whenever multi-session support becomes a priority.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked prototype branch and commit, then inspect the existing DebuggingExecutor and the listed debugging tools. Compare the prototype's active-session map, optional sessionId handling, fallback behavior, and session enumeration with the current implementation. Done would require an agreed, tested multi-session design, but this RFC does not identify specific files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100