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
127 lines
2.8 KiB
Bash
Executable File
127 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
# MCPTesta Documentation Startup Script
|
|
# Handles initialization and 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' # No Color
|
|
|
|
# Logging function
|
|
log() {
|
|
echo -e "${BLUE}[$(date +'%Y-%m-%d %H:%M:%S')]${NC} $1"
|
|
}
|
|
|
|
error() {
|
|
echo -e "${RED}[ERROR]${NC} $1" >&2
|
|
}
|
|
|
|
success() {
|
|
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
}
|
|
|
|
warn() {
|
|
echo -e "${YELLOW}[WARN]${NC} $1"
|
|
}
|
|
|
|
# Environment setup
|
|
NODE_ENV=${NODE_ENV:-development}
|
|
HOST=${HOST:-0.0.0.0}
|
|
PORT=${PORT:-4321}
|
|
|
|
log "Starting MCPTesta Documentation Server"
|
|
log "Environment: $NODE_ENV"
|
|
log "Host: $HOST"
|
|
log "Port: $PORT"
|
|
|
|
# Ensure we're in the correct directory
|
|
cd /app
|
|
|
|
# Check if node_modules exists
|
|
if [ ! -d "node_modules" ]; then
|
|
warn "node_modules not found, installing dependencies..."
|
|
npm ci
|
|
success "Dependencies installed"
|
|
fi
|
|
|
|
# Check if package.json exists
|
|
if [ ! -f "package.json" ]; then
|
|
error "package.json not found in /app"
|
|
exit 1
|
|
fi
|
|
|
|
# Validate Astro configuration
|
|
if [ ! -f "astro.config.mjs" ]; then
|
|
error "astro.config.mjs not found"
|
|
exit 1
|
|
fi
|
|
|
|
# Health check function
|
|
health_check() {
|
|
local max_attempts=30
|
|
local attempt=1
|
|
|
|
log "Waiting for server to be ready..."
|
|
|
|
while [ $attempt -le $max_attempts ]; do
|
|
if curl -f -s "http://localhost:$PORT/" > /dev/null 2>&1; then
|
|
success "Server is ready!"
|
|
return 0
|
|
fi
|
|
|
|
log "Attempt $attempt/$max_attempts - Server not ready yet..."
|
|
sleep 2
|
|
((attempt++))
|
|
done
|
|
|
|
error "Server failed to start within expected time"
|
|
return 1
|
|
}
|
|
|
|
# Start server based on environment
|
|
if [ "$NODE_ENV" = "development" ]; then
|
|
log "Starting development server with hot reloading..."
|
|
|
|
# Start server in background for health check
|
|
npm run dev:verbose -- --host "$HOST" --port "$PORT" &
|
|
SERVER_PID=$!
|
|
|
|
# Wait for server to be ready
|
|
if health_check; then
|
|
success "Development server started successfully"
|
|
# Bring server to foreground
|
|
wait $SERVER_PID
|
|
else
|
|
error "Failed to start development server"
|
|
kill $SERVER_PID 2>/dev/null || true
|
|
exit 1
|
|
fi
|
|
|
|
elif [ "$NODE_ENV" = "production" ]; then
|
|
log "Building production assets..."
|
|
|
|
# Clean previous builds
|
|
npm run clean
|
|
|
|
# Build for production
|
|
npm run build:prod
|
|
|
|
if [ ! -d "dist" ]; then
|
|
error "Production build failed - dist directory not found"
|
|
exit 1
|
|
fi
|
|
|
|
success "Production build completed"
|
|
log "Starting production server..."
|
|
|
|
# Start preview server
|
|
npm run preview -- --host "$HOST" --port "$PORT"
|
|
|
|
else
|
|
error "Unknown NODE_ENV: $NODE_ENV (expected: development or production)"
|
|
exit 1
|
|
fi |