Mcp Neo4j Memory

io.github.neo4j-contribPublished by GitHub account neo4j-contribv1.0.0Updated Oct 27, 2026

MCP Neo4j Knowledge Graph Memory Server

The publisher's own server: Memory.fit

VerifiedSTDIODesktop onlyDatabasesKnowledge & Memory

Overview

AI-generated overview

Gives an assistant a persistent knowledge-graph memory stored in Neo4j, where entities, relations and observations can be created, searched and deleted across…

What you can do
  • Read and search the memory graph: read the whole graph, search nodes by name, type or observation, or fetch specific entities by name
  • Create and delete entities with names, types and initial observations
  • Create and delete typed relations between entities
  • Add observations to existing entities or remove specific observations
  • Optionally prefix tool names with a namespace for multi-tenant setups
When to use it
Useful when you want an assistant to remember facts and their relationships across conversations or sessions, and to query that accumulated knowledge as a graph rather than a flat list. Suits users who already run or can host a Neo4j database, locally or on Neo4j Aura.
Requirements
Runs locally as a Python package (pip or uvx) or as a Docker image. Needs a reachable Neo4j instance and credentials: NEO4J_URI, NEO4J_USERNAME and NEO4J_PASSWORD, plus optional NEO4J_DATABASE and NEO4J_NAMESPACE. Default transport is stdio; HTTP and SSE modes are also available.
Before you install
Requires a Neo4j password (NEO4J_PASSWORD) and connection details, which are passed as environment variables or command-line arguments. The assistant can create and delete entities, relations and observations, so memory data can be changed or lost. If you expose the HTTP or SSE transport, restrict allowed hosts and CORS origins rather than using wildcards, and use HTTPS in production.

Installation

In SourceWeft

  1. Open Mcp Neo4j Memory in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

🧠🕸️ Neo4j Knowledge Graph Memory MCP Server

mcp-name: io.github.neo4j-contrib/mcp-neo4j-memory

🌟 Overview

A Model Context Protocol (MCP) server implementation that provides persistent memory capabilities through Neo4j graph database integration.

By storing information in a graph structure, this server maintains complex relationships between entities as memory nodes and enables long-term retention of knowledge that can be queried and analyzed across multiple conversations or sessions.

With Neo4j Aura you can host your own database server for free or share it with your collaborators. Otherwise you can run your own Neo4j server locally.

The MCP server leverages Neo4j's graph database capabilities to create an interconnected knowledge base that serves as an external memory system. Through Cypher queries, it allows exploration and retrieval of stored information, relationship analysis between different data points, and generation of insights from the accumulated knowledge. This memory can be further enhanced with Claude's capabilities.

🕸️ Graph Schema

  • Memory - A node representing an entity with a name, type, and observations.
  • Relationship - A relationship between two entities with a type.

🔍 Usage Example

Let's add some memories I, Michael, living in Dresden, Germany work at Neo4j which is headquartered in Sweden with my colleagues Andreas (Cambridge, UK) and Oskar (Gothenburg, Sweden)I work in Product Management, Oskar in Engineering and Andreas in Developer Relations.

Results in Claude calling the create_entities and create_relations tools.

[Image]

[Image]

📦 Components

🔧 Tools

The server offers these core tools:

🔎 Query Tools
  • read_graph

    • Read the entire knowledge graph
    • No input required
    • Returns: Complete graph with entities and relations
  • search_nodes

    • Search for nodes based on a query
    • Input:
      • query (string): Search query matching names, types, observations
    • Returns: Matching subgraph
  • find_nodes

    • Find specific nodes by name
    • Input:
      • names (array of strings): Entity names to retrieve
    • Returns: Subgraph with specified nodes
♟️ Entity Management Tools
  • create_entities

    • Create multiple new entities in the knowledge graph
    • Input:
      • entities: Array of objects with:
        • name (string): Name of the entity
        • type (string): Type of the entity
        • observations (array of strings): Initial observations about the entity
    • Returns: Created entities
  • delete_entities

    • Delete multiple entities and their associated relations
    • Input:
      • entityNames (array of strings): Names of entities to delete
    • Returns: Success confirmation
🔗 Relation Management Tools
  • create_relations

    • Create multiple new relations between entities
    • Input:
      • relations: Array of objects with:
        • source (string): Name of source entity
        • target (string): Name of target entity
        • relationType (string): Type of relation
    • Returns: Created relations
  • delete_relations

    • Delete multiple relations from the graph
    • Input:
      • relations: Array of objects with same schema as create_relations
    • Returns: Success confirmation
📝 Observation Management Tools
  • add_observations

    • Add new observations to existing entities
    • Input:
      • observations: Array of objects with:
        • entityName (string): Entity to add to
        • contents (array of strings): Observations to add
    • Returns: Added observation details
  • delete_observations

    • Delete specific observations from entities
    • Input:
      • deletions: Array of objects with:
        • entityName (string): Entity to delete from
        • observations (array of strings): Observations to remove
    • Returns: Success confirmation

🔧 Usage with Claude Desktop

💾 Installation

bash
pip install mcp-neo4j-memory

⚙️ Configuration

Add the server to your claude_desktop_config.json with configuration of:

json
"mcpServers": {  "neo4j": {    "command": "uvx",    "args": [      "[email protected]",      "--db-url",      "neo4j+s://xxxx.databases.neo4j.io",      "--username",      "<your-username>",      "--password",      "<your-password>"    ]  }}

Alternatively, you can set environment variables:

json
"mcpServers": {  "neo4j": {    "command": "uvx",    "args": [ "[email protected]" ],    "env": {      "NEO4J_URL": "neo4j+s://xxxx.databases.neo4j.io",      "NEO4J_USERNAME": "<your-username>",      "NEO4J_PASSWORD": "<your-password>"    }  }}
Namespacing

For multi-tenant deployments, add --namespace to prefix tool names:

json
"args": [ "[email protected]", "--namespace", "myapp", "--db-url", "..." ]

Tools become: myapp-read_graph, myapp-create_entities, etc.

Can also use NEO4J_NAMESPACE environment variable.

🌐 HTTP Transport Mode

The server supports HTTP transport for web-based deployments and microservices:

bash
# Basic HTTP mode (defaults: host=127.0.0.1, port=8000, path=/mcp/)mcp-neo4j-memory --transport http
# Custom HTTP configurationmcp-neo4j-memory --transport http --host 127.0.0.1 --port 8080 --path /mcp/

Environment variables for HTTP configuration:

bash
export NEO4J_TRANSPORT=httpexport NEO4J_MCP_SERVER_HOST=127.0.0.1export NEO4J_MCP_SERVER_PORT=8080export NEO4J_MCP_SERVER_PATH=/mcp/export NEO4J_NAMESPACE=myappmcp-neo4j-memory

🔄 Transport Modes

The server supports three transport modes:

  • STDIO (default): Standard input/output for local tools and Claude Desktop
  • SSE: Server-Sent Events for web-based deployments
  • HTTP: Streamable HTTP for modern web deployments and microservices

🐳 Using with Docker

json
"mcpServers": {  "neo4j": {    "command": "docker",    "args": [      "run",      "--rm",      "-e", "NEO4J_URL=neo4j+s://xxxx.databases.neo4j.io",      "-e", "NEO4J_USERNAME=<your-username>",      "-e", "NEO4J_PASSWORD=<your-password>",      "mcp/neo4j-memory:0.4.5"    ]  }}

🔒 Security Protection

The server includes comprehensive security protection with secure defaults that protect against common web-based attacks while preserving full MCP functionality when using HTTP transport.

🛡️ DNS Rebinding Protection

TrustedHost Middleware validates Host headers to prevent DNS rebinding attacks:

Secure by Default:

  • Only localhost and 127.0.0.1 hosts are allowed by default

Environment Variable:

bash
export NEO4J_MCP_SERVER_ALLOWED_HOSTS="example.com,www.example.com"

🌐 CORS Protection

Cross-Origin Resource Sharing (CORS) protection blocks browser-based requests by default:

Environment Variable:

bash
export NEO4J_MCP_SERVER_ALLOW_ORIGINS="https://example.com,https://app.example.com"

🔧 Complete Security Configuration

Development Setup:

bash
mcp-neo4j-memory --transport http \  --allowed-hosts "localhost,127.0.0.1" \  --allow-origins "http://localhost:3000"

Production Setup:

bash
mcp-neo4j-memory --transport http \  --allowed-hosts "example.com,www.example.com" \  --allow-origins "https://example.com,https://app.example.com"

🚨 Security Best Practices

For allow_origins:

  • Be specific: ["https://example.com", "https://example.com"]
  • Never use "*" in production with credentials
  • Use HTTPS origins in production

For allowed_hosts:

  • Include your actual domain: ["example.com", "www.example.com"]
  • Include localhost only for development
  • Never use "*" unless you understand the risks

🐳 Docker Deployment

The Neo4j Memory MCP server can be deployed using Docker for remote deployments. Docker deployment should use HTTP transport for web accessibility. In order to integrate this deployment with applications like Claude Desktop, you will have to use a proxy in your MCP configuration such as mcp-remote.

📦 Using Your Built Image

After building locally with docker build -t mcp-neo4j-memory:latest .:

bash
# Run with http transport (default for Docker)docker run --rm -p 8000:8000 \  -e NEO4J_URI="bolt://host.docker.internal:7687" \  -e NEO4J_USERNAME="neo4j" \  -e NEO4J_PASSWORD="password" \  -e NEO4J_DATABASE="neo4j" \  -e NEO4J_TRANSPORT="http" \  -e NEO4J_MCP_SERVER_HOST="0.0.0.0" \  -e NEO4J_MCP_SERVER_PORT="8000" \  -e NEO4J_MCP_SERVER_PATH="/mcp/" \  mcp/neo4j-memory:latest
# Run with security middleware for productiondocker run --rm -p 8000:8000 \  -e NEO4J_URI="bolt://host.docker.internal:7687" \  -e NEO4J_USERNAME="neo4j" \  -e NEO4J_PASSWORD="password" \  -e NEO4J_DATABASE="neo4j" \  -e NEO4J_TRANSPORT="http" \  -e NEO4J_MCP_SERVER_HOST="0.0.0.0" \  -e NEO4J_MCP_SERVER_PORT="8000" \  -e NEO4J_MCP_SERVER_PATH="/mcp/" \  -e NEO4J_MCP_SERVER_ALLOWED_HOSTS="example.com,www.example.com" \  -e NEO4J_MCP_SERVER_ALLOW_ORIGINS="https://example.com" \  mcp/neo4j-memory:latest

🔧 Environment Variables

VariableDefaultDescription
NEO4J_URIbolt://localhost:7687Neo4j connection URI
NEO4J_USERNAMEneo4jNeo4j username
NEO4J_PASSWORDpasswordNeo4j password
NEO4J_DATABASEneo4jNeo4j database name
NEO4J_TRANSPORTstdio (local), http (remote)Transport protocol (stdio, http, or sse)
NEO4J_MCP_SERVER_HOST127.0.0.1 (local)Host to bind to
NEO4J_MCP_SERVER_PORT8000Port for HTTP/SSE transport
NEO4J_MCP_SERVER_PATH/mcp/Path for accessing MCP server
NEO4J_MCP_SERVER_ALLOW_ORIGINS(empty - secure by default)Comma-separated list of allowed CORS origins
NEO4J_MCP_SERVER_ALLOWED_HOSTSlocalhost,127.0.0.1Comma-separated list of allowed hosts (DNS rebinding protection)
NEO4J_NAMESPACE(empty - no prefix)Namespace prefix for tool names (e.g., myapp-read_graph)

🌐 SSE Transport for Legacy Web Access

When using SSE transport (for legacy web clients), the server exposes an HTTP endpoint:

bash
# Start the server with SSE transportdocker run -d -p 8000:8000 \  -e NEO4J_URI="neo4j+s://demo.neo4jlabs.com" \  -e NEO4J_USERNAME="recommendations" \  -e NEO4J_PASSWORD="recommendations" \  -e NEO4J_DATABASE="neo4j" \  -e NEO4J_TRANSPORT="sse" \  -e NEO4J_MCP_SERVER_HOST="0.0.0.0" \  -e NEO4J_MCP_SERVER_PORT="8000" \  --name neo4j-memory-mcp-server \  mcp-neo4j-memory:latest
# Test the SSE endpointcurl http://localhost:8000/sse
# Use with MCP Inspectornpx @modelcontextprotocol/inspector http://localhost:8000/sse

🚀 Development

📦 Prerequisites

  1. Install uv (Universal Virtualenv):
bash
# Using pippip install uv
# Using Homebrew on macOSbrew install uv
# Using cargo (Rust package manager)cargo install uv
  1. Clone the repository and set up development environment:
bash
# Clone the repositorygit clone https://github.com/yourusername/mcp-neo4j-memory.gitcd mcp-neo4j-memory
# Create and activate virtual environment using uvuv venvsource .venv/bin/activate  # On Unix/macOS.venv\Scripts\activate     # On Windows
# Install dependencies including dev dependenciesuv pip install -e ".[dev]"

🐳 Docker

Build and run the Docker container:

bash
# Build the imagedocker build -t mcp/neo4j-memory:latest .
# Run the containerdocker run -e NEO4J_URL="neo4j+s://xxxx.databases.neo4j.io" \          -e NEO4J_USERNAME="your-username" \          -e NEO4J_PASSWORD="your-password" \          mcp/neo4j-memory:latest

📄 License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Source: servers/mcp-neo4j-memory/README.md at commit 1c7ad07

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Memory integrations