Overview
Run the complete MCP Server with LangGraph stack locally with Docker Compose for development and testing. Includes all services: agent, OpenFGA, OpenTelemetry, Jaeger, Prometheus, and Grafana.Quick Setup: Get the full stack running in 2 minutes with one script.
Quick Start
One-Command Setup
- Check prerequisites (Docker, Docker Compose)
- Create
.envfrom template if needed - Validate configuration
- Build and start all services
- Wait for health checks
- Display service URLs
All services running! Agent, OpenFGA, Jaeger, Prometheus, and Grafana are now available.
Manual Setup
1
Create .env file
.env and add your API keys:2
Start services
3
Verify health
Services
Agent API
OpenFGA
Jaeger
Prometheus
Grafana
PostgreSQL
Port: 5432OpenFGA databaseInternal use
Development Mode
Use development mode for hot reload and debugging:- 🔄 Hot reload - Code changes restart server automatically
- 🐛 Debug logging - LOG_LEVEL=DEBUG
- 📁 Volume mounts - Local code mounted in container
- 🔍 Debugger port - Port 5678 for debugpy
Hot Reload Example
Testing
Run Tests
Test Agent Endpoint
Configuration
Environment Variables
Configure via.env file:
Service URLs (Docker Compose)
Services communicate via Docker network:Custom Configuration
Override settings with environment variables:Observability
View Traces in Jaeger
1
Open Jaeger UI
Go to http://localhost:16686
2
Select Service
Choose
mcp-server-langgraph from dropdown3
Find Traces
Click “Find Traces” to see all requests with timing
4
Analyze
Click on trace to see:
- LLM calls with prompts
- Tool invocations
- Timing breakdown
- Error details
Prometheus Metrics
View metrics at http://localhost:9090:Grafana Dashboards
Access at http://localhost:3001 (admin/admin): Pre-configured datasources:- Prometheus - Metrics
- Jaeger - Traces
- Request volume and latency
- Error rates
- LLM token usage
- System resources
OpenFGA Setup
Set up authorization model:Common Commands
Start services
Start services
View logs
View logs
Stop services
Stop services
Debug service
Debug service
Restart service
Restart service
Scale services
Scale services
Troubleshooting
Agent service fails to start
Agent service fails to start
Check logs:Common causes:
- Missing API key in
.env - Invalid API key
- Port 8000 already in use
- OpenFGA not ready
Port conflicts
Port conflicts
Symptom:
Bind for 0.0.0.0:8000 failed: port is already allocatedSolution: Change ports in docker-compose.yml:Services can't communicate
Services can't communicate
Symptom: Solution: Ensure all services use
Connection refused errorsCheck:networks: [observability]Slow build times
Slow build times
Solutions:
- Use BuildKit:
DOCKER_BUILDKIT=1 docker compose build - Cache dependencies: Mount pip cache
- Use lighter base images: Already using
python:3.12-slim
Out of disk space
Out of disk space
Clean up:
Production Considerations
For production, use:- LangGraph Platform - Serverless, managed hosting
- Cloud Run - Serverless GCP deployment
- Kubernetes - Production-grade orchestration
Why Not Docker Compose in Production?
| Feature | Docker Compose | Production Platforms |
|---|---|---|
| Scaling | Manual, single host | Auto-scaling, multi-host |
| High Availability | ❌ Single point of failure | ✅ Replicas, health checks |
| Load Balancing | ❌ Limited | ✅ Built-in |
| Secrets | ⚠️ Environment files | ✅ Encrypted, rotated |
| Monitoring | ⚠️ Basic | ✅ Enterprise-grade |
| Updates | ⚠️ Manual, downtime | ✅ Rolling, zero-downtime |
Next Steps
Setup OpenFGA
Configure authorization
Run Tests
Test your changes
Deploy to Cloud
Deploy to production
Monitoring
Set up observability
Ready to develop? Run
./scripts/setup/docker-compose-quickstart.sh to start coding!