@@ -115,13 +115,13 @@ SESSION_ID=$(curl -D - -s -o /dev/null -X POST http://localhost:9393 \
115
115
116
116
2 . Connect to SSE stream (in one terminal):
117
117
``` bash
118
- curl -N -H " Mcp-Session-Id: $SESSION_ID " http://localhost:9393
118
+ curl -i - N -H " Mcp-Session-Id: $SESSION_ID " http://localhost:9393
119
119
```
120
120
121
121
3 . Trigger notifications (in another terminal):
122
122
``` bash
123
123
# Send immediate notification
124
- curl -X POST http://localhost:9393 \
124
+ curl -i - X POST http://localhost:9393 \
125
125
-H " Content-Type: application/json" \
126
126
-H " Mcp-Session-Id: $SESSION_ID " \
127
127
-d ' {"jsonrpc":"2.0","method":"tools/call","id":2,"params":{"name":"notification_tool","arguments":{"message":"Hello from cURL!"}}}'
@@ -152,22 +152,22 @@ The HTTP server implements the MCP Streamable HTTP transport protocol:
152
152
153
153
Initialize a session:
154
154
``` bash
155
- curl -X POST http://localhost:9292 \
155
+ curl -i - X POST http://localhost:9292 \
156
156
-H " Content-Type: application/json" \
157
157
-d ' {"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
158
158
```
159
159
160
160
List tools (using the session ID from initialization):
161
161
``` bash
162
- curl -X POST http://localhost:9292 \
162
+ curl -i - X POST http://localhost:9292 \
163
163
-H " Content-Type: application/json" \
164
164
-H " Mcp-Session-Id: YOUR_SESSION_ID" \
165
165
-d ' {"jsonrpc":"2.0","method":"tools/list","id":2}'
166
166
```
167
167
168
168
Call a tool:
169
169
``` bash
170
- curl -X POST http://localhost:9292 \
170
+ curl -i - X POST http://localhost:9292 \
171
171
-H " Content-Type: application/json" \
172
172
-H " Mcp-Session-Id: YOUR_SESSION_ID" \
173
173
-d ' {"jsonrpc":"2.0","method":"tools/call","id":3,"params":{"name":"ExampleTool","arguments":{"a":5,"b":3}}}'
0 commit comments