This commit implements several key improvements to the GeoGuessr MCP server: ## MCP Server Authentication - Add Bearer token authentication for MCP server access control - New middleware in src/geoguessr_mcp/middleware/auth.py - Configuration via MCP_AUTH_ENABLED and MCP_API_KEYS environment variables - Support for multiple API keys (comma-separated) - Optional authentication - can be disabled for trusted deployments - Clients connect using Authorization: Bearer YOUR_API_KEY header ## Docker Configuration Updates - Update to use official pre-built image: nyxiumyuuki/geoguessr-mcp:latest - Remove DOCKER_USERNAME and IMAGE_TAG from environment variables - Simplify docker-compose.yml and docker-compose.prod.yml - Remove healthcheck configuration (not necessary for the deployment) ## Deployment Improvements - Move deploy.sh to scripts/deploy.sh for better organization - Update deploy.sh to use official Docker image - Add authentication validation in deployment script - Improve deployment logging and error messages ## Documentation Updates - Update README.md with authentication configuration examples - Add MCP server authentication section with setup instructions - Update environment variables table - Simplify deployment instructions - Update CLAUDE.md with new authentication architecture - Add .env.example configuration for MCP authentication ## Technical Details - Authentication middleware integrates with FastMCP's Starlette ASGI app - Middleware validates Bearer tokens on all requests except /health - Logs authentication attempts and failures - Returns proper 401/403 HTTP status codes - Validates configuration on startup to prevent misconfiguration Resolves TODO items: - [x] Fix Docker username in compose files and env vars - [x] Add authentication to MCP server to allow access only to specific users
35 lines
No EOL
807 B
YAML
35 lines
No EOL
807 B
YAML
services:
|
|
geoguessr-mcp:
|
|
# Option 1: Build locally (for development)
|
|
# build:
|
|
# context: .
|
|
# dockerfile: Dockerfile
|
|
|
|
# Option 2: Use pre-built image from Docker Hub (recommended)
|
|
image: nyxiumyuuki/geoguessr-mcp:latest
|
|
|
|
container_name: geoguessr-mcp-server
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${MCP_PORT:-8000}:8000"
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
# Persist schema cache between restarts
|
|
- geoguessr-schemas:${SCHEMA_CACHE_DIR:-/app/data/schemas}
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
networks:
|
|
- geoguessr-mcp-network
|
|
|
|
volumes:
|
|
geoguessr-schemas:
|
|
name: geoguessr-mcp-schemas
|
|
|
|
networks:
|
|
geoguessr-mcp-network:
|
|
name: geoguessr-mcp-network
|
|
driver: bridge |