You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**start_debugging**| Start a debug session for a source code file |`filePath` (required)<br>`workingDirectory` (optional)<br>`configurationName` (optional) | Start debugging a Python script |
44
-
|**stop_debugging**| Stop the current debug session | None | End the current debugging session |
45
-
|**step_over**| Execute the next line (step over function calls) | None | Move to next line without entering functions |
46
-
|**step_into**| Step into function calls | None | Enter function calls to debug them |
47
-
|**step_out**| Step out of the current function | None | Exit current function and return to caller |
48
-
|**continue_execution**| Continue until next breakpoint | None | Resume execution until hitting a breakpoint |
49
-
|**restart_debugging**| Restart the current debug session | None | Restart debugging from the beginning |
50
-
|**add_breakpoint**| Add a breakpoint at a specific line |`filePath` (required)<br>`line` (required) | Set breakpoint at line 25 of main.py |
51
-
|**remove_breakpoint**| Remove a breakpoint from a specific line |`filePath` (required)<br>`line` (required) | Remove breakpoint from line 25 |
52
-
|**list_breakpoints**| List all active breakpoints | None | Show all currently set breakpoints |
53
-
|**get_debug_status**| Get current debug session status | None | Check if debugging session is active |
54
-
|**get_variables**| Get variables and their values |`scope` (optional: 'local', 'global', 'all') | Inspect local variables |
55
-
|**evaluate_expression**| Evaluate an expression in debug context |`expression` (required) | Evaluate `user.name` or `len(items)`|
41
+
| Tool | Description | Parameters |
42
+
|------|-------------|------------|
43
+
|**get_debug_instructions**| Get the debugging guide with best practices and workflow instructions | None |
44
+
|**start_debugging**| Start a debug session for a source code file |`fileFullPath` (required)<br>`workingDirectory` (required)<br>`testName` (optional)<br>`configurationName` (optional) |
45
+
|**stop_debugging**| Stop the current debug session | None |
46
+
|**step_over**| Execute the next line (step over function calls) | None |
47
+
|**step_into**| Step into function calls | None |
48
+
|**step_out**| Step out of the current function | None |
49
+
|**continue_execution**| Continue until next breakpoint | None |
50
+
|**restart_debugging**| Restart the current debug session | None |
51
+
|**add_breakpoint**| Add a breakpoint at a specific line |`fileFullPath` (required)<br>`lineContent` (required) |
52
+
|**remove_breakpoint**| Remove a breakpoint from a specific line |`fileFullPath` (required)<br>`line` (required) |
53
+
|**clear_all_breakpoints**| Remove all breakpoints at once | None |
54
+
|**list_breakpoints**| List all active breakpoints | None |
55
+
|**get_variables_values**| Get variables and their values at current execution point |`scope` (optional: 'local', 'global', 'all') |
56
+
|**evaluate_expression**| Evaluate an expression in debug context |`expression` (required) |
57
+
58
+
> **Note:** The `get_debug_instructions` tool is particularly useful for AI clients like GitHub Copilot that don't support MCP resources. It provides the same debugging guide content that is also available as an MCP resource.
56
59
57
60
### 🎯 Debugging Best Practices
58
61
@@ -111,7 +114,7 @@ DebugMCP supports debugging for the following languages with their respective VS
@@ -126,45 +129,47 @@ The extension runs an MCP server automatically. It will pop up a message to auto
126
129
127
130
### Manual MCP Server Registration (Optional)
128
131
132
+
> **🔄 Auto-Migration**: If you previously configured DebugMCP with SSE transport, the extension will automatically migrate your configuration to the new Streamable HTTP transport on activation.
133
+
129
134
#### Cline
130
135
Add to your Cline settings or `cline_mcp_settings.json`:
Copy file name to clipboardExpand all lines: docs/architecture/debugMCPServer.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,25 +6,25 @@ The MCP server component that exposes VS Code debugging capabilities to AI agent
6
6
7
7
## Motivation
8
8
9
-
AI coding agents need a standardized way to control debuggers programmatically. MCP provides this standard, and `DebugMCPServer` implements it using the official `@modelcontextprotocol/sdk` with Server-Sent Events (SSE) transport over an express HTTP server for real-time bidirectional communication.
9
+
AI coding agents need a standardized way to control debuggers programmatically. MCP provides this standard, and `DebugMCPServer` implements it using the official `@modelcontextprotocol/sdk` with Streamable HTTP transport over an express HTTP server.
10
10
11
11
## Responsibility
12
12
13
13
- Initialize and manage the MCP server lifecycle (using `McpServer` from `@modelcontextprotocol/sdk`)
14
14
- Register debugging tools that AI agents can invoke
15
15
- Register documentation resources for agent guidance
16
16
- Delegate all debugging operations to `DebuggingHandler`
17
-
- Manage SSE transport connections via `SSEServerTransport` on configurable port (default: 3001)
17
+
- Manage Streamable HTTP transport via `StreamableHTTPServerTransport` on configurable port (default: 3001)
18
18
19
19
## Architecture Position
20
20
21
21
```
22
22
AI Agent (MCP Client)
23
23
│
24
-
▼ SSE Connection (GET /sse + POST /messages)
24
+
▼ HTTP POST /mcp
25
25
┌───────────────────┐
26
26
│ DebugMCPServer │ ◄── You are here
27
-
│ (express + SSE) │
27
+
│ (express + HTTP) │
28
28
└───────────────────┘
29
29
│
30
30
▼ Delegates to
@@ -38,15 +38,14 @@ AI Agent (MCP Client)
38
38
### Tools vs Resources
39
39
40
40
-**Tools**: Actions the AI can perform (start debugging, step over, etc.)
41
-
-**Resources**: Documentation the AI can read for guidance
41
+
-**Resources**: Documentation the AI can read for guidance (note: some clients like GitHub Copilot don't support resources, so the `get_debug_instructions` tool is also provided)
42
42
43
-
### SSE Transport
43
+
### Streamable HTTP Transport
44
44
45
-
Uses HTTP with Server-Sent Events for persistent connections. The express server exposes two endpoints:
46
-
-`GET /sse` — Establishes the SSE stream and creates a session
47
-
-`POST /messages?sessionId=...` — Receives JSON-RPC messages from the client
45
+
Uses stateless HTTP POST requests for MCP communication. The express server exposes:
46
+
-`POST /mcp` — Handles all MCP protocol messages (JSON-RPC over HTTP)
48
47
49
-
Each client connection creates an `SSEServerTransport` instance that is connected to the `McpServer`. The server tracks active transports by session ID and cleans them up on disconnect.
48
+
Each request creates a new `StreamableHTTPServerTransport` instance in stateless mode, which is cleaned up when the response closes. This approach is simpler than session-based transports and works well with standard HTTP clients.
50
49
51
50
## Key Code Locations
52
51
@@ -59,6 +58,7 @@ Each client connection creates an `SSEServerTransport` instance that is connecte
59
58
60
59
| Tool | Description |
61
60
|------|-------------|
61
+
|`get_debug_instructions`| Get debugging guide (for clients that don't support resources) |
0 commit comments