36 lines
1.3 KiB
Bash
36 lines
1.3 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
API_KEY="114521f3f9e6858480d6269446a446ef"
|
|
URL="https://hermes.fetcherpay.com/mcp"
|
|
|
|
# Initialize
|
|
INIT_RESP=$(curl -s -D - -X POST "$URL" \
|
|
-H "Content-Type: application/json" \
|
|
-H "Accept: application/json, text/event-stream" \
|
|
-H "x-api-key: $API_KEY" \
|
|
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}')
|
|
|
|
SESSION_ID=$(echo "$INIT_RESP" | grep -i "mcp-session-id:" | awk '{print $2}' | tr -d '\r')
|
|
echo "SESSION_ID: $SESSION_ID"
|
|
|
|
# Call get_profile for gmail
|
|
PROFILE_RESP=$(curl -s -X POST "$URL" \
|
|
-H "Content-Type: application/json" \
|
|
-H "Accept: application/json, text/event-stream" \
|
|
-H "x-api-key: $API_KEY" \
|
|
-H "mcp-session-id: $SESSION_ID" \
|
|
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_profile","arguments":{"account":"gmail"}}}')
|
|
|
|
echo "PROFILE: $PROFILE_RESP"
|
|
|
|
# Call search_messages for gmail
|
|
SEARCH_RESP=$(curl -s -X POST "$URL" \
|
|
-H "Content-Type: application/json" \
|
|
-H "Accept: application/json, text/event-stream" \
|
|
-H "x-api-key: $API_KEY" \
|
|
-H "mcp-session-id: $SESSION_ID" \
|
|
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"search_messages","arguments":{"q":"test","account":"gmail","maxResults":2}}}')
|
|
|
|
echo "SEARCH: $SEARCH_RESP"
|