mcp-memory-service Docker boot loop: container restarts after exit code 0
Running mcp-memory-service with the default docker-compose configuration causes a boot loop: the container initializes ChromaDB, logs "Server started and ready to handle requests", then exits with code 0 and Docker restarts it repeatedly. I changed no environment variables. How do I keep the container running?
Originally asked on GitHub: https://github.com/doobidoo/mcp-memory-service/issues/52
3 answers
Status: Fixed as of 2025-07-11 (no release version mentioned in the thread). The maintainer implemented the fix and marked the issue resolved.
The root cause, per the maintainer: the MCP server expects an active stdio connection from an MCP client. When run inside Docker without an attached MCP client, the stdio streams close immediately, the server exits gracefully with code 0, and Docker’s restart policy turns that into a boot loop.
Steps from the thread:
-
Use the standalone Compose file the maintainer added (recommended in the thread for testing/development):
bashdocker-compose -f docker-compose.standalone.yml upThis sets
MCP_STANDALONE_MODE=1and uses a persistent entrypoint script so the server stays up without an MCP client. -
Or enable standalone mode manually:
bashdocker run -d -p 8000:8000 \ -v ./data/chroma_db:/app/chroma_db \ -v ./data/backups:/app/backups \ -e MCP_STANDALONE_MODE=1 \ mcp-memory-service -
Verify the container is no longer restarting:
bashdocker ps
The maintainer also disabled ChromaDB telemetry, which removes the
Failed to send telemetry event ... capture() takes 1 positional argument but 3 were givenerrors from the logs. Standarddocker-compose upalso received improved stdio handling and better signal handling, per the thread. The reporter said they would test the fix later and had not confirmed it at the time of writing, so the fix is based on the maintainer’s closure of the issue.Did this work for you?-
What a GitHub user tried on GitHub (Didn't work)
Ran
docker-compose upwith the default configuration and no environment variable changes; observed repeated initialization, exit code 0, and restart.Source: https://github.com/doobidoo/mcp-memory-service/issues/52 (opens external site)
Did this work for you?What @doobidoo tried on GitHub (Outcome unclear)
Maintainer's fix: use
docker-compose -f docker-compose.standalone.yml upor setMCP_STANDALONE_MODE=1in a docker run command to keep the server running without an MCP client. Not yet confirmed by the reporter.Did this work for you?
Related questions
- mcp-memory-service v8.19.0: retrieve_memory and search_by_tag broken with 'tags' and 'float' errors
- mcp-memory-service: exact text only scores 60-70%? Use hybrid BM25 + vector search (v10.8.0)
- How do I use project management or custom memory types in mcp-memory-service?
- Claude Code ignores readOnlyHint for mcp-memory-service: workarounds?
- UNIQUE constraint failed: memories.content_hash after delete_memory() in mcp-memory-service