Neo4j Data Modeling

Databases

A simple Neo4j MCP server for creating graph data models.

Your AI app calls the Neo4j Data Modeling MCP server, which does the work through tools like validate_node, validate_relationship, validate_data_model and get_mermaid_config_str and sends the result back to the chat.

About Neo4j Data Modeling

Neo4j Data Modeling is a community MCP server from neo4j-contrib, filed in our directory under databases. A simple Neo4j MCP server for creating graph data models.

Neo4j Data Modeling runs on your own machine: your AI app starts it with the command uvx mcp-neo4j-data-modeling==0.6.1 and talks to it over standard input and output.

The README for Neo4j Data Modeling lists tools such as validate_node, validate_relationship, validate_data_model and get_mermaid_config_str, which your AI app can call once the server is connected.

Neo4j Data Modeling is listed in the official MCP registry as io.github.neo4j-contrib/mcp-neo4j-data-modeling, version 1.0.0.

At a glance

Publisher
neo4j-contrib (community)
Runs
Locally on your machine
Install from
Python package on PyPI: mcp-neo4j-data-modeling
Written in
Python
License
MIT
GitHub stars
994
Official MCP registry
io.github.neo4j-contrib/mcp-neo4j-data-modeling

Tools Neo4j Data Modeling gives your AI app

  • validate_node
  • validate_relationship
  • validate_data_model
  • get_mermaid_config_str
  • load_from_arrows_json
  • export_to_arrows_json
  • load_from_owl_turtle
  • export_to_owl_turtle
  • export_to_pydantic_models
  • export_to_neo4j_graphrag_pkg_schema
  • load_from_neo4j_graphrag_pkg_schema
  • list_example_data_models
  • get_example_data_model
  • get_constraints_cypher_queries
  • get_node_cypher_ingest_query
  • get_relationship_cypher_ingest_query

Tool names as the Neo4j Data Modeling README lists them. Your AI app shows the live list once Neo4j Data Modeling is connected.

How to set up Neo4j Data Modeling

  1. Install uv on the machine that runs your AI app, because Neo4j Data Modeling starts with uvx and fetches its Python package on first run.
  2. Check the Neo4j Data Modeling README for keys or settings; the registry lists none that Neo4j Data Modeling requires.
  3. Add Neo4j Data Modeling to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Neo4j Data Modeling tools to confirm the connection.
  5. Run one read-only task with Neo4j Data Modeling first, such as a call to validate_node, before you allow anything that writes or sends.

Neo4j Data Modeling compared with similar servers

  • Neo4j Memory by neo4j-contrib has fewer GitHub stars than Neo4j Data Modeling (994 against 994); both are community servers, and both run locally. The Neo4j Memory README lists 9 tools to Neo4j Data Modeling's 16.
  • Neo4j Cypher by neo4j-contrib has fewer GitHub stars than Neo4j Data Modeling (994 against 994); both are community servers, and both run locally. The Neo4j Cypher README lists 3 tools to Neo4j Data Modeling's 16.
  • Universal DB by Anarkh-Lee has fewer GitHub stars than Neo4j Data Modeling (943 against 994); both are community servers, and both run locally.

Before you connect Neo4j Data Modeling

  • Give Neo4j Data Modeling its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Neo4j Data Modeling tool call until you trust what it does with them.
  • Treat text that Neo4j Data Modeling fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Neo4j Data Modeling on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Neo4j Data Modeling

How marketing and sales teams put Neo4j Data Modeling to work, by company size. Pick the size closest to yours and start Neo4j Data Modeling on one use case.

Small business

  • A small business with its own app can ask Neo4j Data Modeling plain questions about customers and orders, without writing SQL.
  • Owners can use Neo4j Data Modeling to pull a list of customers who haven't bought in 90 days and plan a win-back email.
  • Neo4j Data Modeling runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing analysts can connect Neo4j Data Modeling to answer campaign questions from the warehouse directly, instead of waiting on the data team's queue.
  • Lifecycle teams can use Neo4j Data Modeling to build audience lists from product data and check counts before a send.
  • Start with validate_node and validate_relationship, the tools Neo4j Data Modeling lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises should point Neo4j Data Modeling at a read replica with a read-only role, so agents query freely without risk to production data.
  • Data teams can expose curated views through Neo4j Data Modeling, so marketing gets self-serve answers without access to raw customer tables.
  • Neo4j Data Modeling is a community server, so have security review the code and pin a version before Neo4j Data Modeling touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Neo4j Data Modeling README

From neo4j-contrib/mcp-neo4j on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

🔍📊 Neo4j Data Modeling MCP Server

mcp-name: io.github.neo4j-contrib/mcp-neo4j-data-modeling

🌟 Overview

A Model Context Protocol (MCP) server implementation that provides tools for creating, visualizing, and managing Neo4j graph data models. This server enables you to define nodes, relationships, and properties to design graph database schemas that can be visualized interactively.

This MCP server facilitates data modeling workflows like the one detailed below.

  • Blue steps are handled by the agent
  • Purple by the Data Modeling MCP server
  • Green by the user

Demo

For an end to end demo using the Data Modeling and Cypher MCP servers to develop a data model, generate an ingest script, and validate use cases please check out this Github Repo.

🧩 Components

📦 Resources

The server provides these resources:

Schema
  • resource://schema/node

    • Get the JSON schema for a Node object
    • Returns: JSON schema defining the structure of a Node
  • resource://schema/relationship

    • Get the JSON schema for a Relationship object
    • Returns: JSON schema defining the structure of a Relationship
  • resource://schema/property

    • Get the JSON schema for a Property object
    • Returns: JSON schema defining the structure of a Property
  • resource://schema/data_model

    • Get the JSON schema for a DataModel object
    • Returns: JSON schema defining the structure of a DataModel
Example Data Models
  • resource://examples/patient_journey_model

    • Get a real-world Patient Journey healthcare data model in JSON format
    • Returns: JSON DataModel for tracking patient encounters, conditions, medications, and care plans
  • resource://examples/supply_chain_model

    • Get a real-world Supply Chain data model in JSON format
    • Returns: JSON DataModel for tracking products, orders, inventory, and locations
  • resource://examples/software_dependency_model

    • Get a real-world Software Dependency Graph data model in JSON format
    • Returns: JSON DataModel for software dependency tracking with security vulnerabilities, commits, and contributor analysis
  • resource://examples/oil_gas_monitoring_model

    • Get a real-world Oil and Gas Equipment Monitoring data model in JSON format
    • Returns: JSON DataModel for industrial monitoring of oil and gas equipment, sensors, alerts, and maintenance
  • resource://examples/customer_360_model

    • Get a real-world Customer 360 data model in JSON format
    • Returns: JSON DataModel for customer relationship management with accounts, contacts, orders, tickets, and surveys
  • resource://examples/fraud_aml_model

    • Get a real-world Fraud & AML data model in JSON format
    • Returns: JSON DataModel for financial fraud detection and anti-money laundering with customers, transactions, alerts, and compliance
  • resource://examples/health_insurance_fraud_model

    • Get a real-world Health Insurance Fraud Detection data model in JSON format
    • Returns: JSON DataModel for healthcare fraud detection tracking investigations, prescriptions, executions, and beneficiary relationships
Ingest
  • resource://neo4j_data_ingest_process
    • Get a detailed explanation of the recommended process for ingesting data into Neo4j using the data model
    • Returns: Markdown document explaining the ingest process
🛠️ Tools

The server offers these core tools:

✅ Validation Tools
  • validate_node

    • Validate a single node structure
    • Input:
      • node (Node): The node to validate
      • return_validated (bool, optional): If True, returns the validated node object instead of True
    • Returns: True if valid (or validated Node object if return_validated=True), raises ValueError if invalid
  • validate_relationship

    • Validate a single relationship structure
    • Input:
      • relationship (Relationship): The relationship to validate
      • return_validated (bool, optional): If True, returns the validated relationship object instead of True
    • Returns: True if valid (or validated Relationship object if return_validated=True), raises ValueError if invalid
  • validate_data_model

    • Validate the entire data model structure
    • Input:
      • data_model (DataModel): The data model to validate
      • return_validated (bool, optional): If True, returns the validated data model object instead of True
    • Returns: True if valid (or validated DataModel object if return_validated=True), raises ValueError if invalid
👁️ Visualization Tools
  • get_mermaid_config_str
    • Generate a Mermaid diagram configuration string for the data model, suitable for visualization in tools that support Mermaid
    • Input:
      • data_model (DataModel): The data model to visualize
    • Returns: Mermaid configuration string representing the data model
🔄 Import/Export Tools

These tools provide integration with Arrows - a graph drawing web application for creating detailed Neo4j data models with an intuitive visual interface.

  • load_from_arrows_json

    • Load a data model from Arrows app JSON format
    • Input:
      • arrows_data_model_dict (dict): JSON dictionary from Arrows app export
    • Returns: DataModel object
  • export_to_arrows_json

    • Export a data model to Arrows app JSON format
    • Input:
      • data_model (DataModel): The data model to export
    • Returns: JSON string compatible with Arrows app
  • load_from_owl_turtle

    • Load a data model from OWL Turtle format
    • Input:
      • owl_turtle_str (str): OWL Turtle string representation of an ontology
    • Returns: DataModel object with nodes and relationships extracted from the ontology
    • Note: This conversion is lossy - OWL Classes become Nodes, ObjectProperties become Relationships, and DatatypeProperties become Node properties.
  • export_to_owl_turtle

    • Export a data model to OWL Turtle format
    • Input:
      • data_model (DataModel): The data model to export
    • Returns: String representation of the data model in OWL Turtle format
    • Note: This conversion is lossy - Relationship properties are not preserved since OWL does not support properties on ObjectProperties
  • export_to_pydantic_models

    • Export a data model to Pydantic models
    • Input:
      • data_model (DataModel): The data model to export
    • Returns: String representation of the Pydantic models as a Python file, including imports and model definitions for nodes, relationships, and the complete data model
  • export_to_neo4j_graphrag_pkg_schema

    • Export a data model to Neo4j GraphRAG Python Package schema format
    • Input:
      • data_model (DataModel): The data model to export
    • Returns: Dictionary containing the Neo4j GraphRAG Python Package schema
  • load_from_neo4j_graphrag_pkg_schema

    • Load a data model from Neo4j GraphRAG Python Package schema format
    • Input:
      • neo4j_graphrag_python_package_schema (dict): Neo4j GraphRAG Python Package schema dictionary
    • Returns: DataModel object
📚 Example Data Model Tools

These tools provide access to pre-built example data models for common use cases and domains.

  • list_example_data_models

    • List all available example data models with descriptions
    • Input: None
    • Returns: Dictionary with example names, descriptions, node/relationship counts, and usage instructions
  • get_example_data_model

    • Get an example graph data model from the available templates
    • Input:
      • example_name (str): Name of the example to load ('patient_journey', 'supply_chain', 'software_dependency', 'oil_gas_monitoring', 'customer_360', 'fraud_aml', or 'health_insurance_fraud')
    • Returns: ExampleDataModelResponse containing DataModel object and Mermaid visualization configuration
📝 Cypher Ingest Tools

These tools may be used to create Cypher ingest queries based on the data model. These queries may then be used by other MCP servers or applications to load data into Neo4j.

  • get_constraints_cypher_queries

    • Generate Cypher queries to create constraints (e.g., unique keys) for all nodes in the data model
    • Input:
      • data_model (DataModel): The data model to generate constraints for
    • Returns: List of Cypher statements for constraints
  • get_node_cypher_ingest_query

    • Generate a Cypher query to ingest a list of node records into Neo4j
    • Input:
      • node (Node): The node definition (label, key property, properties)
    • Returns: Parameterized Cypher query for bulk node ingestion (using $records)
  • get_relationship_cypher_ingest_query

    • Generate a Cypher query to ingest a list of relationship records into Neo4j
    • Input:
      • data_model (DataModel): The data model containing nodes and relationships
      • relationship_type (str): The type of the relationship
      • relationship_start_node_label (str): The label of the start node
      • relationship_end_node_label (str): The label of the end node
    • Returns: Parameterized Cypher query for bulk relationship ingestion (using $records)
💡 Prompts
  • create_new_data_model
    • Provide a structured parameterized prompt for generating a new graph data model
    • Input:
      • data_context (str): Description of the data and any specific details to focus on
      • use_cases (str): List of use cases for the data model to address
      • desired_nodes (str, optional): Node labels to include in the data model
      • desired_relationships (str, optional): Relationship types to include in the data model
    • Returns: Structured prompt that guides the agent through a 3-step process: analysis of sample data and examples, generation of the data model with validation, and presentation of results with visualization

🔧 Usage with Claude Desktop

💾 Released Package

Can be found on PyPi https://pypi.org/project/mcp-neo4j-data-modeling/

Add the server to your claude_desktop_config.json with the transport method specified:

"mcpServers": {
  "neo4j-data-modeling": {
    "command": "uvx",
    "args": [ "mcp-neo4j-data-modeling@0.8.2", "--transport", "stdio" ]
  }
}
🏷️ Namespacing Tools

The server supports namespacing the server tools:

"mcpServers": {
  "neo4j-data-modeling-app1": {
    "command": "uvx",
    "args": [ "mcp-neo4j-data-modeling@0.8.2", "--transport", "stdio", "--namespace", "app1" ]
  },
  "neo4j-data-modeling-app2": {
    "command": "uvx", 
    "args": [ "mcp-neo4j-data-modeling@0.8.2", "--transport", "stdio", "--namespace", "app2" ]
  }
}

With namespacing enabled:

  • Tools get prefixed: app1-validate_node, app2-validate_node
  • Each namespace operates independently
🌐 HTTP Transport Mode

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

# Basic HTTP mode (defaults: host=127.0.0.1, port=8000, path=/mcp/)
mcp-neo4j-data-modeling --transport http

# Custom HTTP configuration
mcp-neo4j-data-modeling --transport http --host 127.0.0.1 --port 8080 --path /api/mcp/

# With namespace for multi-tenant deployment
mcp-neo4j-data-modeling --transport http --namespace myapp

Environment variables for HTTP configuration:

export MCP_TRANSPORT=http
export NEO4J_MCP_SERVER_HOST=127.0.0.1
export NEO4J_MCP_SERVER_PORT=8080
export NEO4J_MCP_SERVER_PATH=/api/mcp/
export NEO4J_NAMESPACE=myapp
mcp-neo4j-data-modeling
🔄 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

Here we use the Docker Hub hosted Data Modeling MCP server image with stdio transport for use with Claude Desktop.

Config details:

  • -i: Interactive mode - keeps STDIN open for stdio transport communication
  • --rm: Automatically remove container when it exits (cleanup)
  • -p 8000:8000: Port mapping - maps host port 8000 to container port 8000
  • NEO4J_TRANSPORT=stdio: Uses stdio transport for Claude Desktop compatibility
{
  "mcpServers": {
    "neo4j-data-modeling": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-p",
        "8000:8000",
        "-e", "NEO4J_TRANSPORT=stdio",
        "-e", "NEO4J_NAMESPACE=myapp",
        "mcp/neo4j-data-modeling:latest"
      ]
    }
  }
}

🐳 Docker Deployment

The Neo4j Data Modeling 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-data-modeling:latest .:

# Run with http transport (default for Docker)
docker run --rm -p 8000:8000 \
  -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-data-modeling:latest

# Run with security middleware for production
docker run --rm -p 8000:8000 \
  -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-data-modeling:latest
🔧 Environment Variables
Variable Default Description
NEO4J_TRANSPORT stdio (local), http (remote) Transport protocol (stdio, http, or sse)
NEO4J_MCP_SERVER_HOST 127.0.0.1 (local) Host to bind to
NEO4J_MCP_SERVER_PORT 8000 Port for HTTP/SSE transport
NEO4J_MCP_SERVER_PATH /mcp/ Path for accessing MCP server
NEO4J_NAMESPACE (empty - no prefix) Namespace prefix for tool names (e.g., myapp-validate_node)
NEO4J_MCP_SERVER_ALLOW_ORIGINS (empty - secure by default) Comma-separated list of allowed CORS origins
NEO4J_MCP_SERVER_ALLOWED_HOSTS localhost,127.0.0.1 Comma-separated list of allowed hosts (DNS rebinding protection)
🌐 SSE Transport for Legacy Web Access

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

# Start the server with SSE transport
docker run -d -p 8000:8000 \
  -e NEO4J_TRANSPORT="sse" \
  -e NEO4J_MCP_SERVER_HOST="0.0.0.0" \
  -e NEO4J_MCP_SERVER_PORT="8000" \
  --name neo4j-data-modeling-mcp-server \
  mcp-neo4j-data-modeling:latest

# Test the SSE endpoint
curl http://localhost:8000/sse

# Use with MCP Inspector
npx @modelcontextprotocol/inspector http://localhost:8000/sse

🚀 Development

📦 Prerequisites
  1. Install uv (Universal Virtualenv):
# Using pip
pip install uv

# Using Homebrew on macOS
brew install uv

# Using cargo (Rust package manager)
cargo install uv
  1. Clone the repository and set up development environment:
# Clone the repository
git clone https://github.com/yourusername/mcp-neo4j-data-modeling.git
cd mcp-neo4j-data-modeling

# Create and activate virtual environment using uv
uv venv
source .venv/bin/activate  # On Unix/macOS
.venv\Scripts\activate     # On Windows

# Install dependencies including dev dependencies
uv pip install -e ".[dev]"
  1. Run Tests
./test.sh
🔧 Development Configuration
# Add the server to your claude_desktop_config.json
"mcpServers": {
  "neo4j-data-modeling": {
    "command": "uv",
    "args": [
      "--directory", "path_to_repo/src",
      "run", "mcp-neo4j-data-modeling", "--transport", "stdio"]
  }
}
🐳 Docker

Build and run the Docker container:

# Build the image
docker build -t mcp/neo4j-data-modeling:latest .

# Run the container
docker run mcp/neo4j-data-modeling: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.

Questions about Neo4j Data Modeling

What is the Neo4j Data Modeling MCP server?

A simple Neo4j MCP server for creating graph data models. Neo4j Data Modeling is maintained by neo4j-contrib on GitHub at neo4j-contrib/mcp-neo4j, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Neo4j Data Modeling MCP server?

Add Neo4j Data Modeling to your AI app's MCP config with the command uvx mcp-neo4j-data-modeling==0.6.1. In Claude Code, run claude mcp add --transport stdio neo4j-contrib-mcp-neo4j-data-mod -- uvx mcp-neo4j-data-modeling==0.6.1. To run Neo4j Data Modeling this way you need uv installed.

Does Neo4j Data Modeling need an API key?

The registry lists no required keys for Neo4j Data Modeling. Check the Neo4j Data Modeling README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Neo4j Data Modeling an official MCP server?

No. Neo4j Data Modeling is a community server maintained by neo4j-contrib. Community servers can be excellent; read the code and the open issues before you give Neo4j Data Modeling access to company data.

What license is Neo4j Data Modeling under?

Neo4j Data Modeling is released under the MIT license, according to its GitHub repository. The license covers the code of Neo4j Data Modeling; the service it connects to has its own terms.