Run the Neo4j MCP Server Locally with Docker (No Codespaces Needed) Neo4j's MCP server can now be run locally with Docker, bypassing the need for GitHub Codespaces and their free-tier limits. A docker-compose setup launches both Neo4j and the MCP server, enabling developers to test MCP tools like get-schema and read-cypher on their own machines. The guide clarifies that the MCP server is a self-hosted program connecting to any database, not a cloud service. Neo4j’s GraphAcademy course “Developing with Neo4j MCP Tools” is excellent, but it assumes you’ll run everything inside a GitHub Codespace. Codespaces have a monthly free limit, and once you hit it you’re stuck — unless you self-host. Good news: you don’t need Codespaces at all. The MCP server is just a small program, and you can run the whole stack locally with Docker in about half an hour. This guide walks through exactly that, and along the way you’ll pick up how MCP actually fits together. Everything below has been tested end-to-end. VS Code host ──HTTP /mcp + auth──► neo4j-mcp server ──Bolt──► Neo4j database Three separate pieces — and understanding the split is half the battle: A common misconception: there is no remote “MCP database” somewhere in the cloud . The MCP server is a program you run. It connects out to whatever database you point it at. That’s it. No local Python, no Neo4j install — Docker handles both. Make a project folder and drop in a docker-compose.yml: services: neo4j: image: neo4j:5.26 container name: neo4j ports: - "7474:7474" Neo4j Browser - http://localhost:7474 - "7687:7687" Bolt environment: NEO4J AUTH: "neo4j/password123" NEO4J PLUGINS: ' "apoc","graph-data-science" ' needed for get-schema + GDS tool volumes: - neo4j data:/data healthcheck: test: "CMD-SHELL", "cypher-shell -u neo4j -p password123 'RETURN 1' || exit 1" interval: 10s timeout: 10s retries: 12 start period: 30s neo4j-mcp: build: context: "https://github.com/neo4j/mcp.git v1.5.2" builds the official server from source container name: neo4j-mcp depends on: neo4j: condition: service healthy ports: - "8000:8000" MCP endpoint - http://localhost:8000/mcp environment: NEO4J URI: "bolt://neo4j:7687" NEO4J DATABASE: "neo4j" NEO4J TRANSPORT MODE: "http" networked service, not a stdio subprocess NEO4J MCP HTTP HOST: "0.0.0.0" bind all interfaces so the host can reach it NEO4J MCP HTTP PORT: "8000" must be 1024 container runs as non-root volumes: neo4j data: Two things worth knowing here: docker compose up -d --build First run pulls the Neo4j image, builds the Go MCP server, and downloads the APOC + GDS plugins. Give it a minute, then check both containers are up: docker compose ps Wait until neo4j shows healthy . The MCP endpoint is http://localhost:8000/mcp. Don't open it in a browser — you'll get Method Not Allowed: only POST is supported, which is actually a good sign the server is up; browsers just send GET . Test it properly with curl. First, confirm auth is enforced: curl -i -X POST http://localhost:8000/mcp expect 401 Unauthorized Now list the tools, authenticating with the database credentials neo4j:password123 : curl -s -u neo4j:password123 -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}' \ http://localhost:8000/mcp You should see: get-schema, read-cypher, write-cypher. The course lists four tools — the fourth is list-gds-procedures. If it's missing, don't panic. That tool is registered lazily during the MCP initialize handshake , and only if Graph Data Science is installed. A bare tools/list curl skips initialize, so it never appears that way. Send an initialize request first, then list again: curl -s -u neo4j:password123 -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"1"}},"id":1}' \ http://localhost:8000/mcp curl -s -u neo4j:password123 -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"tools/list","id":2}' \ http://localhost:8000/mcp Now all four appear. Real MCP clients like VS Code do the initialize step automatically — this only bites you with raw curl. In your project, create .vscode/mcp.json: { "servers": { "neo4j": { "type": "http", "url": "http://localhost:8000/mcp", "headers": { "Authorization": "Basic bmVvNGo6cGFzc3dvcmQxMjM=" } } }} That Authorization value is just base64 of neo4j:password123. If you change the password, regenerate it: printf 'neo4j:yourpassword' | base64 ⚠️Most common mistake:using the course’sstdioconfig "type": "stdio", "command": "neo4j-mcp" with this Docker setup. That tells VS Code to launch a local binary you don't have. For the containerized server you must use thehttpconfig above. Then in VS Code: Cmd/Ctrl + Shift + P → MCP: List Servers → select neo4j → Start Server . Open Chat in Agent mode Cmd/Ctrl + Shift + I and ask: Which MCP tools are available? List their ID and description. You’ll get all four tools back. Your local database is empty, so let’s point a second, throwaway MCP container at Neo4j’s public movies demo database — the same dataset the course uses — on a different port. This leaves your main stack untouched: docker run --rm -d --name mcp-movies \ -e NEO4J URI="neo4j+s://demo.neo4jlabs.com" \ -e NEO4J DATABASE="recommendations" \ -e NEO4J TRANSPORT MODE="http" \ -e NEO4J MCP HTTP HOST="0.0.0.0" \ -e NEO4J MCP HTTP PORT="8001" \ -p 8001:8001 \