-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·27 lines (25 loc) · 1.04 KB
/
test.sh
File metadata and controls
executable file
·27 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# initialize and capture session ID
SESSION=$(curl -sD - \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":0,"method":"initialize",
"params":{"protocolVersion":"2025-06-18",
"capabilities":{"tools":{}},
"clientInfo":{"name":"curl","version":"1"}}}' \
http://127.0.0.1:8000/mcp/?token=TEST |
grep -i mcp-session-id | awk '{print $2}' | tr -d '\r')
# send initialized notification
curl -s \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H "Mcp-Session-Id: $SESSION" \
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
http://127.0.0.1:8000/mcp/?token=TEST
# call the search tool
curl -s \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H "Mcp-Session-Id: $SESSION" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"search_web","arguments":{"query":"diffbot"}}}' \
http://127.0.0.1:8000/mcp/?token=TEST