neo4j-mcp-skill
Use when installing, configuring, or troubleshooting the official Neo4j MCP server
- 01GitHub stars
- 121
- 02Installs
- New
- 03Files scanned
- 2
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 7ecbfbe3a35a84ea… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Neo4j MCP Skill
Installs and configures the official Neo4j MCP server so AI agents can connect to Neo4j via any MCP-compatible client.
When to Use
- Connecting Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, Kiro, or another editor to Neo4j via MCP
- Installing the server (
neo4j-mcpbinary orneo4j-mcp-serverfrom PyPI) and writing the correct config for a specific editor - Switching between stdio and HTTP transport
- Enabling or disabling write access (
NEO4J_MCP_READ_ONLY) - Troubleshooting "MCP server not found" or connection errors
When NOT to Use
- Writing or optimizing Cypher queries → use
neo4j-cypher-skill - Provisioning a new Neo4j Aura instance → use
neo4j-aura-provisioning-skill - Agent long-term memory → use
neo4j-agent-memory-skill - neo4j-admin / cypher-shell / aura-cli → use
neo4j-cli-tools-skill
Version: server 2.0.0 (2026-10-28) breaking changes
- Only
NEO4J_MCP_*env vars (NEO4J_MCP_URI,NEO4J_MCP_USERNAME,NEO4J_MCP_PASSWORD,NEO4J_MCP_DATABASE,NEO4J_MCP_READ_ONLY, ...) and unprefixed flags (--uri,--username,--read-only, ...). OldNEO4J_*names and--neo4j-*flags removed — v1.x configs fail. - STDIO:
NEO4J_MCP_DATABASErequired (no longer defaults toneo4j). - HTTP: endpoint
/db/{database}/mcp; URI and credentials per request;NEO4J_MCP_HTTP_ALLOWED_URISrequired. - Check version:
neo4j-mcp -v. On v1.x, upgrade rather than mixing old names. CHANGELOG
Available MCP Tools
| Tool | Type | What it does |
|---|---|---|
get-schema | read | Returns labels, relationship types, property keys, and indexes |
read-cypher | read | Executes read-only Cypher (MATCH, RETURN, SHOW) |
write-cypher | write | Executes write Cypher (MERGE, CREATE, SET, DELETE) — not exposed when NEO4J_MCP_READ_ONLY=true |
list-gds-procedures | read | Lists available Graph Data Science procedures; omitted from the tool list when GDS is not installed |
Installation
Step 1 — Install and find the absolute path
# Option A: PyPI — command name is neo4j-mcp-server
pip install neo4j-mcp-server # or run without install: uvx neo4j-mcp-server
# Option B: Homebrew or release binary — command name is neo4j-mcp
brew install neo4j-mcp
# or download from https://github.com/neo4j/mcp/releases (neo4j-mcp_<OS>_<arch>.tar.gz / .zip)
# Option C: Docker
docker pull neo4j/mcp
Get the absolute path — you will need this in Step 3. Use the name that matches the install method:
which neo4j-mcp-server # PyPI, e.g. /Users/you/project/.venv/bin/neo4j-mcp-server
which neo4j-mcp # Homebrew/binary, e.g. /usr/local/bin/neo4j-mcp
neo4j-mcp -v # binary: prints version; expect 2.x
Why absolute path matters: editors (Claude Code, Cursor, Claude Desktop) spawn the MCP server as a subprocess using their own restricted PATH — not your shell's PATH. On macOS, GUI apps do not inherit
.zshrcor.zprofile. Using a bare command name will silently fail; using the absolute path always works. Always use the output ofwhichin thecommandfield below (/full/path/to/neo4j-mcpin the examples — substituteneo4j-mcp-serverfor PyPI installs).
Step 2 — Prepare credentials
# .env (gitignored)
NEO4J_MCP_URI=neo4j+s://<instance>.databases.neo4j.io # Aura
# or bolt://localhost:7687 # local
NEO4J_MCP_USERNAME=neo4j
NEO4J_MCP_PASSWORD=<password>
NEO4J_MCP_DATABASE=neo4j
Verify connectivity before configuring the editor:
source .env
cypher-shell -a "$NEO4J_MCP_URI" -u "$NEO4J_MCP_USERNAME" -p "$NEO4J_MCP_PASSWORD" -d "$NEO4J_MCP_DATABASE" \
"RETURN 'connected' AS status"
# If cypher-shell not available: python3 -c "
# from neo4j import GraphDatabase, __version__
# d = GraphDatabase.driver('$NEO4J_MCP_URI', auth=('$NEO4J_MCP_USERNAME','$NEO4J_MCP_PASSWORD'))
# d.verify_connectivity(); print('connected'); d.close()"
Step 3 — Configure your editor
Pick the config block for your editor. All use STDIO transport (the MCP server runs as a subprocess of the editor).
Claude Code — project .mcp.json (repo root, under mcpServers) or claude mcp add (local/user scope, stored in ~/.claude.json). Never ~/.claude/settings.json — Claude Code ignores MCP servers there. If .mcp.json exists, merge the neo4j block into mcpServers — do not replace the file. Gitignore .mcp.json if it holds a password.
{
"mcpServers": {
"neo4j": {
"command": "/full/path/to/neo4j-mcp",
"env": {
"NEO4J_MCP_URI": "neo4j+s://<host>",
"NEO4J_MCP_USERNAME": "neo4j",
"NEO4J_MCP_PASSWORD": "<password>",
"NEO4J_MCP_DATABASE": "neo4j",
"NEO4J_MCP_READ_ONLY": "true"
}
}
}
}
CLI alternative (sets command and env; at least one option such as --transport stdio must sit between --env and the name):
claude mcp add --env NEO4J_MCP_URI=neo4j+s://<host> --env NEO4J_MCP_USERNAME=neo4j \
--env NEO4J_MCP_PASSWORD=<password> --env NEO4J_MCP_DATABASE=neo4j --env NEO4J_MCP_READ_ONLY=true \
--transport stdio neo4j -- /full/path/to/neo4j-mcp
claude mcp get neo4j # verify
Claude Desktop
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"neo4j": {
"command": "/full/path/to/neo4j-mcp",
"env": {
"NEO4J_MCP_URI": "neo4j+s://<host>",
"NEO4J_MCP_USERNAME": "neo4j",
"NEO4J_MCP_PASSWORD": "<password>",
"NEO4J_MCP_DATABASE": "neo4j",
"NEO4J_MCP_READ_ONLY": "true"
}
}
}
}
VS Code — .vscode/mcp.json (note: uses servers, not mcpServers — different from all other editors):
{
"servers": {
"neo4j": {
"type": "stdio",
"command": "/full/path/to/neo4j-mcp",
"env": {
"NEO4J_MCP_URI": "bolt://localhost:7687",
"NEO4J_MCP_USERNAME": "neo4j",
"NEO4J_MCP_PASSWORD": "password",
"NEO4J_MCP_DATABASE": "neo4j",
"NEO4J_MCP_READ_ONLY": "true"
}
}
}
}
Cursor — global: ~/.cursor/mcp.json / project: .cursor/mcp.json (same structure as Claude Code, uses mcpServers).
Windsurf — path depends on version; check the editor's current MCP docs. Current docs (Devin Desktop): user ~/.config/devin/mcp_config.json, project .devin/mcp_config.json. Older Windsurf installs: ~/.codeium/windsurf/mcp_config.json.
Kiro — global: ~/.kiro/settings/mcp.json / project: .kiro/settings/mcp.json. Supports ${VARIABLE} to pull from the shell environment exported before the editor launched:
{
"mcpServers": {
"neo4j": {
"command": "/full/path/to/neo4j-mcp",
"env": {
"NEO4J_MCP_URI": "${NEO4J_MCP_URI}",
"NEO4J_MCP_USERNAME": "${NEO4J_MCP_USERNAME}",
"NEO4J_MCP_PASSWORD": "${NEO4J_MCP_PASSWORD}",
"NEO4J_MCP_DATABASE": "neo4j",
"NEO4J_MCP_READ_ONLY": "true"
}
}
}
}
Cline — ~/.vscode/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json (same structure as Claude Code, uses mcpServers). Or add via VS Code settings → Cline extension → MCP Servers panel.
Antigravity — global ~/.gemini/config/mcp_config.json, workspace .agents/mcp_config.json (uses mcpServers). Remote servers: serverUrl (not httpUrl).
Step 4 — Restart the editor
After editing the config file, restart the editor (or reload the MCP server if the editor supports hot-reload). Verify the server appears in the editor's MCP panel or tool list.
Step 5 — Smoke test
Run get-schema via the agent or directly via MCP. Do not use "does it return labels?" as the test — an empty database returns no labels and looks identical to a broken connection.
Use this instead — it succeeds even on an empty DB:
read-cypher: RETURN 'connected' AS status
Expected: { "status": "connected" }. Any result confirms the server is alive and the credentials are valid.
If the database has data, also run:
get-schema
and confirm it returns the node labels and relationship types you expect.
HTTP Transport
HTTP transport runs the MCP server as a persistent network service — useful for shared servers, containers, or multiple clients.
Credentials are per request only — the server refuses to start if NEO4J_MCP_URI/USERNAME/PASSWORD/DATABASE (or --uri/--username/--password/--database) are set in HTTP mode.
NEO4J_MCP_TRANSPORT_MODE=http \
NEO4J_MCP_HTTP_HOST=127.0.0.1 \
NEO4J_MCP_HTTP_PORT=8080 \
NEO4J_MCP_HTTP_ALLOWED_URIS=localhost:7687 \
neo4j-mcp
# NEO4J_MCP_HTTP_ALLOWED_URIS: comma-separated host[:port] clients may target (required in 2.0; e.g. *.databases.neo4j.io)
Each request: POST /db/{database}/mcp with headers X-Neo4j-MCP-URI: <bolt URI> (missing → 400) and Authorization: Basic <base64(user:password)> or Bearer <token> (missing → 401). Optional per-request narrowing: X-Neo4j-MCP-ReadOnly: true, X-Neo4j-MCP-Tools: get-schema,read-cypher.
Generate the Basic value:
echo -n "neo4j:<password>" | base64
Editor config for HTTP — keys differ per editor:
Claude Code / Cursor (mcpServers, url):
{
"mcpServers": {
"neo4j-http": {
"type": "http",
"url": "http://127.0.0.1:8080/db/neo4j/mcp",
"headers": {
"X-Neo4j-MCP-URI": "bolt://localhost:7687",
"Authorization": "Basic <base64>"
}
}
}
}
Claude Code CLI: claude mcp add --transport http neo4j-http http://127.0.0.1:8080/db/neo4j/mcp --header "X-Neo4j-MCP-URI: bolt://localhost:7687" --header "Authorization: Basic <base64>".
VS Code (.vscode/mcp.json): same entry under servers instead of mcpServers.
Antigravity: same entry under mcpServers, with serverUrl in place of url and type.
Windsurf, Kiro, Cline, Claude Desktop: check the editor's docs for remote-server keys; Claude Desktop JSON config has no direct remote entry — use STDIO there.
Security: bind to
127.0.0.1, not0.0.0.0. Only change to a broader interface if you need remote access and have TLS + auth in front of it.
Environment Variables
| Variable | Required | Default | Notes |
|---|---|---|---|
NEO4J_MCP_URI | STDIO: yes | — | neo4j+s:// for Aura; bolt:// for local. HTTP: unset (per-request header) |
NEO4J_MCP_USERNAME | STDIO: yes | — | HTTP: unset |
NEO4J_MCP_PASSWORD | STDIO: yes | — | HTTP: unset |
NEO4J_MCP_DATABASE | STDIO: yes | none (2.0) | HTTP: unset (database in URL path) |
NEO4J_MCP_READ_ONLY | no | false | Set true to hide write-cypher (safe default for exploration) |
NEO4J_MCP_TELEMETRY | no | true | Set false to opt out |
NEO4J_MCP_TOOLS | no | all four | Comma-separated tool allowlist |
Full list (HTTP/TLS, timeouts, logging): configuration reference.
When to set NEO4J_MCP_READ_ONLY=false (or remove the variable): any use case that needs to write data — imports, MERGE, schema changes, GDS write-back. Without write access, the agent will see only three tools (get-schema, read-cypher, list-gds-procedures) and write-cypher calls will fail.
APOC Requirement
The MCP server requires APOC (incl. apoc.meta.schema) — without it the server fails its requirement check at the MCP initialize handshake ("please ensure the APOC plugin is installed..."). On Aura, APOC is included automatically. On self-managed Neo4j, install the APOC plugin and allow it:
# neo4j.conf
dbms.security.procedures.unrestricted=apoc.*
Without the unrestricted line, get-schema returns an error ("apoc.meta.schema is unavailable because it is sandboxed"), not partial results.
Verify before configuring the editor (apoc.version() passing does not prove the meta procedures exist):
cypher-shell -a "$NEO4J_MCP_URI" -u "$NEO4J_MCP_USERNAME" -p "$NEO4J_MCP_PASSWORD" -d "$NEO4J_MCP_DATABASE" \
"CALL apoc.meta.schema() YIELD value RETURN 'ok' AS apoc_meta"
# 'ok' → OK; "Unknown procedure"/no such procedure → install APOC (core); 52N34 "restricted" → add dbms.security.procedures.unrestricted=apoc.*
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Server not listed in editor | Config file path wrong, JSON malformed, or editor not restarted | Validate JSON (python3 -m json.tool <config-file>); confirm correct file for your editor; restart editor |
neo4j-mcp: command not found | Editor PATH doesn't include the binary location, or PyPI install (command is neo4j-mcp-server) | Use absolute path in command: run which neo4j-mcp (binary/Homebrew) or which neo4j-mcp-server (PyPI) and paste the result |
| Server starts then immediately exits | Python not found (pip install) or wrong binary for OS (binary install) | Run the command manually in terminal to see the error: /full/path/neo4j-mcp -v |
AuthenticationException | Wrong credentials | Verify URI + credentials with cypher-shell or driver before editing config |
write-cypher tool missing | NEO4J_MCP_READ_ONLY=true | Remove or set to false if writes are needed |
ServiceUnavailable | DB not reachable from editor process | Check firewall, VPN, or whether Aura instance is paused |
list-gds-procedures missing from tool list | GDS not installed or Aura Free | GDS requires Aura Professional/Enterprise or self-managed with plugin |
Checklist
- Server 2.x (
neo4j-mcp -v); config uses onlyNEO4J_MCP_*names -
which neo4j-mcp(orwhich neo4j-mcp-serverfor PyPI) run and absolute path noted — this goes incommand - Connectivity verified (
RETURN 'connected') before editing editor config - Credentials not committed to git;
.envin.gitignore -
NEO4J_MCP_READ_ONLYset intentionally —truefor exploration,false/absent for write use cases -
NEO4J_MCP_DATABASEset (required in STDIO) - Correct config file used for the target editor (Claude Code:
.mcp.jsonorclaude mcp add; VS Code usesservers; othersmcpServers) - Config is valid JSON (validate with
python3 -m json.tool <file>before saving) - Editor restarted after config change
- Smoke test passed:
read-cypher: RETURN 'connected' AS statusreturns a result - APOC meta works on self-managed:
CALL apoc.meta.schema()succeeds
References
Files
2Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from neo4j-contrib/neo4j-skills8
Authoritative reference for the neo4j-agent-memory Python package — a graph-native memory system for AI agents built on Neo4j — and for the hosted service (NAMS) at memory.neo4jlabs.com. Use this skill whenever the user mentions neo4j-agent-memory, agent memory with Neo4j, context graphs, the POLE+O
Manages Neo4j Aura Agents via the v2beta1 REST API — create, list, get, update, delete,
Serverless Aura Graph Analytics (AGA) GDS Sessions — covers GdsSessions,
Provisions and manages Neo4j Aura instances via CLI (aura-cli v1.7+) or REST API.
Use when working with Neo4j command-line tools — neo4j-cli (modern unified
Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x.
Ingests unstructured and semi-structured documents into Neo4j as a knowledge graph.
Neo4j .NET Driver v6 — IDriver lifecycle, DI registration (singleton), ExecutableQuery
Related backend skillsscan passed
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Report browser/API/CLI/job/worker/webhook bugs. Use for: qa report only, just report bugs, test but dont fix. (gstack)
DOCA Flow packet steering on NVIDIA NICs/DPUs, linked into a C application: match/action pipes, ports, representors, forwarding, hairpin, counters. Trigger on packet steering, classifier, rule-matching, representor, hairpin or 5-tuple-to-queue questions even when "DOCA Flow" is not named. Also cover
Builds, versions, publishes, tests, and executes Google Cloud Application Integration workflows through the REST API and Python discovery client, and promotes versions across environments. Use when listing integrations, downloading or uploading integration versions as JSON, configuring API triggers
Use when developing WordPress plugins: architecture and hooks, activation/deactivation/uninstall, admin UI and Settings API, data storage, cron/tasks, security (nonces/capabilities/sanitization/escaping), and release packaging.