Log headers in curl initialize requests

The user needs the `mcp-session-id` header, so we should log headers.
This commit is contained in:
Sam Bostock 2025-06-24 11:22:46 -04:00
commit cccb7494fa
No known key found for this signature in database
GPG key ID: 65626A9DAF9ACD95
2 changed files with 2 additions and 2 deletions

View file

@ -156,7 +156,7 @@ end
puts "Starting MCP HTTP server on http://localhost:9292"
puts "Use POST requests to initialize and send JSON-RPC commands"
puts "Example initialization:"
puts ' curl -X POST http://localhost:9292 -H "Content-Type: application/json" -d \'{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\''
puts ' curl -i -X POST http://localhost:9292 -H "Content-Type: application/json" -d \'{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\''
puts ""
puts "The server will return a session ID in the Mcp-Session-Id header."
puts "Use this session ID for subsequent requests."

View file

@ -147,7 +147,7 @@ puts ""
puts "Testing SSE:"
puts ""
puts "1. Initialize session:"
puts ' curl -X POST http://localhost:9393 -H "Content-Type: application/json" \\'
puts ' curl -i -X POST http://localhost:9393 -H "Content-Type: application/json" \\'
puts ' -d \'{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"sse-test","version":"1.0"}}}\''
puts ""
puts "2. Connect SSE stream (use the session ID from step 1):"