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
The HTTP Stream transport supports two response modes:
335
+
336
+
1. **Batch Mode** (Default): Responses are collected and sent as a single JSON-RPC response. This is suitable for typical request-response patterns and is more efficient for most use cases.
337
+
338
+
2. **Stream Mode**: All responses are sent over a persistent SSE connection opened foreach request. This is ideal for long-running operations or when the server needs to send multiple messagesin response to a single request.
339
+
340
+
You can configure the response mode based on your specific needs:
341
+
342
+
```typescript
343
+
// For batch mode (default):
344
+
const server = new MCPServer({
345
+
transport: {
346
+
type: "http-stream",
347
+
options: {
348
+
responseMode: "batch"
349
+
}
350
+
}
351
+
});
352
+
353
+
// For stream mode:
354
+
const server = new MCPServer({
355
+
transport: {
356
+
type: "http-stream",
357
+
options: {
358
+
responseMode: "stream"
359
+
}
360
+
}
361
+
});
362
+
```
363
+
364
+
#### HTTP Stream Transport Features
365
+
366
+
- **Session Management**: Automatic session tracking and management
367
+
- **Stream Resumability**: Optional support for resuming streams after connection loss
368
+
- **Batch Processing**: Support for JSON-RPC batch requests/responses
MCP Framework provides optional authentication for SSE endpoints. You can choose between JWT and API Key authentication, or implement your own custom authentication provider.
0 commit comments