#!/bin/bash
# Script to test the MCP server locally
# Test tools/list endpoint
echo "Testing tools/list endpoint..."
curl -X POST http://localhost:5051/jsonrpc \
-H "Content-Type: application/json" \
-H "Authorization: Basic YWRtaW46Y2hhbmdlbWU=" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | jq .
# Test tools/call endpoint with get_project_structure
echo "Testing tools/call endpoint with get_project_structure..."
curl -X POST http://localhost:5051/jsonrpc \
-H "Content-Type: application/json" \
-H "Authorization: Basic YWRtaW46Y2hhbmdlbWU=" \
-d '{"jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": {"name": "get_project_structure", "parameters": {}}}' | jq .
# Test SSE endpoint
echo "Testing SSE endpoint (will run for 5 seconds)..."
curl -N -H "Authorization: Basic YWRtaW46Y2hhbmdlbWU=" http://localhost:5051/sse &
SSE_PID=$!
sleep 5
kill $SSE_PID
echo "Tests completed!"