-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest-server.sh
More file actions
executable file
Β·50 lines (39 loc) Β· 1.33 KB
/
test-server.sh
File metadata and controls
executable file
Β·50 lines (39 loc) Β· 1.33 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
#!/usr/bin/env bash
# Test script to verify server works
set -e
echo "π§ͺ Testing DFlow MCP Server..."
# Test compilation
echo "π Checking TypeScript compilation..."
bun run tsc --noEmit
# Test server startup and tool listing
echo "π Testing server startup..."
# Send request to server and capture response
response=$(echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | timeout 10s bun run ./src/index.ts 2>/dev/null || echo "")
if [ -z "$response" ]; then
echo "β Server failed to respond"
exit 1
fi
# Check if response contains expected fields
if echo "$response" | grep -q '"tools"'; then
echo "β
Server responded with valid JSON"
# Count tools using simple string parsing
tool_count=$(echo "$response" | grep -o '"name":"' | wc -l || echo "0")
echo "π Server has $tool_count tools"
if [ "$tool_count" -gt 0 ]; then
echo "β
Tools loaded successfully"
# Show first few tool names
echo "π Sample tools:"
echo "$response" | grep -o '"name":"[^"]*"' | head -5 | cut -d'"' -f4 | tr '\n' ' '
echo ""
else
echo "β No tools found"
exit 1
fi
else
echo "β Server response missing tools field"
echo "Response preview:"
echo "$response" | head -3
exit 1
fi
echo ""
echo "π All tests passed!"