mcp_server/docker/README.md
This directory contains Docker Compose configurations for running the Graphiti MCP server with graph database backends: FalkorDB (combined image) and Neo4j.
# Default configuration (FalkorDB combined image)
docker-compose up
# Neo4j (separate containers)
docker-compose -f docker-compose-neo4j.yml up
Create a .env file in this directory with your API keys:
# Required
OPENAI_API_KEY=your-api-key-here
# Optional
GRAPHITI_GROUP_ID=main
SEMAPHORE_LIMIT=10
# Database-specific variables (see database sections below)
File: docker-compose.yml (default)
The default configuration uses a combined Docker image that bundles both FalkorDB and the MCP server together for simplified deployment.
# Environment variables
FALKORDB_URI=redis://localhost:6379 # Connection URI (services run in same container)
FALKORDB_PASSWORD= # Password (default: empty)
FALKORDB_DATABASE=default_db # Database name (default: default_db)
Backup:
docker run --rm -v mcp_server_falkordb_data:/var/lib/falkordb/data -v $(pwd):/backup alpine \
tar czf /backup/falkordb-backup.tar.gz -C /var/lib/falkordb/data .
Restore:
docker run --rm -v mcp_server_falkordb_data:/var/lib/falkordb/data -v $(pwd):/backup alpine \
tar xzf /backup/falkordb-backup.tar.gz -C /var/lib/falkordb/data
Clear Data:
docker-compose down
docker volume rm mcp_server_falkordb_data
docker-compose up
See README-falkordb-combined.md for detailed information about the combined image.
File: docker-compose-neo4j.yml
Neo4j runs as a separate container service with its own web interface.
# Environment variables
NEO4J_URI=bolt://neo4j:7687 # Connection URI (default: bolt://neo4j:7687)
NEO4J_USER=neo4j # Username (default: neo4j)
NEO4J_PASSWORD=demodemo # Password (default: demodemo)
NEO4J_DATABASE=neo4j # Database name (default: neo4j)
USE_PARALLEL_RUNTIME=false # Enterprise feature (default: false)
Default credentials: neo4j / demodemo
Backup:
# Backup both data and logs volumes
docker run --rm -v docker_neo4j_data:/data -v $(pwd):/backup alpine \
tar czf /backup/neo4j-data-backup.tar.gz -C /data .
docker run --rm -v docker_neo4j_logs:/logs -v $(pwd):/backup alpine \
tar czf /backup/neo4j-logs-backup.tar.gz -C /logs .
Restore:
# Restore both volumes
docker run --rm -v docker_neo4j_data:/data -v $(pwd):/backup alpine \
tar xzf /backup/neo4j-data-backup.tar.gz -C /data
docker run --rm -v docker_neo4j_logs:/logs -v $(pwd):/backup alpine \
tar xzf /backup/neo4j-logs-backup.tar.gz -C /logs
Clear Data:
docker-compose -f docker-compose-neo4j.yml down
docker volume rm docker_neo4j_data docker_neo4j_logs
docker-compose -f docker-compose-neo4j.yml up
To switch from FalkorDB to Neo4j (or vice versa):
Stop current setup:
docker-compose down # Stop FalkorDB combined image
# or
docker-compose -f docker-compose-neo4j.yml down # Stop Neo4j
Start new database:
docker-compose up # Start FalkorDB combined image
# or
docker-compose -f docker-compose-neo4j.yml up # Start Neo4j
Note: Data is not automatically migrated between different database types. You'll need to export from one and import to another using the MCP API.
If port 8000 is already in use:
# Find what's using the port
lsof -i :8000
# Change the port in docker-compose.yml
# Under ports section: "8001:8000"
Check logs:
docker-compose logs graphiti-mcp
Verify .env file exists and contains valid API keys:
cat .env | grep API_KEY
Ensure Docker has enough resources allocated
FalkorDB:
docker compose exec graphiti-falkordb redis-cli pingdocker compose logs graphiti-falkordbNeo4j:
docker-compose -f docker-compose-neo4j.yml logs neo4jFalkorDB:
redis-cli -h localhost pingVerify volumes are created:
docker volume ls | grep docker_
Check volume mounts in container:
docker inspect graphiti-mcp | grep -A 5 Mounts
Ensure proper shutdown:
docker-compose down # Not docker-compose down -v (which removes volumes)
FalkorDB:
SEMAPHORE_LIMIT environment variabledocker stats graphiti-falkordbdocker compose exec graphiti-falkordb redis-cli info memoryNeo4j:
Each database configuration uses named volumes for data persistence:
falkordb_dataneo4j_data, neo4j_logsAll configurations use the default bridge network. Services communicate using container names as hostnames.
No resource limits are set by default. To add limits, modify the docker-compose file:
services:
graphiti-mcp:
deploy:
resources:
limits:
cpus: '2.0'
memory: 1G
Each database has a dedicated configuration file in ../config/:
config-docker-falkordb-combined.yaml - FalkorDB combined image configurationconfig-docker-neo4j.yaml - Neo4j configurationThese files are mounted read-only into the container at /app/mcp/config/config.yaml (for combined image) or /app/config/config.yaml (for Neo4j).