---
title: "Deploy Graphiti MCP + Neo4j"
description: "Knowledge-graph memory MCP server for AI agents, with persistent Neo4j"
category: "AI/ML"
url: https://railway.com/deploy/graphiti-mcp-neo4j
---

# Deploy Graphiti MCP + Neo4j

Knowledge-graph memory MCP server for AI agents, with persistent Neo4j

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

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

- **Creator:** Protemplate
- **Category:** AI/ML
- **Total deploys:** 5

## Template content

### Neo4j https://avatars.githubusercontent.com/u/201120?v=4

- **Image:** neo4j:5.26.30-community
- **Health check:** /

### Graphiti MCP https://avatars.githubusercontent.com/u/132832125?v=4

- **Image:** zepai/knowledge-graph-mcp:1.1.0-standalone
- **Start command:** `sh -c 'echo IyBSYWlsd2F5IGxhdW5jaGVyIGZvciB0aGUgR3JhcGhpdGkgTUNQIHNlcnZlciAoZW1iZWRkZWQgYmFzZTY0IGluIHRoZSB0ZW1wbGF0ZSBzdGFydCBjb21tYW5kKS4KIyBUaGUgc2VydmVyIGJ1aWxkcyBGYXN0TUNQIHdpdGggdGhlIFNESydzIGRlZmF1bHQgaG9zdCAxMjcuMC4wLjEsIHdoaWNoIGF1dG8tZW5hYmxlcyBETlMtcmViaW5kaW5nCiMgcHJvdGVjdGlvbiB3aXRoIGEgbG9jYWxob3N0LW9ubHkgSG9zdCBhbGxvdy1saXN0LiBCZWhpbmQgUmFpbHdheSdzIHB1YmxpYyBwcm94eSB0aGUgSG9zdCBoZWFkZXIgaXMgdGhlCiMgc2VydmljZSBkb21haW4sIHNvIGV2ZXJ5IC9tY3AgcmVxdWVzdCB3b3VsZCBnZXQgIjQyMSBJbnZhbGlkIEhvc3QgaGVhZGVyIi4gRGlzYWJsZSB0aGF0IGNoZWNrIChpdCBndWFyZHMKIyBsb2NhbGhvc3Qgc2VydmVycywgbm90IGEgcHVibGljIGVuZHBvaW50KSBhbmQgc3RhcnQgdGhlIHVwc3RyZWFtIHNlcnZlciB1bmNoYW5nZWQuCmltcG9ydCBzeXMKCnN5cy5wYXRoLmluc2VydCgwLCAiL2FwcC9tY3Avc3JjIikKaW1wb3J0IGdyYXBoaXRpX21jcF9zZXJ2ZXIgYXMgZyAgIyBub3FhOiBFNDAyCmZyb20gbWNwLnNlcnZlci50cmFuc3BvcnRfc2VjdXJpdHkgaW1wb3J0IFRyYW5zcG9ydFNlY3VyaXR5U2V0dGluZ3MgICMgbm9xYTogRTQwMgoKZy5tY3Auc2V0dGluZ3MudHJhbnNwb3J0X3NlY3VyaXR5ID0gVHJhbnNwb3J0U2VjdXJpdHlTZXR0aW5ncyhlbmFibGVfZG5zX3JlYmluZGluZ19wcm90ZWN0aW9uPUZhbHNlKQpnLm1haW4oKQo= | base64 -d > /tmp/railway-launch.py && exec uv run --no-sync python /tmp/railway-launch.py'`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Graphiti MCP with Neo4j on Railway

Graphiti is the open-source temporal knowledge graph engine from Zep. Its MCP server turns that graph into long-term memory for AI agents: `add_memory` ingests text, chat messages, or JSON and extracts entities and relationships with bi-temporal validity, and `search_memory_facts` and `search_nodes` retrieve them with hybrid semantic, keyword, and graph search. Any MCP client, including Claude Code, Cursor, VS Code, and Claude Desktop, can use it as persistent memory across sessions.

## About Hosting Graphiti MCP

Hosting the Graphiti MCP server means running the official `zepai/knowledge-graph-mcp:1.1.0-standalone` image next to a Neo4j 5.26 Community database that keeps the graph on a persistent volume. This template pins both images, selects the Neo4j backend and an IPv6 dual-stack bind through the server's own configuration overrides (no custom start command or config file mount), wires the two services together over Railway private networking, generates the Neo4j password, and uses `/health` and Neo4j's HTTP discovery endpoint for health checks. The MCP endpoint is served over streamable HTTP at `/mcp` on a public domain so remote MCP clients can connect. Graphiti needs an LLM and an embedder to extract knowledge, so an `OPENAI_API_KEY` is required at deploy time.

## Common Use Cases

- **Agent memory**: give a coding or chat agent a memory that survives sessions and keeps track of when facts became true or stale
- **User preference and requirement tracking**: Graphiti's default entity types include Preference, Requirement, Procedure, Organization, and Event
- **Team knowledge graph**: ingest meeting notes, tickets, and documents and query relationships instead of chunks
- **Multi-agent shared context**: several agents read and write the same graph, partitioned by `group_id`
- **Graph-backed RAG**: combine semantic retrieval with relationship traversal for better grounding

## Dependencies for Graphiti MCP Hosting

- **Neo4j 5.26 Community**: graph storage (included, with a `/data` volume)
- **OpenAI API key**: required at boot for the LLM, embeddings, and reranking
- **Optional providers**: Anthropic, Gemini, Groq, or Azure OpenAI for the LLM and Gemini or Voyage for embeddings, selected with `LLM__PROVIDER` and `EMBEDDER__PROVIDER`

### Deployment Dependencies

- [Graphiti MCP server documentation](https://help.getzep.com/graphiti/getting-started/mcp-server)
- [Graphiti GitHub repository](https://github.com/getzep/graphiti)
- [Neo4j Docker configuration reference](https://neo4j.com/docs/operations-manual/current/docker/ref-settings/)
- [Docker Hub image](https://hub.docker.com/r/zepai/knowledge-graph-mcp)

### Implementation Details

Key variables set by the template:

```env
# Graphiti MCP
PORT=8000
SERVER__HOST=0.0.0.0
SERVER__TRANSPORT=http
DATABASE__PROVIDER=neo4j
NEO4J_URI=${{Neo4j.GRAPH_BOLT_URL}}
NEO4J_PASSWORD=${{Neo4j.GRAPH_DB_PASSWORD}}
OPENAI_API_KEY=
MODEL_NAME=gpt-4.1-mini
GRAPHITI_TELEMETRY_ENABLED=false

# Neo4j
NEO4J_AUTH=neo4j/${{secret(32)}}
NEO4J_server_default__listen__address=::
NEO4J_server_memory_heap_max__size=512m
```

First steps after deploy:

1. Open the MCP service and copy its public URL; the endpoint is `https:///mcp` (no trailing slash; `/mcp/` redirects to an http URL).
2. Register it in your client, for example `claude mcp add --transport http graphiti https:///mcp`.
3. Ask your agent to remember something; it calls `add_memory`, and a few seconds later `search_memory_facts` returns the extracted facts.

Security note: the upstream MCP server has no authentication. Keep the URL private, or remove the public domain and connect from services inside the same Railway project through `graphiti-mcp.railway.internal:8000`, or front it with an authenticating proxy. Neo4j is never exposed publicly by this template; add a domain on port 7474 plus a TCP proxy on 7687 only if you want Neo4j Browser.

## Why Deploy Graphiti MCP 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 Graphiti MCP on Railway, you get the official MCP server and a persistent Neo4j graph pre-wired over private networking, with generated secrets, health checks, and managed SSL, ready to plug into any MCP-capable agent.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

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