Neo4j Memory-Backed Graph MCP Server Schema and Cypher
Explore Neo4j MCP server with memory-backed graph: view schema, run read/write Cypher, and configure separate graph-database-backed memory for storage.
npx -y @neo4j-contrib/mcp-neo4jOverview
The Neo4j Memory-Backed Graph MCP Server implements the MCP (Model Context Protocol) concept for Neo4j-style graph access backed by an in-memory graph store. It lets you spin up a lightweight, Cypher-capable graph instance that behaves like a Neo4j database for reads and writes without requiring a full persistent Neo4j server. That makes it convenient for rapid prototyping, tests, demos, and transient data processing where persistence is not required.
In addition to a pure in-memory mode, the server can be configured to use a separate graph-database-backed memory store so that the “memory” backing is persisted to an underlying Neo4j instance. In other words, you can choose ephemeral memory for temporary workloads or a graph-database-backed memory for longer-lived storage while still using the same MCP/Cypher interface.
Features
- In-memory Neo4j-compatible graph exposing Cypher read/write access
- Optionally backed by a separate Neo4j graph database for persistent memory
- Compatible with standard Neo4j drivers and cypher-shell for queries
- Ability to inspect schema (labels, relationship types, indexes) via standard procedures
- Lightweight server suitable for local development, CI, or demos
- Exposed MCP endpoints for integration with tools that consume MCP
Installation / Configuration
Build from source (Maven example):
Run the server from the packaged jar:
Or run via Docker (example):
Example configuration (HOCON/YAML-like; adapt to your format):
mcp {
server {
bolt {
enabled = true
address = "0.0.0.0:7687"
}
http {
enabled = true
address = "0.0.0.0:7474"
}
}
memory {
backend = "in-memory" # or "graph-db"
}
graph-db {
uri = "bolt://neo4j-host:7687"
username = "neo4j"
password = "password"
database = "neo4j" # optional for multi-db Neo4j
}
}
Configuration key summary:
| Key | Purpose |
|---|---|
| mcp.server.bolt.address | Bolt endpoint for Cypher clients |
| mcp.server.http.address | HTTP admin / MCP endpoints |
| mcp.memory.backend | “in-memory” or “graph-db” backing |
| mcp.graph-db.uri | Backend Neo4j Bolt URI (if graph-db) |
| mcp.graph-db.username/password | Credentials for backend Neo4j |
Available Resources
- GitHub repository: https://github.com/neo4j-contrib/mcp-neo4j/
- Neo4j drivers: official drivers for Java, Python, JavaScript, etc.
- Cypher shell: command-line tool for executing Cypher against Bolt endpoints
- Neo4j schema procedures: CALL db.labels(), CALL db.relationshipTypes(), CALL db.indexes(), CALL db.schema.nodeTypeProperties()
These work against the MCP server when it exposes a Neo4j-compatible Bolt endpoint.
Running Cypher: Examples
Using cypher-shell (assumes server exposes Bolt at bolt://localhost:7687):
# create nodes
# read nodes
Python example using the official neo4j driver:
=
=
=