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:
2026-01-22 15:14:00 -05:00
parent aefeaa30fc
commit 1b01b3303b
3 changed files with 77 additions and 6 deletions

View File

@@ -422,12 +422,11 @@ services:
image: kneldevstack-aimiddleware-drawio-mcp image: kneldevstack-aimiddleware-drawio-mcp
build: build:
context: ./vendor/drawio-mcp-server context: ./vendor/drawio-mcp-server
dockerfile: Dockerfile dockerfile: ../../dockerfiles/drawio-mcp/Dockerfile
container_name: kneldevstack-aimiddleware-drawio-mcp container_name: kneldevstack-aimiddleware-drawio-mcp
restart: unless-stopped restart: unless-stopped
environment: environment:
- DRAWIO_URL=${DRAWIO_URL:-https://app.diagrams.net} - DRAWIO_URL=${DRAWIO_URL:-https://app.diagrams.net}
command: ["npx", "-y", "drawio-mcp-server"]
profiles: profiles:
- dev - dev

View File

@@ -1,13 +1,16 @@
FROM node:22-alpine FROM node:22-alpine
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json* ./ COPY package.json pnpm-lock.yaml ./
RUN npm ci RUN pnpm install --frozen-lockfile
COPY . . COPY . .
RUN npm run build RUN pnpm run build
CMD ["node", "dist/index.js"] CMD ["node", "build/index.js"]

69
validate-mcp.sh Executable file
View 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}"