Neo4j in Coding Tools & Editors
| Documentation for a Neo4j Labs project, which is governed by these terms. |
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.
| Want to go from zero to a running graph application in one session? The neo4j-getting-started-skill for Claude Code handles database provisioning, schema design, data loading, and app generation end-to-end — and can configure the MCP server automatically as its final step. |
Installing Neo4j Agent Skills
Neo4j Agent Skills teach your coding agent Neo4j-specific patterns — correct Cypher, GraphRAG pipelines, drivers, GDS, and more. Browse all skills at skills.sh/neo4j/agent-skills.
Claude Code
/plugin marketplace add https://github.com/neo4j/agent-skills.git
/plugin install neo4j-skills@neo4j-skills-marketplace
Use /plugin list to verify, or /reload-plugins after installation.
Antigravity
Install the plugin with the Antigravity CLI (agy):
agy plugin install https://github.com/neo4j/agent-skills
Verify with agy plugin list (or /plugin list inside an interactive agy session).
In the Antigravity app or IDE, open the Customizations tab and install Neo4j from the Marketplace, or clone the repository into ~/.gemini/config/plugins/neo4j-skills (global) or .agents/plugins/neo4j-skills (workspace).
To migrate existing Gemini CLI extensions, run agy plugin import gemini.
Gemini CLI
gemini extensions install https://github.com/neo4j/agent-skills
Enter your environment variables (NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD, NEO4J_DATABASE) when prompted. Run /extensions list inside Gemini to verify.
Cursor, Cline, Windsurf, and others
# Install all Neo4j skills
npx skills add neo4j/agent-skills
# Or individual skills
npx skills add neo4j/agent-skills/neo4j-cypher-skill
npx skills add neo4j/agent-skills/neo4j-graphrag-skill
Kiro
Install the skills as a Kiro power as a Kiro power: open the Powers panel, choose Add Custom Power, then Import power from a repository URL (Import power from GitHub before Kiro IDE 1.4.236) and enter https://github.com/neo4j/agent-skills.
For a local clone, choose Import power from a folder.
Alternatively, copy individual skills into .kiro/skills/ (workspace) or ~/.kiro/skills/ (global).
Codex
codex plugin marketplace add neo4j/agent-skills
codex plugin add neo4j-skills@neo4j-skills-marketplace
Verify with codex plugin marketplace list and codex plugin list, and start a new Codex thread so the plugin loads.
To refresh later: codex plugin marketplace upgrade neo4j-skills-marketplace.
See Neo4j Agent Skills for the full list of available skills.
Relate
Relate — the embedded, agent-native Cypher graph database — ships its own skill, separate from the Neo4j skills above:
curl -sSfL https://relatedb.ai/install.sh | bash
relate skill install # every detected agent
That teaches Claude Code, Cursor, Codex, Gemini CLI, Copilot, and more the Relate CLI flags, the Cypher dialect, and the gotchas; relate upgrade keeps it current.
The skill is also readable directly at relatedb.ai/skill.md, with the full documentation index for agents at relatedb.ai/docs/llms.txt.
For live database access from an agent over MCP: relate serve --mcp stdio --database ./graph.rl --read-only.
See Relate for what it is and why an agent would want a graph database in-process.
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."
To install Neo4j Agent Skills for Gemini CLI (Cypher authoring, GraphRAG, drivers, GDS, and more), use the separate skills extension: gemini extensions install https://github.com/neo4j/agent-skills. See Neo4j Agent Skills for the full list.
|
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.
Agent Safety with the MCP Server
When an agent executes Cypher against your live database, a few habits prevent most accidents:
-
Read-only by default. Start the server with
NEO4J_READ_ONLY=trueand drop the flag only for sessions that must write. -
Confirm before writes. Have the agent show the statement and its expected impact before running
CREATE,MERGE,SET,DELETE, orDETACH DELETEthroughwrite-cypher— and never let it auto-runCALL { … } IN TRANSACTIONSwithout approval. -
Size before you run.
EXPLAINthe statement (or run acount(*)variant) before traversals on large graphs, and keep aLIMITon exploratory queries — a pattern that can match millions of nodes will otherwise flood the agent’s context.
{
"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.com/llms.txt — agentic-engineering reference covering GraphRAG, MCP, drivers, Cypher, and CLI tools, optimized for AI agents and LLMs
-
neo4j.com/docs/llms-full.txt — full documentation index for AI/LLM contexts
-
Neo4j MCP Servers Overview — all available Labs MCP servers
-
Neo4j Agent Skills — installable knowledge bundles for Cypher authoring, migrations, and CLI tools