BASE="http://127.0.0.1:8006"
curl -s -N -m 8 "$BASE/sse" > /tmp/sse6.txt &
CP=$!
sleep 1
SID=$(grep -oP 'session_id=\K[^/]+' /tmp/sse6.txt | head -1)
echo SESSION=$SID
curl -s -m 4 -X POST "$BASE/messages/?session_id=$SID" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}' >/dev/null
sleep 1
curl -s -m 4 -X POST "$BASE/messages/?session_id=$SID" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' >/dev/null
sleep 2
kill $CP 2>/dev/null
cat /tmp/sse6.txt | grep -A200 -m1 'tools'
