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
- Team context includes: team_id, team_name, team_role, team_permissions
270
270
271
+
## Session Management and Security Model
272
+
273
+
### MCP Sessions vs OAuth Authentication
274
+
275
+
The satellite implements a two-layer security model that separates authentication from session management:
276
+
277
+
**Authentication Layer (OAuth Bearer Token):**
278
+
- Primary security mechanism for all requests
279
+
- Validates user identity, team membership, and permissions
280
+
- Enforced by authentication middleware before session handling
281
+
- Team isolation enforced at this layer via token introspection
282
+
283
+
**Session Layer (MCP Session ID):**
284
+
- Transport-level identifier for HTTP/SSE connection routing
285
+
- NOT a security credential - purely for protocol state management
286
+
- Can be safely reused because security comes from Bearer token
287
+
- Managed by StreamableHTTPServerTransport from MCP SDK
288
+
289
+
### Session Resurrection After Satellite Restart
290
+
291
+
When a satellite restarts (deployments, updates, crashes), MCP sessions are lost because they live in memory. The satellite implements transparent session resurrection to avoid forcing users to manually reconnect:
292
+
293
+
**How Session Resurrection Works:**
294
+
1. Client sends request with old session ID (from before restart)
295
+
2. Satellite validates Bearer token FIRST (authentication layer)
296
+
3. If session ID is stale, satellite creates new Server + Transport with same session ID
297
+
4. Bootstrap transport with synthetic `initialize` request
298
+
5. Process actual client request normally
299
+
6. Client continues without reconnection
300
+
301
+
**Implementation Details:**
302
+
```typescript
303
+
// Authentication happens FIRST (line 558 in mcp-server-wrapper.ts)
0 commit comments