---
title: "Deploy Neo4j MCP 2.1"
description: "Official Neo4j MCP server: Text2Cypher graph queries for Claude and Cursor"
category: "AI/ML"
url: https://railway.com/deploy/neo4j-mcp-21
---

# Deploy Neo4j MCP 2.1

Official Neo4j MCP server: Text2Cypher graph queries for Claude and Cursor

**[Deploy Neo4j MCP 2.1 on Railway](https://railway.com/template/neo4j-mcp-21)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/neo4j-mcp-21/manifest.json

- **Creator:** My Projects
- **Category:** AI/ML

## Template content

### Neo4j https://cdn.jsdelivr.net/gh/selfhst/icons/svg/neo4j.svg

- **Image:** neo4j:2026.10.1-community
- **Start command:** `/bin/bash -c 'D=/data/certificates/bolt; if [ ! -s $D/private.key ] || [ ! -s $D/public.crt ]; then H=${RAILWAY_TCP_PROXY_DOMAIN:-neo4j}; mkdir -p $D && openssl req -x509 -newkey rsa:2048 -nodes -days 3650 -subj "/CN=$H" -addext "subjectAltName=DNS:$H,DNS:${RAILWAY_PRIVATE_DOMAIN:-localhost}" -keyout $D/private.key -out $D/public.crt 2>/dev/null && echo "Bolt TLS: generated a self-signed certificate for $H"; fi; chown -R neo4j:neo4j /data/certificates 2>/dev/null; chmod 600 $D/private.key; echo "Bolt TLS: certificate $(openssl x509 -noout -fingerprint -sha256 -in $D/public.crt)"; exec tini -g -- /startup/docker-entrypoint.sh neo4j'`
- **Health check:** /
- **Public domain:** Yes

### Token Proxy https://cdn.jsdelivr.net/gh/selfhst/icons/svg/caddy.svg

- **Image:** caddy:2.11.9-alpine
- **Start command:** `sh -c 'if [ ${#PROXY_TOKEN} -lt 32 ]; then echo "Token Proxy: PROXY_TOKEN must be at least 32 characters" >&2; exit 1; fi; case "$PROXY_TOKEN" in *[!A-Za-z0-9]*) echo "Token Proxy: PROXY_TOKEN must contain letters and digits only" >&2; exit 1;; esac; if [ -z "$UPSTREAM_URL" ]; then echo "Token Proxy: UPSTREAM_URL is empty" >&2; exit 1; fi; if [ -z "$NEO4J_PASSWORD" ]; then echo "Token Proxy: NEO4J_PASSWORD is empty" >&2; exit 1; fi; export NEO4J_BASIC_AUTH=$(printf "%s:%s" "$NEO4J_USER" "$NEO4J_PASSWORD" | base64 | tr -d "\n"); printf "%s\n" "$CADDYFILE" > /etc/caddy/Caddyfile && echo "Token Proxy: forwarding to $UPSTREAM_URL" && exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile'`
- **Health check:** /healthz
- **Public domain:** Yes

### Neo4j MCP https://cdn.jsdelivr.net/gh/selfhst/icons/svg/neo4j.svg

- **Image:** neo4j/mcp:v2.1.0
- **Health check:** /healthz

## Documentation

# Deploy and Host Neo4j MCP 2.1 on Railway

Neo4j MCP is the official Model Context Protocol server from Neo4j. It lets Claude, Cursor or any MCP client explore and query a Neo4j graph in plain language (Text2Cypher): the agent reads the schema, writes Cypher, runs it and answers from the results. This template runs it next to a Neo4j 2026.10 Community database, behind a bearer-token proxy.

## About Hosting Neo4j MCP 2.1

In HTTP mode the Neo4j MCP server expects every request to carry the Neo4j user and password and the database address. Here the MCP server (`neo4j/mcp:v2.1.0`) is private, and the only public service is a small Caddy proxy that requires `Authorization: Bearer ` on every request. The token is generated at deploy. The proxy then adds the Neo4j credentials and the private Bolt address itself, so your clients hold only the token, the database password stays on Railway's private network, and nobody can point the server at another database. The MCP server talks to Neo4j over Bolt encrypted with TLS. Neo4j keeps the graph on a volume, ships with APOC (needed for schema discovery) and has its memory capped (512 MB heap, 256 MB page cache). Neo4j Browser and a Bolt TCP proxy are protected by a generated password. All images are pinned. No LLM API key is needed: your MCP client's model writes the Cypher.

## Common Use Cases

- Ask questions about your graph from Claude Code, Claude Desktop, Cursor or VS Code ("Which customers bought products from more than three categories?")
- Let an agent build and update a knowledge graph with `write-cypher`, or keep it read-only with one variable
- A shared graph backend for agent frameworks (LangGraph, CrewAI, custom agents) over MCP
- Exploring and fixing data in Neo4j Browser alongside your agent

## Dependencies for Neo4j MCP 2.1 Hosting

- Neo4j MCP server 2.1.0 (`neo4j/mcp:v2.1.0`), private
- Token Proxy (`caddy:2.11.9-alpine`), public, bearer token required
- Neo4j 2026.10.1 Community with APOC (`neo4j:2026.10.1-community`), Browser and Bolt TCP proxy behind its password, Bolt TLS, volume

### Deployment Dependencies

- Neo4j MCP on GitHub: https://github.com/neo4j/mcp
- Neo4j MCP documentation: https://neo4j.com/docs/mcp/current/
- Model Context Protocol: https://modelcontextprotocol.io

### Implementation Details

After deploy, open the **Token Proxy** service's Variables tab and copy `MCP_URL` and `PROXY_TOKEN`.

Claude Code:

```bash
claude mcp add --transport http neo4j https:///mcp \
  --header "Authorization: Bearer "
```

Cursor (`~/.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "neo4j": {
      "url": "https:///mcp",
      "headers": { "Authorization": "Bearer " }
    }
  }
}
```

Claude Desktop's custom connector dialog has no field for custom headers, so use the `mcp-remote` bridge in `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "neo4j": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https:///mcp", "--header", "Authorization:${NEO4J_MCP_AUTH}"],
      "env": { "NEO4J_MCP_AUTH": "Bearer " }
    }
  }
}
```

Requests without the token get `401`. The tools are `get-schema` (labels, relationships and properties via APOC), `read-cypher` (read-only queries, writes refused) and `write-cypher`.

| Variable (Neo4j MCP service) | Default | Purpose |
|---|---|---|
| `NEO4J_MCP_READ_ONLY` | `false` | `true` hides `write-cypher` |
| `NEO4J_MCP_SCHEMA_SAMPLE_SIZE` | `100` | Nodes sampled per label by `get-schema` |
| `NEO4J_MCP_LOG_LEVEL` | `info` | `debug` logs every tool call |
| `NEO4J_MCP_TELEMETRY` | `false` | Upstream usage telemetry, off |

The token gives full database access through `write-cypher`, so share it only with clients you trust, or set `NEO4J_MCP_READ_ONLY=true`. Rotate the token by changing `PROXY_TOKEN` on the Token Proxy. Load your own data in Neo4j Browser (`BROWSER_URL` on the Neo4j service, user `neo4j`, password `DB_PASSWORD`) or with any driver through `BOLT_PUBLIC_URL` (`bolt+ssc://`).

In our test at idle, Neo4j used about 1.24 GB of RAM, the MCP server under 0.01 GB and the proxy under 0.02 GB.

## Why Deploy Neo4j MCP 2.1 on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Neo4j MCP 2.1 on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/neo4j-mcp-21
