Neo4j in Coding Tools & Editors
Neo4j integrates with AI-powered coding tools through dedicated extensions, curated rules, and the Neo4j MCP server. This gives your AI coding assistant live access to your graph database — schema inspection, Cypher execution, and real data — without leaving the editor.
What You Can Do
With Neo4j connected to your coding tool, your AI assistant can:
-
Retrieve the database schema — labels, relationship types, property keys, and indexes — and use it as context for all subsequent code generation
-
Generate typed data classes — Pydantic models, GraphQL schemas, Java POJOs, TypeScript interfaces, Go structs — matching your actual graph structure
-
Validate generated Cypher — execute queries against the real database to catch syntax errors, full scans, and logic bugs before they reach production
-
Generate integration tests — sample real records from the database to produce realistic test data and integration test fixtures
-
Generate synthetic test data — use the schema to produce
CREATEorMERGEstatements for seeding test environments
Editor Integrations
Neo4j for VS Code
The Neo4j for VS Code extension provides native Cypher development support without requiring MCP.
Install: Search for Neo4j in the VS Code Extensions panel, or run:
ext install neo4j-extensions.neo4j-for-vscode
Features:
-
Syntax highlighting, linting, and semantic error checking for
.cypherfiles (unknown labels, type mismatches) -
Autocompletion for Cypher keywords, functions, labels, properties, relationship types, and database names
-
Signature help for all Cypher functions, formatted to the official styleguide
-
Multi-database connection management with quick switching
-
Query execution via
Ctrl+Enter(single statement) orCtrl+Alt+Enter(all/selected) -
Query results and graph visualization in the editor panel
-
Version-tailored linting — reads your connected database version (5.23+) and applies the correct dialect rules automatically
-
Embedded Cypher support — syntax highlighting for Cypher in Python, Java, JavaScript, Go, and .NET string literals marked with
// cypheror/* cypher */
Gemini CLI
Neo4j provides a dedicated Gemini CLI extension that bundles four MCP servers in a single install:
| Server | Capability |
|---|---|
|
Deploy and manage Neo4j Aura instances directly from the terminal |
|
Convert natural language to Cypher queries against a live database |
|
Interactive graph schema visualization and modeling |
|
Store and retrieve facts as a persistent knowledge graph for agentic workflows |
Install:
gemini extensions install https://github.com/neo4j-contrib/mcp-neo4j
Configure — set these environment variables before launching Gemini CLI:
export NEO4J_URI="neo4j+s://your-instance.databases.neo4j.io"
export NEO4J_USERNAME="neo4j"
export NEO4J_PASSWORD="your-password"
# For Aura management:
export NEO4J_AURA_CLIENT_ID="your-client-id"
export NEO4J_AURA_CLIENT_SECRET="your-client-secret"
export NEO4J_AURA_TENANT_ID="your-tenant-id"
Verify the extension loaded:
/mcp desc
Example prompts:
Create a new AuraDB Pro instance.
Create a Customer node with customer_id = "Gemini".
Using the data modeling server, list all labels and relationship types.
Use the neo4j-memory server to store: "Customer Asha prefers enterprise support."
Antigravity
Antigravity is an AI coding IDE with curated rules and MCP integrations for hundreds of technologies. Neo4j is supported through two complementary resources:
-
Graph Databases (Neo4j) rules — best-practice guidance injected into the AI context: data modeling patterns, Cypher fundamentals, indexing strategies, query profiling, and common use cases (social networks, fraud detection, knowledge graphs)
-
Neo4j MCP server — one-click install from the Antigravity MCP store; provides
get-schema,read-cypher, andwrite-cyphertools against a live database
To add the Neo4j MCP server in Antigravity:
-
Open the
…dropdown in the agent panel → Manage MCP Servers -
Click View raw config
-
Add the Neo4j server to
mcp_config.json(samemcpServersformat as other editors — see below)
Kiro
Neo4j is listed in the Kiro MCP server directory. Install with one click from the directory, or add it manually via the deep-link URL:
kiro://kiro.mcp/add?name=neo4j&config=%7B%22command%22%3A%22neo4j-mcp%22%2C%22env%22%3A%7B%22NEO4J_URI%22%3A%22YOUR_URI%22%2C%22NEO4J_USERNAME%22%3A%22YOUR_USERNAME%22%2C%22NEO4J_PASSWORD%22%3A%22YOUR_PASSWORD%22%7D%7D
Manual config in .kiro/settings/mcp.json (project) or ~/.kiro/settings/mcp.json (global) — uses the same mcpServers format described below.
Kiro supports ${VARIABLE} syntax in env values to pull credentials from the shell environment.
Neo4j MCP Server
The Neo4j MCP server exposes four tools to any MCP-compatible client:
| Tool | Description |
|---|---|
|
Introspect labels, relationship types, property keys, and indexes |
|
Execute read-only Cypher queries |
|
Execute write Cypher (disable with |
|
List available Graph Data Science procedures |
Install from Neo4j MCP docs, GitHub Releases, or via Docker:
docker pull neo4j/mcp
Configuration
Most editors use the same mcpServers JSON structure — only the config file path differs:
| Editor | Config file |
|---|---|
Claude Code |
|
Claude Desktop (macOS) |
|
Cursor (global) |
|
Cursor (project) |
|
Windsurf (global) |
|
Windsurf (project) |
|
Cline |
VS Code settings → Cline MCP panel |
Kiro (global) |
|
Kiro (project) |
|
Antigravity |
|
The Neo4j MCP server works with any MCP-compatible client, including GitHub Copilot (agent mode in VS Code, JetBrains, Eclipse, and Xcode), JetBrains AI Assistant, Zed, Continue.dev, Sourcegraph Cody, and Replit — configure it the same way using each tool’s MCP settings.
{
"mcpServers": {
"neo4j": {
"command": "neo4j-mcp",
"env": {
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "password",
"NEO4J_DATABASE": "neo4j",
"NEO4J_READ_ONLY": "true"
}
}
}
}
Claude Code also supports a CLI shortcut:
claude mcp add neo4j -- neo4j-mcp
VS Code uses a slightly different key (servers instead of mcpServers) in .vscode/mcp.json:
{
"servers": {
"neo4j": {
"type": "stdio",
"command": "neo4j-mcp",
"env": {
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "password",
"NEO4J_DATABASE": "neo4j",
"NEO4J_READ_ONLY": "true"
}
}
}
}
HTTP Transport
By default the MCP server communicates via STDIO (standard in/out), which is suitable for local process launch from an editor. HTTP transport mode instead serves MCP over a network endpoint — useful when you want to host a shared MCP server, run it in a container, or connect multiple clients to a single instance. Both modes support any Neo4j deployment (local, Docker, or Aura).
In HTTP mode, the database URI and database name must be provided when starting the server via environment variables or CLI flags. Credentials (username/password) can either be set at startup the same way, or supplied per-request via a Basic Auth or Bearer token header.
Start the server:
neo4j-mcp \
--neo4j-transport-mode http \
--neo4j-http-host 127.0.0.1 \
--neo4j-http-port 8080 \
--neo4j-uri bolt://localhost:7687 \
--neo4j-database neo4j
# omit --neo4j-username/--neo4j-password to require per-request auth
The server binds to 127.0.0.1 by default, making it only reachable from the local machine. Only change --neo4j-http-host to a broader address (e.g. a specific interface IP) if you intentionally need remote access, and secure it with TLS and auth headers.
|
Point your editor at the HTTP endpoint. Pass credentials as a Basic or Bearer auth header:
{
"mcpServers": {
"neo4j-http": {
"type": "http",
"url": "http://your-mcp-server:8080/mcp",
"headers": {
"Authorization": "Basic <base64(username:password)>"
}
}
}
}
Use Cases
Generate Data Classes from Graph Schema
Python (Pydantic)
Use the Neo4j schema to generate Pydantic models for all node types
TypeScript
Generate TypeScript interfaces for our graph node labels and their properties
GraphQL
Create a GraphQL schema from the current database schema
Java
Generate Java domain objects with Neo4j OGM annotations
Validate Generated Cypher
Validate queries against the database
Validate all queries in file recommendations.ts against the running database
with suitable parameters, ensure correct query execution, no warnings,
and non-zero results
Verify index usage
Generate a MERGE statement to upsert a Product node,
run EXPLAIN to check it uses the product_id index
Related Resources
-
Neo4j MCP Servers Overview — all available Labs MCP servers
-
Neo4j Agent Skills — installable knowledge bundles for Cypher authoring, migrations, and CLI tools