clean up and docs fixes
This commit is contained in:
parent
77352db978
commit
962a9c959a
1 changed files with 99 additions and 19 deletions
|
|
@ -20,15 +20,43 @@ The server will start on port 3000. You can test the initialization and tool cal
|
|||
|
||||
```bash
|
||||
# Initialize the server and get the session ID from headers
|
||||
SESSION_ID=$(curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{}},"id":"1"}' \
|
||||
SESSION_ID=$(curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Accept: application/json" \
|
||||
-H "Accept: text/event-stream" \
|
||||
-d '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "initialize",
|
||||
"params": {
|
||||
"capabilities": {},
|
||||
"protocolVersion": "2025-03-26",
|
||||
"clientInfo": {
|
||||
"name": "test",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
},
|
||||
"id": "1"
|
||||
}' \
|
||||
-i http://localhost:3000/mcp 2>&1 | grep -i "mcp-session-id" | cut -d' ' -f2 | tr -d '\r')
|
||||
echo "Session ID: $SESSION_ID"
|
||||
|
||||
# Call the greet tool using the saved session ID
|
||||
curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" \
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Accept: application/json" \
|
||||
-H "Accept: text/event-stream" \
|
||||
-H "mcp-session-id: $SESSION_ID" \
|
||||
-d '{"jsonrpc":"2.0","method":"mcp.call_tool","params":{"name":"greet","arguments":{"name":"World"}},"id":"2"}' \
|
||||
-d '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "tools/call",
|
||||
"params": {
|
||||
"name": "greet",
|
||||
"arguments": {
|
||||
"name": "World"
|
||||
}
|
||||
},
|
||||
"id": "2"
|
||||
}' \
|
||||
http://localhost:3000/mcp
|
||||
```
|
||||
|
||||
|
|
@ -52,10 +80,25 @@ The server will start on port 3000. You can test the initialization and tool lis
|
|||
|
||||
```bash
|
||||
# First initialize the server and save the session ID to a variable
|
||||
SESSION_ID=$(curl -X POST -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
|
||||
-d '{"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{}},"id":"1"}' \
|
||||
SESSION_ID=$(curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Accept: application/json" \
|
||||
-H "Accept: text/event-stream" \
|
||||
-d '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "initialize",
|
||||
"params": {
|
||||
"capabilities": {},
|
||||
"protocolVersion": "2025-03-26",
|
||||
"clientInfo": {
|
||||
"name": "test",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
},
|
||||
"id": "1"
|
||||
}' \
|
||||
-i http://localhost:3000/mcp 2>&1 | grep -i "mcp-session-id" | cut -d' ' -f2 | tr -d '\r')
|
||||
echo "Session ID: $SESSION_ID"
|
||||
echo "Session ID: $SESSION_ID
|
||||
|
||||
# Then list tools using the saved session ID
|
||||
curl -X POST -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue