mcptesta/scripts/validate-setup.sh
Ryan Malloy bea4a2e5d3 Initial release: MCPTesta v1.0.0 🧪
Community-driven testing excellence for the MCP ecosystem

MCPTesta is a comprehensive testing framework for FastMCP servers that brings
scientific rigor and enterprise-grade capabilities to MCP protocol testing.

🎯 Core Features:
• Comprehensive FastMCP server testing with advanced protocol support
• Parallel execution with intelligent dependency resolution
• Flexible CLI and YAML configuration system
• Rich reporting: console, HTML, JSON, and JUnit formats
• Advanced MCP protocol features: notifications, cancellation, progress tracking
• Production-ready Docker environment with caddy-docker-proxy integration

🧪 Advanced Testing Capabilities:
• Multi-transport support (stdio, SSE, WebSocket)
• Authentication testing (Bearer tokens, OAuth flows)
• Stress testing and performance validation
• Memory profiling and leak detection
• CI/CD integration with comprehensive reporting

🎨 Professional Assets:
• Complete logo package with lab experiment theme
• Comprehensive documentation with Diátaxis framework
• Community-focused branding and messaging
• Multi-platform favicon and social media assets

📚 Documentation:
• Getting started tutorials and comprehensive guides
• Complete CLI and YAML reference documentation
• Architecture explanations and testing strategies
• Team collaboration and security compliance guides

🚀 Ready for:
• Community contributions and external development
• Enterprise deployment and production use
• Integration with existing FastMCP workflows
• Extension and customization for specific needs

Built with modern Python practices using uv, FastMCP, and Starlight documentation.
Designed for developers who demand scientific precision in their testing tools.

Repository: https://git.supported.systems/mcp/mcptesta
Documentation: https://mcptesta.l.supported.systems
2025-09-20 03:20:49 -06:00

236 lines
5.5 KiB
Bash
Executable File

#!/bin/bash
# MCPTesta Docker Setup Validation Script
# Validates the complete Docker environment setup
set -euo pipefail
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# Logging functions
log() {
echo -e "${BLUE}[INFO]${NC} $1"
}
success() {
echo -e "${GREEN}[✓]${NC} $1"
}
error() {
echo -e "${RED}[✗]${NC} $1" >&2
}
warn() {
echo -e "${YELLOW}[!]${NC} $1"
}
# Validation functions
check_dependencies() {
log "Checking dependencies..."
if ! command -v docker >/dev/null 2>&1; then
error "Docker is not installed or not in PATH"
return 1
fi
success "Docker is available"
if ! command -v docker >/dev/null 2>&1 || ! docker compose version >/dev/null 2>&1; then
error "Docker Compose is not available"
return 1
fi
success "Docker Compose is available"
if ! command -v make >/dev/null 2>&1; then
error "Make is not installed"
return 1
fi
success "Make is available"
}
check_files() {
log "Checking required files..."
local required_files=(
".env"
"docker-compose.yml"
"docker-compose.dev.yml"
"docker-compose.prod.yml"
"Makefile"
"docs/Dockerfile"
"docs/package.json"
"docs/astro.config.mjs"
"scripts/health-check.sh"
"scripts/start-docs.sh"
)
for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
error "Required file missing: $file"
return 1
fi
done
success "All required files present"
}
check_permissions() {
log "Checking file permissions..."
local executable_files=(
"scripts/health-check.sh"
"scripts/start-docs.sh"
"scripts/validate-setup.sh"
)
for file in "${executable_files[@]}"; do
if [ ! -x "$file" ]; then
error "File not executable: $file"
return 1
fi
done
success "All executable files have correct permissions"
}
check_docker_daemon() {
log "Checking Docker daemon..."
if ! docker info >/dev/null 2>&1; then
error "Docker daemon is not running or not accessible"
return 1
fi
success "Docker daemon is running"
}
check_networks() {
log "Checking Docker networks..."
if ! docker network ls | grep -q "caddy"; then
warn "Caddy network not found - will be created"
if ! docker network create caddy >/dev/null 2>&1; then
error "Failed to create caddy network"
return 1
fi
success "Caddy network created"
else
success "Caddy network exists"
fi
}
check_compose_config() {
log "Validating Docker Compose configuration..."
if ! docker compose config >/dev/null 2>&1; then
error "Docker Compose configuration is invalid"
return 1
fi
success "Docker Compose configuration is valid"
}
check_env_file() {
log "Checking environment configuration..."
if [ ! -f ".env" ]; then
error ".env file not found"
return 1
fi
# Check required environment variables
local required_vars=(
"COMPOSE_PROJECT"
"NODE_ENV"
"DOCS_DOMAIN"
"DOCS_PORT"
"DOCS_HOST"
)
for var in "${required_vars[@]}"; do
if ! grep -q "^$var=" .env; then
error "Required environment variable missing: $var"
return 1
fi
done
success "Environment configuration is valid"
}
check_docs_structure() {
log "Checking documentation structure..."
local required_docs_files=(
"docs/src"
"docs/astro.config.mjs"
"docs/package.json"
)
for item in "${required_docs_files[@]}"; do
if [ ! -e "docs/$item" ] && [ ! -e "$item" ]; then
error "Documentation structure incomplete: $item"
return 1
fi
done
success "Documentation structure is complete"
}
show_next_steps() {
echo ""
log "Setup validation completed successfully!"
echo ""
echo -e "${GREEN}Next steps:${NC}"
echo "1. Start development environment: ${BLUE}make dev${NC}"
echo "2. View logs: ${BLUE}make logs-live${NC}"
echo "3. Access documentation: ${BLUE}http://localhost:4321${NC}"
echo "4. Check container status: ${BLUE}make status${NC}"
echo ""
echo -e "${GREEN}Additional commands:${NC}"
echo "• Switch to production: ${BLUE}make env-prod && make prod${NC}"
echo "• View all commands: ${BLUE}make help${NC}"
echo "• Debug setup: ${BLUE}make debug${NC}"
echo ""
}
# Main validation routine
main() {
echo -e "${BLUE}MCPTesta Docker Setup Validation${NC}"
echo "=================================="
echo ""
# Change to project directory
cd "$(dirname "$0")/.."
# Run all validation checks
local checks=(
"check_dependencies"
"check_docker_daemon"
"check_files"
"check_permissions"
"check_env_file"
"check_docs_structure"
"check_networks"
"check_compose_config"
)
local failed=0
for check in "${checks[@]}"; do
if ! $check; then
((failed++))
fi
done
echo ""
if [ $failed -eq 0 ]; then
success "All validation checks passed!"
show_next_steps
else
error "$failed validation check(s) failed"
echo ""
echo -e "${YELLOW}Please fix the issues above and run the validation again.${NC}"
exit 1
fi
}
# Run validation
main "$@"