feat: add MCP server validation script and fix drawio-mcp
- Add validate-mcp.sh script to test MCP servers with protocol messages - Fix drawio-mcp Dockerfile to use pnpm and correct build directory - Update drawio-mcp to use build/ instead of dist/ - Validate penpot-mcp, context7-mcp, docker-mcp, drawio-mcp working
This commit is contained in:
69
validate-mcp.sh
Executable file
69
validate-mcp.sh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
# MCP Server Validation Script
|
||||
# Tests each MCP server with actual protocol messages
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Initialize JSON message
|
||||
INIT_MSG='{"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"protocolVersion":"2024-11-05","clientInfo":{"name":"test","version":"1.0.0"}},"id":1}'
|
||||
|
||||
# Test a container with initialize message
|
||||
test_mcp_server() {
|
||||
local container_name=$1
|
||||
local timeout=${2:-5}
|
||||
|
||||
echo -e "${YELLOW}Testing $container_name...${NC}"
|
||||
|
||||
# Run container with stdin input
|
||||
result=$(timeout $timeout docker run --rm -i --name "$container_name-test" \
|
||||
"$container_name" \
|
||||
<<<"$INIT_MSG" \
|
||||
2>&1)
|
||||
|
||||
# Check for valid JSON-RPC response
|
||||
if echo "$result" | grep -q '"result"'; then
|
||||
# Check if it has server info
|
||||
if echo "$result" | grep -q '"serverInfo"'; then
|
||||
server_name=$(echo "$result" | grep -o '"name":"[^"]*"' | head -1 | cut -d'"' -f4)
|
||||
version=$(echo "$result" | grep -o '"version":"[^"]*"' | head -1 | cut -d'"' -f4)
|
||||
echo -e "${GREEN}✓ $container_name: Working ($server_name v${version})${NC}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if server requires environment variables
|
||||
if echo "$result" | grep -qi "environment variable"; then
|
||||
echo -e "${YELLOW}⚠ $container_name: Needs environment variables${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check if server needs external service
|
||||
if echo "$result" | grep -qi "connection refused\|not connected"; then
|
||||
echo -e "${YELLOW}⚠ $container_name: Needs external service (expected)${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check other errors
|
||||
echo -e "${RED}✗ $container_name: Failed${NC}"
|
||||
echo -e "${RED} Error: $(echo "$result" | head -3 | tail -1)${NC}"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Test all built containers
|
||||
echo -e "${YELLOW}=== MCP Server Validation ===${NC}\n"
|
||||
|
||||
# Stdio-based MCP servers
|
||||
test_mcp_server "kneldevstack-aimiddleware-ghost-mcp"
|
||||
test_mcp_server "kneldevstack-aimiddleware-penpot-mcp"
|
||||
test_mcp_server "kneldevstack-aimiddleware-imap-mcp"
|
||||
test_mcp_server "kneldevstack-aimiddleware-proxmox-mcp"
|
||||
test_mcp_server "kneldevstack-aimiddleware-context7-mcp"
|
||||
test_mcp_server "kneldevstack-aimiddleware-docker-mcp"
|
||||
test_mcp_server "kneldevstack-aimiddleware-drawio-mcp"
|
||||
test_mcp_server "kneldevstack-aimiddleware-mcp-redmine"
|
||||
test_mcp_server "kneldevstack-aimiddleware-nextcloud-mcp"
|
||||
|
||||
echo -e "\n${YELLOW}=== Validation Complete ===${NC}"
|
||||
Reference in New Issue
Block a user