@@ -24,29 +24,29 @@ Satellites operate as edge workers similar to GitHub Actions runners, providing:
2424
2525## Current Implementation Architecture
2626
27- ### Phase 1: MCP Transport Layer
27+ ### MCP SDK Transport Layer
2828
29- The current satellite implementation provides complete MCP client interface support :
29+ The satellite uses the official ` @modelcontextprotocol/sdk ` for all MCP client communication :
3030
3131```
3232┌─────────────────────────────────────────────────────────────────────────────────┐
33- │ MCP Transport Implementation │
33+ │ Official MCP SDK Implementation │
3434│ │
35- │ ┌─────────────────┐ ┌ ─────────────────┐ ┌ ─────────────────┐ │
36- │ │ SSE Transport │ │ SSE Messaging │ │ Streamable HTTP │ │
37- │ │ │ │ │ │ │ │
38- │ │ • GET /sse │ │ • POST /message │ │ • GET/POST /mcp │ │
39- │ │ • Session Mgmt │ │ • JSON-RPC 2.0 │ │ • Optional SSE │ │
40- │ │ • 30min timeout │ │ • Session-based │ │ • CORS Support │ │
41- │ └─────────────────┘ └ ─────────────────┘ └ ─────────────────┘ │
35+ │ ┌─────────────────────────────────────────────────────────────────────────┐ │
36+ │ │ MCP SDK Server │ │
37+ │ │ │ │
38+ │ │ • StreamableHTTPServerTransport • Standard JSON-RPC handling │ │
39+ │ │ • Automatic session management • Built-in error responses │ │
40+ │ │ • Protocol 2025-03-26 compliance • SSE streaming support │ │
41+ │ └─────────────────────────────────────────────────────────────────────────┘ │
4242│ │
43- │ ┌─────────────────┐ ┌ ─────────────────┐ ┌ ─────────────────┐ │
44- │ │ Session Manager │ │ SSE Handler │ │ Streamable HTTP │ │
45- │ │ │ │ │ │ Handler │ │
46- │ │ • 32-byte IDs │ │ • Connection │ │ • Dual Response │ │
47- │ │ • Activity │ │ Management │ │ • Session Aware │ │
48- │ │ • Auto Cleanup │ │ • Message Send │ │ • Error Handle │ │
49- │ └─────────────────┘ └ ─────────────────┘ └ ─────────────────┘ │
43+ │ ┌─────────────────────────────────────────────────────────────────────────┐ │
44+ │ │ MCP Client Integration │ │
45+ │ │ │ │
46+ │ │ • StreamableHTTPClientTransport • External server discovery │ │
47+ │ │ • Automatic connection cleanup • Tool discovery caching │ │
48+ │ │ • Standard MCP method support • Process communication │ │
49+ │ └─────────────────────────────────────────────────────────────────────────┘ │
5050│ │
5151│ ┌─────────────────────────────────────────────────────────────────────────┐ │
5252│ │ Foundation Infrastructure │ │
@@ -59,66 +59,58 @@ The current satellite implementation provides complete MCP client interface supp
5959└─────────────────────────────────────────────────────────────────────────────────┘
6060```
6161
62- ### Current MCP Transport Endpoints
62+ ### MCP Transport Endpoints
6363
64- ** Implemented Endpoints:**
65- - ` GET /sse ` - Establish SSE connection with session management
66- - ` POST /message?session={id} ` - Send JSON-RPC messages via SSE sessions
67- - ` GET /mcp ` - Establish SSE stream for Streamable HTTP transport
68- - ` POST /mcp ` - Send JSON-RPC messages via Streamable HTTP
69- - ` OPTIONS /mcp ` - CORS preflight handling
64+ ** Active Endpoints:**
65+ - ` GET /mcp ` - Establish SSE stream via MCP SDK
66+ - ` POST /mcp ` - Send JSON-RPC messages via MCP SDK
67+ - ` DELETE /mcp ` - Session termination via MCP SDK
7068
7169** Transport Protocol Support:**
7270```
73- MCP Client Satellite
71+ MCP Client Satellite (MCP SDK)
7472 │ │
75- │──── GET /sse ───────────── ▶│ (Establish SSE session )
73+ │──── POST /mcp ────────────▶│ (Initialize connection )
7674 │ │
77- │◀─── Session URL ────────── │ (Return session endpoint )
75+ │◀─── Session headers ──────│ (Session established )
7876 │ │
79- │──── POST /message ────────▶│ (Send JSON-RPC via session )
77+ │──── POST /mcp ──────────── ▶│ (JSON-RPC tools/list )
8078 │ │
81- │◀─── Response via SSE ─────│ (Stream response back )
79+ │◀─── Tools response ─────── │ (Cached tools returned )
8280```
8381
84- ### Core Components
85-
86- ** Session Manager:**
87- - Cryptographically secure 32-byte base64url session IDs
88- - 30-minute session timeout with automatic cleanup
89- - Activity tracking and session state management
90- - Client info storage and MCP initialization tracking
82+ ### Core SDK Components
9183
92- ** SSE Handler :**
93- - Server-Sent Events connection establishment
94- - Message sending with error handling
95- - Heartbeat and endpoint event management
96- - Connection lifecycle management
84+ ** MCP Server Wrapper :**
85+ - Official SDK Server integration with Fastify
86+ - Standard MCP protocol method handlers
87+ - Automatic session and transport management
88+ - Integration with existing tool discovery and process management
9789
98- ** Streamable HTTP Handler :**
99- - Dual response mode (JSON and SSE streaming)
100- - Optional session-based communication
101- - CORS preflight handling
102- - Error counting and session management
90+ ** Client Communication :**
91+ - StreamableHTTPClientTransport for external server communication
92+ - Automatic connection establishment and cleanup
93+ - Standard MCP method execution (listTools, callTool)
94+ - Built-in error handling and retry logic
10395
104- ### JSON-RPC 2.0 Protocol Implementation
96+ ### MCP Protocol Implementation
10597
10698** Supported MCP Methods:**
107- - ` initialize ` - MCP session initialization
99+ - ` initialize ` - MCP session initialization (SDK automatic)
108100- ` notifications/initialized ` - Client initialization complete
109- - ` tools/list ` - List available tools from remote MCP servers
110- - ` tools/call ` - Execute tools on remote MCP servers
101+ - ` tools/list ` - List cached tools from discovered servers
102+ - ` tools/call ` - Execute tools routed to appropriate servers
111103- ` resources/list ` - List available resources (returns empty array)
112104- ` resources/templates/list ` - List resource templates (returns empty array)
113105- ` prompts/list ` - List available prompts (returns empty array)
114106
115107For detailed information about tool discovery and execution, see [ Tool Discovery Implementation] ( /development/satellite/tool-discovery ) .
116108
117109** Error Handling:**
118- - JSON-RPC 2.0 compliant error responses
119- - HTTP status code mapping
120- - Structured error logging
121- - Session validation and error reporting
110+ - Standard JSON-RPC 2.0 compliant error responses via SDK
111+ - Automatic HTTP status code mapping
112+ - Structured error logging with operation tracking
113+ - Built-in session validation and error reporting
122114
123115## Planned Full Architecture
124116
@@ -414,18 +406,18 @@ npm run dev
414406
415407** Test MCP Transport:**
416408``` bash
417- # Test SSE connection
418- curl -N -H " Accept: text/event-stream" http://localhost:3001/sse
419-
420- # Send JSON-RPC message (replace SESSION_ID)
421- curl -X POST " http://localhost:3001/message?session=SESSION_ID" \
409+ # Test MCP connection
410+ curl -X POST " http://localhost:3001/mcp" \
422411 -H " Content-Type: application/json" \
423412 -d ' {"jsonrpc":"2.0","id":"1","method":"initialize","params":{}}'
424413
425- # Direct HTTP transport
426- curl -X POST http://localhost:3001/mcp \
414+ # Test tool discovery
415+ curl -X POST " http://localhost:3001/mcp" \
427416 -H " Content-Type: application/json" \
428- -d ' {"jsonrpc":"2.0","id":"1","method":"tools/list","params":{}}'
417+ -d ' {"jsonrpc":"2.0","id":"2","method":"tools/list","params":{}}'
418+
419+ # Test SSE streaming
420+ curl -N -H " Accept: text/event-stream" " http://localhost:3001/mcp"
429421```
430422
431423** MCP Client Configuration:**
@@ -436,7 +428,7 @@ curl -X POST http://localhost:3001/mcp \
436428 "command" : " npx" ,
437429 "args" : [" @modelcontextprotocol/server-fetch" ],
438430 "env" : {
439- "MCP_SERVER_URL" : " http://localhost:3001/sse "
431+ "MCP_SERVER_URL" : " http://localhost:3001/mcp "
440432 }
441433 }
442434 }
0 commit comments