Skip to content

Commit 2accc57

Browse files
docs: add stateless mode documentation to README
[skip ci]
1 parent ec227db commit 2accc57

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ $transport = new StreamableHttpServerTransport(
524524
host: '127.0.0.1', // MCP protocol prohibits 0.0.0.0
525525
port: 8080,
526526
mcpPathPrefix: 'mcp',
527-
enableJsonResponse: false // Use SSE streaming (default)
527+
enableJsonResponse: false, // Use SSE streaming (default)
528+
stateless: false // Enable stateless mode for session-less clients
528529
);
529530

530531
$server->listen($transport);
@@ -546,12 +547,27 @@ $transport = new StreamableHttpServerTransport(
546547
);
547548
```
548549

550+
**Stateless Mode:**
551+
552+
For clients that have issues with session management, enable stateless mode:
553+
554+
```php
555+
$transport = new StreamableHttpServerTransport(
556+
host: '127.0.0.1',
557+
port: 8080,
558+
stateless: true // Each request is independent
559+
);
560+
```
561+
562+
In stateless mode, session IDs are generated internally but not exposed to clients, and each request is treated as independent without persistent session state.
563+
549564
**Features:**
550565
- **Resumable connections** - clients can reconnect and replay missed events
551566
- **Event sourcing** - all events are stored for replay
552567
- **JSON mode** - optional JSON-only responses for fast tools
553568
- **Enhanced session management** - persistent session state
554569
- **Multiple client support** - designed for concurrent clients
570+
- **Stateless mode** - session-less operation for simple clients
555571

556572
## 📋 Schema Generation and Validation
557573

0 commit comments

Comments
 (0)