neo4j-mcp-server

miltonvve/neo4j-mcp-server

3.2

If you are the rightful owner of neo4j-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Neo4j MCP Server is a production-ready server designed for seamless integration between Claude Code and Neo4j graph databases, featuring multi-tenancy and Azure AKS deployment.

Tools
  1. create_project_namespace

    Creates a new project namespace for data isolation.

  2. create_node

    Creates a new node in the specified project namespace.

  3. create_relationship

    Creates a relationship between two nodes.

  4. execute_cypher_query

    Executes a Cypher query within a project namespace.

  5. get_project_schema

    Retrieves schema information for a project.

  6. backup_project

    Creates a backup of project data.

Neo4j MCP Server

๐Ÿš€ Production-ready Neo4j MCP server with multi-tenancy and Azure AKS deployment

License: MIT TypeScript Neo4j Azure

A comprehensive Model Context Protocol (MCP) server for Neo4j that enables seamless integration between Claude Code and Neo4j graph databases. Built with enterprise-grade features including multi-tenancy, project isolation, and production-ready Azure AKS deployment.

โœจ Features

๐Ÿ”ง Core Capabilities

  • Multi-tenant Architecture - Project isolation with namespace management
  • MCP Protocol Support - Full integration with Claude Code and other MCP clients
  • Production Ready - Enterprise-grade deployment on Azure AKS
  • Type Safety - Built with TypeScript and Zod validation
  • Comprehensive Logging - Winston-based logging with audit trails

๐Ÿ›  Neo4j Integration

  • Query Execution - Execute Cypher queries with project isolation
  • Node Management - Create, update, and query nodes with labels
  • Relationship Management - Build complex graph relationships
  • Schema Management - Dynamic schema discovery and validation
  • Backup & Restore - Project-specific data export/import

๐Ÿ— Infrastructure

  • Kubernetes Deployment - Complete AKS manifest files
  • SSL/TLS Security - Azure Application Gateway integration
  • Monitoring - Prometheus metrics and Grafana dashboards
  • Auto-scaling - Horizontal pod autoscaling support
  • Health Checks - Comprehensive health monitoring

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ and npm 8+
  • Neo4j 5.15+ (Community or Enterprise)
  • Claude Code or other MCP client

Installation

# Install via npm
npm install -g neo4j-mcp-server

# Or clone and build
git clone https://github.com/miltonvve/neo4j-mcp-server.git
cd neo4j-mcp-server
npm install
npm run build

Configuration

# Copy environment template
cp .env.example .env

# Edit configuration
vim .env

Basic Usage

# Start the MCP server
neo4j-mcp-server

# Or run in development mode
npm run dev

Claude Integration

Add to your Claude configuration:

{
  "mcpServers": {
    "neo4j": {
      "command": "neo4j-mcp-server",
      "env": {
        "NEO4J_URI": "bolt://localhost:7687",
        "NEO4J_USERNAME": "neo4j",
        "NEO4J_PASSWORD": "password"
      }
    }
  }
}

๐Ÿ— Architecture

System Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Neo4j MCP Server                         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    MCP Protocol    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚   Claude    โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  MCP Server    โ”‚     โ”‚
โ”‚  โ”‚    Code     โ”‚                    โ”‚  (TypeScript)  โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚                                              โ”‚               โ”‚
โ”‚                                              โ”‚               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚            Project Isolation Layer                   โ”‚ โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚ โ”‚
โ”‚  โ”‚  โ”‚ Project A   โ”‚  โ”‚ Project B   โ”‚  โ”‚ Project C   โ”‚  โ”‚ โ”‚
โ”‚  โ”‚  โ”‚ Namespace   โ”‚  โ”‚ Namespace   โ”‚  โ”‚ Namespace   โ”‚  โ”‚ โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚                                              โ”‚               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚                Neo4j Database                        โ”‚ โ”‚
โ”‚  โ”‚              (Community/Enterprise)                  โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Multi-Tenancy Design

  • Project Isolation: Each project gets its own namespace
  • Resource Limits: Configurable limits per project
  • Audit Logging: All operations tracked per project
  • Security: Role-based access control

๐Ÿ“‹ MCP Tools Reference

Project Management

create_project_namespace

Creates a new project namespace for data isolation.

{
  projectId: string;
  name: string;
  description?: string;
}

Node Operations

create_node

Creates a new node in the specified project namespace.

{
  projectId: string;
  label: string;
  properties: Record<string, any>;
}

Relationship Operations

create_relationship

Creates a relationship between two nodes.

{
  projectId: string;
  fromNode: { label: string; properties: Record<string, any> };
  toNode: { label: string; properties: Record<string, any> };
  relationship: { type: string; properties?: Record<string, any> };
}

Query Operations

execute_cypher_query

Executes a Cypher query within a project namespace.

{
  projectId: string;
  query: string;
  parameters?: Record<string, any>;
}

Utility Operations

get_project_schema

Retrieves schema information for a project.

backup_project

Creates a backup of project data.

๐Ÿ— Deployment

Docker Compose (Development)

cd examples/docker-compose
docker-compose up -d

Azure AKS (Production)

# Deploy to Azure
./scripts/deploy-azure.sh

# Setup SSL/TLS
./scripts/setup-ssl.sh

# Health check
./scripts/health-check.sh

For detailed deployment instructions, see:

๐Ÿ”ง Configuration

Environment Variables

VariableDescriptionDefault
NEO4J_URINeo4j connection URIbolt://localhost:7687
NEO4J_USERNAMENeo4j usernameneo4j
NEO4J_PASSWORDNeo4j passwordpassword
LOG_LEVELLogging levelinfo
ENABLE_PROJECT_ISOLATIONEnable project isolationtrue
MAX_QUERY_EXECUTION_TIMEQuery timeout (ms)30000

Security Configuration

{
  enableProjectIsolation: boolean;
  maxQueryExecutionTime: number;
  allowedLabels?: string[];
  forbiddenQueries?: string[];
}

๐Ÿ“Š Monitoring

Metrics

  • Query execution times
  • Error rates by project
  • Connection pool status
  • Memory usage
  • Request throughput

Logging

  • Structured JSON logging
  • Audit trail for all operations
  • Error tracking and alerting
  • Performance monitoring

๐Ÿงช Testing

# Run tests
npm test

# Run with coverage
npm run test:coverage

# Run integration tests
npm run test:integration

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Setup

git clone https://github.com/miltonvve/neo4j-mcp-server.git
cd neo4j-mcp-server
npm install
npm run dev

๐Ÿ“š Documentation

๐Ÿ› Troubleshooting

Common Issues

Connection Errors

  • Check Neo4j service status
  • Verify connection credentials
  • Ensure network connectivity

Project Isolation Issues

  • Verify project namespace exists
  • Check project permissions
  • Review audit logs

Performance Issues

  • Monitor query execution times
  • Check connection pool settings
  • Review resource limits

For more help, see

๐Ÿ“„ License

This project is licensed under the MIT License - see the file for details.

๐Ÿ™ Acknowledgments

  • Neo4j for the amazing graph database
  • Anthropic for Claude and MCP protocol
  • Microsoft Azure for cloud infrastructure
  • The open-source community for inspiration and contributions

๐Ÿ”— Links


Built with โค๏ธ by GenAI Guru

For questions or support, please open an issue or contact .