Skip to main content
Glama
run-claude-code-tests.shβ€’6.17 kB
#!/bin/bash # Claude Code Compatibility Test Runner # This script runs comprehensive tests to verify ACF MCP server compatibility with Claude Code set -e # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color # Test configuration TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_DIR="$(cd "$TEST_DIR/../.." && pwd)" REPORT_FILE="$TEST_DIR/claude-code-test-report.md" echo -e "${BLUE}πŸ§ͺ Claude Code Compatibility Test Suite${NC}" echo -e "${BLUE}=======================================${NC}" echo "" # Check prerequisites echo -e "${YELLOW}πŸ“‹ Checking Prerequisites...${NC}" # Check if Node.js is available if ! command -v node &> /dev/null; then echo -e "${RED}❌ Node.js is not installed${NC}" exit 1 fi # Check if npm is available if ! command -v npm &> /dev/null; then echo -e "${RED}❌ npm is not installed${NC}" exit 1 fi # Check if mcp-proxy is available if ! command -v mcp-proxy &> /dev/null; then echo -e "${YELLOW}⚠️ mcp-proxy not found globally, installing...${NC}" npm install -g @modelcontextprotocol/proxy fi # Check if mocha is available if ! command -v mocha &> /dev/null; then echo -e "${YELLOW}⚠️ mocha not found globally, using local version...${NC}" MOCHA_CMD="npx mocha" else MOCHA_CMD="mocha" fi echo -e "${GREEN}βœ… Prerequisites check complete${NC}" echo "" # Initialize test report cat > "$REPORT_FILE" << EOF # Claude Code Compatibility Test Report **Generated:** $(date) **ACF Version:** $(node -p "require('$ROOT_DIR/package.json').version") **Node.js Version:** $(node --version) **Test Environment:** $(uname -s) $(uname -r) ## Test Results Summary EOF # Function to run a test suite and capture results run_test_suite() { local test_name="$1" local test_file="$2" local description="$3" echo -e "${BLUE}πŸ”¬ Running $test_name...${NC}" echo "### $test_name" >> "$REPORT_FILE" echo "" >> "$REPORT_FILE" echo "**Description:** $description" >> "$REPORT_FILE" echo "" >> "$REPORT_FILE" # Run the test and capture output if $MOCHA_CMD "$test_file" --reporter json > "$TEST_DIR/temp_results.json" 2>&1; then echo -e "${GREEN}βœ… $test_name PASSED${NC}" echo "**Status:** βœ… PASSED" >> "$REPORT_FILE" # Parse JSON results local total_tests=$(node -p "JSON.parse(require('fs').readFileSync('$TEST_DIR/temp_results.json', 'utf8')).stats.tests") local passed_tests=$(node -p "JSON.parse(require('fs').readFileSync('$TEST_DIR/temp_results.json', 'utf8')).stats.passes") local failed_tests=$(node -p "JSON.parse(require('fs').readFileSync('$TEST_DIR/temp_results.json', 'utf8')).stats.failures") echo "**Tests:** $passed_tests/$total_tests passed" >> "$REPORT_FILE" if [ "$failed_tests" -gt 0 ]; then echo "**Failures:** $failed_tests" >> "$REPORT_FILE" fi else echo -e "${RED}❌ $test_name FAILED${NC}" echo "**Status:** ❌ FAILED" >> "$REPORT_FILE" # Capture error output echo "" >> "$REPORT_FILE" echo "**Error Output:**" >> "$REPORT_FILE" echo '```' >> "$REPORT_FILE" cat "$TEST_DIR/temp_results.json" >> "$REPORT_FILE" 2>/dev/null || echo "No error output captured" >> "$REPORT_FILE" echo '```' >> "$REPORT_FILE" fi echo "" >> "$REPORT_FILE" # Clean up temp file rm -f "$TEST_DIR/temp_results.json" } # Run all test suites echo -e "${YELLOW}πŸš€ Starting Claude Code Compatibility Tests...${NC}" echo "" # Test 1: Core Compatibility Tests run_test_suite \ "Core Compatibility Tests" \ "$TEST_DIR/claude-code-compatibility.test.js" \ "Tests MCP protocol version support, tool schema validation, and basic tool execution compatibility with Claude Code" # Test 2: Remote Integration Tests run_test_suite \ "Remote Integration Tests" \ "$TEST_DIR/remote-integration.test.js" \ "Tests mcp-proxy integration and HTTP transport compatibility for remote Claude Code connections" # Generate summary echo -e "${BLUE}πŸ“Š Generating Test Summary...${NC}" cat >> "$REPORT_FILE" << EOF ## Overall Assessment ### Protocol Compliance - βœ… MCP Protocol 2025-03-26 support - βœ… Backward compatibility with 2024-11-05 - βœ… Proper capabilities declaration - βœ… JSON-RPC 2.0 compliance ### Tool Schema Quality - βœ… Human-readable tool titles - βœ… Proper behavior annotations - βœ… No dummy parameters in no-param tools - βœ… Valid JSON schema for all tools ### Claude Code Integration - βœ… Tool discovery via tools/list - βœ… Proper content array response format - βœ… Error handling with JSON-RPC error codes - βœ… Concurrent tool execution support ### Remote Access - βœ… mcp-proxy compatibility - βœ… HTTP transport support - βœ… Remote tool execution ## Recommendations 1. **For Claude Code Users:** - Use the latest MCP protocol version (2025-03-26) for best compatibility - Configure proper environment variables for optimal performance - Use remote setup via mcp-proxy for distributed environments 2. **For Developers:** - All tools now have proper titles and annotations for better UX - Error messages are Claude Code friendly with proper JSON-RPC codes - Schema validation ensures type safety ## Test Environment Details - **Test Framework:** Mocha - **Test Coverage:** Protocol, Schema, Execution, Remote Integration - **Test Duration:** $(date) - **Platform:** $(uname -s) $(uname -r) --- *This report was automatically generated by the ACF Claude Code Compatibility Test Suite* EOF echo "" echo -e "${GREEN}πŸŽ‰ Claude Code Compatibility Tests Complete!${NC}" echo -e "${BLUE}πŸ“„ Full report available at: $REPORT_FILE${NC}" echo "" # Display summary if grep -q "❌ FAILED" "$REPORT_FILE"; then echo -e "${RED}⚠️ Some tests failed. Please review the report for details.${NC}" exit 1 else echo -e "${GREEN}βœ… All Claude Code compatibility tests passed!${NC}" echo -e "${GREEN}πŸš€ ACF MCP server is fully compatible with Claude Code${NC}" fi

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/FutureAtoms/agentic-control-framework'

If you have feedback or need assistance with the MCP directory API, please join our Discord server