mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
handle mcp-session-id.
This commit is contained in:
@@ -1,26 +1,53 @@
|
||||
set -v
|
||||
|
||||
hostname=localhost
|
||||
port_no=8086
|
||||
entrypoint=mcp
|
||||
|
||||
# "protocolVersion": "2025-03-26",
|
||||
# "protocolVersion": "2024-11-05",
|
||||
# -H "Host: localhost:8086" \
|
||||
# -H "Connection:Keep-Alive" \
|
||||
# -H "Sec-Fetch-Mode: cors" \
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Accept: application/json,text/event-stream" \
|
||||
-D response_headers.txt \
|
||||
-d '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "initialize",
|
||||
"params": {
|
||||
"protocolVersion": "2025-03-26",
|
||||
"protocolVersion": "2024-11-05",
|
||||
"capabilities": {
|
||||
"tools": {}
|
||||
},
|
||||
"clientInfo": {
|
||||
"name": "curl-client",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
"id": 0
|
||||
}' \
|
||||
http://localhost:8085/mcp
|
||||
http://${hostname}:${port_no}/${entrypoint}
|
||||
|
||||
curl -X POST \
|
||||
grep -i "mcp-session-id" response_headers.txt | cut -d' ' -f2 > sess_id.txt
|
||||
|
||||
sleep 1
|
||||
|
||||
sess_id=`cat sess_id.txt`
|
||||
sess_header="Mcp-Session-Id: ${sess_id}"
|
||||
echo $sess_header
|
||||
|
||||
curl -v -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Accept: application/json,text/event-stream" \
|
||||
-H "$sess_header" \
|
||||
-d '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "notifications/initialized"
|
||||
}' \
|
||||
http://localhost:8085/mcp
|
||||
http://${hostname}:${port_no}/${entrypoint}
|
||||
|
||||
#curl -X POST \
|
||||
# -H "Content-Type: application/json" \
|
||||
# -d '{"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}' \
|
||||
# http://localhost:8085/mcp
|
||||
|
||||
Reference in New Issue
Block a user