-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
59 lines (51 loc) · 1.29 KB
/
test.sh
File metadata and controls
59 lines (51 loc) · 1.29 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Test script for MCP HTTP Bridge
BASE_URL="http://localhost:8080"
NAMESPACE="test"
echo "=== MCP HTTP Bridge Test ==="
echo ""
# Test 1: Health check
echo "1. Testing /health endpoint..."
curl -s "$BASE_URL/health" | python3 -m json.tool 2>/dev/null || curl -s "$BASE_URL/health"
echo ""
# Test 2: Initialize
echo "2. Sending initialize request..."
curl -s -X POST "$BASE_URL/mcp/$NAMESPACE/message" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": {"name": "test-client", "version": "1.0.0"}
}
}'
echo ""
# Test 3: Tools list
echo "3. Sending tools/list request..."
curl -s -X POST "$BASE_URL/mcp/$NAMESPACE/message" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}'
echo ""
# Test 4: Tool call (echo)
echo "4. Sending tools/call (echo) request..."
curl -s -X POST "$BASE_URL/mcp/$NAMESPACE/message" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "echo",
"arguments": {"message": "Hello, MCP!"}
}
}'
echo ""
echo "=== Tests Complete ==="