Skip to main content
Glama
health-check.shโ€ข1.95 kB
#!/bin/bash set -e # Health check script for browser MCP server container # Can be used standalone or as part of Docker health checks CONTAINER_NAME="${1:-claude-browser-mcp}" TIMEOUT="${2:-10}" echo "๐Ÿ” Checking health of container: $CONTAINER_NAME" # Check if container is running if ! docker ps --format "table {{.Names}}" | grep -q "^$CONTAINER_NAME$"; then echo "โŒ Container $CONTAINER_NAME is not running" exit 1 fi # Check container health status HEALTH_STATUS=$(docker inspect --format='{{.State.Health.Status}}' "$CONTAINER_NAME" 2>/dev/null || echo "none") echo "๐Ÿฅ Health status: $HEALTH_STATUS" case "$HEALTH_STATUS" in "healthy") echo "โœ… Container is healthy" ;; "unhealthy") echo "โŒ Container is unhealthy" echo "๐Ÿ“‹ Recent health check logs:" docker inspect --format='{{range .State.Health.Log}}{{.Output}}{{end}}' "$CONTAINER_NAME" | tail -5 exit 1 ;; "starting") echo "๐Ÿ”„ Container is starting, health check in progress" ;; "none") echo "โš ๏ธ No health check configured, performing basic checks..." # Basic process check if docker exec "$CONTAINER_NAME" pgrep -f "python.*src.server" >/dev/null; then echo "โœ… MCP server process is running" else echo "โŒ MCP server process not found" exit 1 fi # Memory usage check MEMORY_USAGE=$(docker stats --no-stream --format "{{.MemPerc}}" "$CONTAINER_NAME") echo "๐Ÿ“Š Memory usage: $MEMORY_USAGE" ;; esac # Check logs for errors echo "๐Ÿ“œ Recent logs (last 10 lines):" docker logs --tail 10 "$CONTAINER_NAME" 2>&1 | head -10 # Resource usage summary echo "" echo "๐Ÿ“Š Resource usage:" docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}" "$CONTAINER_NAME" echo "โœ… Health check completed"

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/sac916/claude-browser-mcp'

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