Skip to content

Commit 974c5fc

Browse files
author
Lasim
committed
docs: update satellite architecture and commands documentation to reflect completed MCP server management features and tool discovery enhancements
1 parent 46ea63e commit 974c5fc

File tree

3 files changed

+39
-37
lines changed

3 files changed

+39
-37
lines changed

docs/development/satellite/architecture.mdx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -315,21 +315,24 @@ For complete implementation details, see [Backend Polling Implementation](/devel
315315
- **Scope-Based Access**: Fine-grained permissions
316316
- **Team Context**: Automatic team resolution from tokens
317317

318-
## MCP Server Management (Planned)
318+
## MCP Server Management
319319

320320
### Dual MCP Server Support
321321

322322
**stdio Subprocess Servers:**
323-
- **Local Execution**: MCP servers as child processes
324-
- **JSON-RPC Communication**: Standard MCP protocol
325-
- **Process Lifecycle**: Spawn, monitor, terminate
326-
- **Team Isolation**: Processes isolated per team
323+
- **Local Execution**: MCP servers as Node.js child processes
324+
- **JSON-RPC Communication**: Full MCP protocol 2025-11-05 over stdin/stdout
325+
- **Process Lifecycle**: Spawn, monitor, auto-restart (max 3 attempts), terminate
326+
- **Team Isolation**: Processes tracked by team_id with environment-based security
327+
- **Tool Discovery**: Automatic tool caching with namespacing
328+
- **Resource Limits**: nsjail in production (100MB RAM, 60s CPU, 50 processes)
329+
- **Development Mode**: Plain spawn() on all platforms for easy debugging
327330

328331
**HTTP Proxy Servers:**
329332
- **External Endpoints**: Proxy to remote MCP servers
330333
- **Load Balancing**: Distribute requests across instances
331334
- **Health Monitoring**: Endpoint availability checks
332-
- **Caching**: Response caching for performance
335+
- **Tool Discovery**: Automatic at startup from remote endpoints
333336

334337
### Process Management
335338

@@ -357,11 +360,13 @@ Configuration → Spawn → Monitor → Health Check → Restart/Terminate
357360
- **Session Management**: Cryptographically secure session handling
358361
- **JSON-RPC 2.0**: Full protocol compliance with error handling
359362

360-
### Phase 2: MCP Server Process Management (Next)
361-
- **Process Lifecycle**: Spawn, monitor, terminate MCP servers
362-
- **stdio Communication**: JSON-RPC with local processes
363-
- **Basic Health Monitoring**: Process health checks
364-
- **Simple Configuration**: Static MCP server definitions
363+
### Phase 2: MCP Server Process Management ✅ COMPLETED
364+
- **Process Lifecycle**: Spawn, monitor, terminate MCP servers with auto-restart
365+
- **stdio Communication**: JSON-RPC 2.0 over stdin/stdout with buffer-based parsing
366+
- **Tool Discovery**: Discover and cache tools from stdio MCP servers
367+
- **Health Monitoring**: Process health checks and crash detection
368+
- **Auto-Restart**: Max 3 attempts with exponential backoff, then permanently_failed status
369+
- **Team-Aware Reporting**: processes_by_team in heartbeat every 30 seconds
365370

366371
### Phase 3: Team Isolation
367372
- **Resource Boundaries**: CPU and memory limits
@@ -469,9 +474,3 @@ The satellite service has completed **Phase 1: MCP Transport Implementation** an
469474
- **Logging System**: Pino with structured logging
470475
- **Build Pipeline**: TypeScript compilation and bundling
471476
- **Development Workflow**: Hot reload and code quality tools
472-
473-
Next milestone: **Phase 2 - MCP Server Process Management** with stdio JSON-RPC communication.
474-
475-
<Callout type="info">
476-
**Current Status**: The satellite service has completed Phase 1 (MCP Transport Implementation) and Phase 4 (Backend Integration). It provides full external client interface support and complete backend communication including command orchestration, configuration management, and status reporting. The next major milestone is implementing MCP server process management (Phase 2) to enable actual MCP server hosting.
477-
</Callout>

docs/development/satellite/commands.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,14 @@ Each satellite command contains:
5555
**Satellite Actions**:
5656
1. Fetch updated MCP server configurations from backend
5757
2. Compare with existing configurations using hash-based change detection
58-
3. Spawn new MCP server processes for added/modified servers
59-
4. Terminate MCP server processes for deleted installations
60-
5. Update HTTP proxy routes for new/removed MCP servers
61-
6. Perform tool discovery on newly spawned servers
58+
3. Spawn new MCP servers based on transport type:
59+
- **stdio transport**: Spawn Node.js subprocess via ProcessManager
60+
- **HTTP transport**: Configure HTTP proxy routes
61+
4. Terminate MCP servers for deleted installations:
62+
- **stdio transport**: Graceful process termination (SIGTERM → SIGKILL)
63+
- **HTTP transport**: Remove proxy routes
64+
5. Perform tool discovery on newly spawned/configured servers
65+
6. Report process status to backend via team-grouped heartbeat
6266

6367
### restart
6468

docs/development/satellite/index.mdx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ DeployStack Satellites are **edge workers** (similar to GitHub Actions runners)
1313

1414
## Current Implementation Status
1515

16-
The satellite service has completed **Phase 1: MCP Transport Implementation** with working external client interfaces:
16+
:The satellite service has completed
1717

1818
-**Fastify HTTP Server** with Swagger API documentation
1919
-**Pino Logging System** identical to backend configuration
@@ -22,10 +22,12 @@ The satellite service has completed **Phase 1: MCP Transport Implementation** wi
2222
-**JSON-RPC 2.0 Protocol** compliance for MCP communication
2323
-**TypeScript + Webpack** build system with full type safety
2424
-**Development Workflow** with hot reload and linting
25-
-**Backend Communication** (polling, commands, heartbeat)
25+
-**Backend Communication** (polling, commands, heartbeat with team-grouped processes)
2626
-**OAuth 2.1 Authentication** (token introspection, team context)
27-
- 🚧 **MCP Server Process Management** (ready for implementation)
28-
- 🚧 **Team Isolation with nsjail** (ready for implementation)
27+
-**stdio MCP Server Process Management** (spawn, monitor, auto-restart, terminate)
28+
-**Team Isolation** (environment-based: nsjail in production, plain spawn in dev)
29+
-**Auto-Restart Protection** (max 3 attempts, permanently_failed status)
30+
-**Tool Discovery** (HTTP and stdio MCP servers)
2931

3032
## Architecture Vision
3133

@@ -218,14 +220,16 @@ curl -X POST http://localhost:3001/mcp \
218220
- **Build System**: TypeScript compilation with Webpack bundling
219221
- **Release Management**: Conventional changelog with release-it
220222

221-
## Planned Features (Roadmap)
223+
## Implemented Features
222224

223-
### Phase 2: MCP Server Process Management (Ready for Implementation)
224-
- **Process Lifecycle**: Spawn, monitor, and terminate MCP server processes with nsjail
225-
- **stdio Communication**: JSON-RPC communication with local MCP servers
226-
- **HTTP Proxy**: Reverse proxy for external MCP server endpoints (already working)
227-
- **Health Monitoring**: Process health checks and automatic restart
228-
- **Resource Limits**: 100MB RAM, 60s CPU, 50 processes per server (via nsjail)
225+
### Phase 2: MCP Server Process Management ✅ COMPLETED
226+
- **Process Lifecycle**: Spawn, monitor, auto-restart (max 3), and terminate MCP servers
227+
- **stdio Communication**: Full JSON-RPC 2.0 protocol over stdin/stdout
228+
- **HTTP Proxy**: Reverse proxy for external MCP server endpoints ✅ working
229+
- **Health Monitoring**: Process crash detection with auto-restart
230+
- **Resource Limits**: nsjail with 100MB RAM, 60s CPU, 50 processes (production Linux)
231+
- **Tool Discovery**: Automatic tool caching from both HTTP and stdio servers
232+
- **Team-Grouped Heartbeat**: processes_by_team reporting every 30 seconds
229233

230234
### Phase 3: Team Isolation (Infrastructure Ready)
231235
- **nsjail Sandboxing**: Complete process isolation with built-in resource limits
@@ -298,8 +302,3 @@ When contributing to satellite development:
298302
5. **Consider Enterprise**: Design features with team isolation and security in mind
299303
6. **MCP Compliance**: Ensure JSON-RPC 2.0 protocol compliance
300304

301-
## Next Steps
302-
303-
The satellite service has completed Phase 1 (MCP Transport Implementation) and is ready for Phase 2 development. The next major milestone is implementing MCP server process management, which will enable the core satellite functionality of managing MCP servers on behalf of teams.
304-
305-
For detailed implementation guidance, see the architecture and MCP transport documentation linked above.

0 commit comments

Comments
 (0)