#!/bin/bash # Test MCPF dual-layer trust integration - Initialize stage # Shows the complete initialize response including _meta set -e echo "==========================================" echo "MCPF Initialize Response Test" echo "==========================================" echo "" # Test against localhost (assuming server is running) MCP_ENDPOINT="${MCP_ENDPOINT:-http://localhost:8787/mcp}" echo "Testing endpoint: $MCP_ENDPOINT" echo "" # Send initialize request echo "Sending initialize request..." RESPONSE=$(curl -s -X POST "$MCP_ENDPOINT" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{ "jsonrpc": "2.0", "method": "initialize", "params": { "protocolVersion": "2025-03-26", "capabilities": {}, "clientInfo": { "name": "mcpf-test-client", "version": "1.0" } }, "id": 1 }' \ --max-time 5) echo "" echo "==========================================" echo "Raw Response (SSE format):" echo "==========================================" echo "$RESPONSE" echo "" # Extract and pretty-print the JSON from SSE data line echo "==========================================" echo "Parsed JSON Response:" echo "==========================================" echo "$RESPONSE" | grep '^data:' | sed 's/^data: //' | jq '.' echo "" echo "==========================================" echo "MCPF _meta Section:" echo "==========================================" echo "$RESPONSE" | grep '^data:' | sed 's/^data: //' | jq '.result._meta' echo "" echo "==========================================" echo "Layer 1 Trust Metadata Details:" echo "==========================================" echo "" echo "Identity DID:" echo "$RESPONSE" | grep '^data:' | sed 's/^data: //' | jq -r '.result._meta.identity.id' echo "" echo "MCPF Version:" echo "$RESPONSE" | grep '^data:' | sed 's/^data: //' | jq -r '.result._meta.mcpf.version' echo "" echo "Trust Verifications:" echo "$RESPONSE" | grep '^data:' | sed 's/^data: //' | jq '.result._meta.trust.verifications[]' echo "" echo "==========================================" echo "Test Complete" echo "=========================================="