-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-mcp.sh
More file actions
executable file
·90 lines (67 loc) · 2.03 KB
/
test-mcp.sh
File metadata and controls
executable file
·90 lines (67 loc) · 2.03 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env bash
# Test script for MCP Spec Kit server
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$SCRIPT_DIR"
echo "🧪 Testing MCP Spec Kit server..."
# Create a temporary test directory with sample prompts
TEST_DIR=$(mktemp -d)
trap "rm -rf $TEST_DIR" EXIT
echo "📁 Creating test environment in $TEST_DIR"
mkdir -p "$TEST_DIR/.kiro/prompts"
# Create sample prompt files
cat > "$TEST_DIR/.kiro/prompts/speckit.constitution.md" << 'EOF'
---
description: "Create project governing principles"
---
You are helping establish the project constitution.
$ARGUMENTS
EOF
cat > "$TEST_DIR/.kiro/prompts/speckit.specify.md" << 'EOF'
---
description: "Define requirements and user stories"
---
You are helping create specifications.
$ARGUMENTS
EOF
echo "✅ Test prompts created"
echo "🚀 Testing MCP server..."
# Test prompt discovery without importing full server
echo "Testing prompt discovery..."
cd "$TEST_DIR"
python3 << 'PYEOF'
from pathlib import Path
def find_prompts_dir():
"""Find the .kiro/prompts directory by searching up from cwd."""
current = Path.cwd()
for _ in range(5):
prompts_dir = current / ".kiro" / "prompts"
if prompts_dir.exists() and prompts_dir.is_dir():
return prompts_dir
if current.parent == current:
break
current = current.parent
return None
# Test finding prompts directory
prompts_dir = find_prompts_dir()
if not prompts_dir:
print("❌ Failed to find .kiro/prompts directory")
exit(1)
print(f"✅ Found prompts directory: {prompts_dir}")
# Test parsing prompt files
for prompt_file in prompts_dir.glob("speckit.*.md"):
print(f"✅ Found prompt: {prompt_file.name}")
print("\n🎉 All tests passed!")
PYEOF
echo ""
echo "✨ MCP Spec Kit server is working correctly!"
echo ""
echo "To use with Kiro CLI, add this to your config:"
echo ""
echo '{'
echo ' "mcpServers": {'
echo ' "speckit": {'
echo ' "command": "mcp-speckit-kiro"'
echo ' }'
echo ' }'
echo '}'