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
Copy file name to clipboardExpand all lines: docs/architecture/debugMCPServer.md
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,24 +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 FastMCP with Server-Sent Events (SSE) transport 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 Server-Sent Events (SSE) transport over an express HTTP server for real-time bidirectional communication.
10
10
11
11
## Responsibility
12
12
13
-
- Initialize and manage the FastMCP server lifecycle
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
-
-Handle SSE transport on configurable port (default: 3001)
17
+
-Manage SSE transport connections via `SSEServerTransport` 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
24
+
▼ SSE Connection (GET /sse + POST /messages)
25
25
┌───────────────────┐
26
26
│ DebugMCPServer │ ◄── You are here
27
+
│ (express + SSE) │
27
28
└───────────────────┘
28
29
│
29
30
▼ Delegates to
@@ -41,14 +42,18 @@ AI Agent (MCP Client)
41
42
42
43
### SSE Transport
43
44
44
-
Uses HTTP with Server-Sent Events for persistent connections. This allows the server to push updates to clients and maintain connection health via ping/keepalive.
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
48
+
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.
0 commit comments