$ show neo4j-contrib/mcp-neo4j
This monorepo contains four distinct MCP (Model Context Protocol) servers for Neo4j, built on FastMCP and the Neo4j Python async driver. The servers are: mcp-neo4j-cypher (executes Cypher queries with schema introspection, read-only mode, and token-limit truncation), mcp-neo4j-memory (persistent knowledge graph memory with CRUD for entities, relations, and observations), mcp-neo4j-data-modeling (graph data model design, validation, format conversion between Arrows JSON, OWL Turtle, Pydantic models, and Neo4j GraphRAG schema, plus Cypher ingestion code generation), and mcp-neo4j-cloud-aura-api (manages Neo4j Aura cloud instances via REST API). Each server supports stdio, SSE, and HTTP transports, with security middleware (CORS, TrustedHost) and configurable namespace prefixing for multi-tenant deployments. The architecture follows a consistent pattern: CLI + environment variable configuration, FastMCP decorator-based tool definitions, Pydantic argument validation, and async Neo4j driver usage. External dependencies include the Neo4j database, Neo4j Aura API, FastMCP, Pydantic, neo4j driver, tiktoken, and rdflib. The codebase is actively maintained with CI/CD pipelines, Docker images, and multi-channel distribution (PyPI, Docker Hub, GitHub MCP Registry).
The LLM identified 2 files worth highlighting for reuse:
Core domain model for graph data modeling. Defines Property, Node, Relationship, and DataModel Pydantic classes with rich bidirectional conversion methods: from/to Arrows JSON, OWL Turtle, Pydantic model strings, Neo4j GraphRAG Python package schema, and Cypher ingestion/constraint queries. Demonstrates non-obvious skill in handling reserved keywords via field aliases, escaping descriptions, and generating syntactically correct Cypher. Could be extracted as a standalone library for any project needing graph schema representation and format translation.
Implements a persistent knowledge graph memory for LLM agents. Provides CRUD operations for entities, relations, and observations with full-text search, entity resolution, and deletion. Uses parameterized Cypher queries and MERGE semantics for idempotent creation. The class is self-contained (depends only on neo4j driver and Pydantic models) and could be extracted as a reusable memory backend for any MCP-based agent system.