Neo4j MCP security and permissions

What the official Neo4j MCP server can read and change, which of its tools are risky, and how read-only mode, tool filtering and a restricted database user limit it.

On this page

Does the Neo4j MCP server let security teams restrict what AI clients can change?

An AI client about to query a production graph needs a clear answer on whether it can change data. The official Neo4j MCP server ships least-privilege controls in the open-source server itself: read-only mode, tool filtering and per-request narrowing. Setting NEO4J_MCP_READ_ONLY to true or passing the --read-only flag stops the server from exposing write tools such as write-cypher, and the default is false, so a reviewer should confirm that the setting is explicitly applied in every deployment. NEO4J_MCP_TOOLS or the --tools flag restricts the advertised tools at startup. In HTTP mode, the X-Neo4j-MCP-Tools and X-Neo4j-MCP-ReadOnly headers can narrow the list per request but never widen it, so a server-level restriction stays in force.

The server-side switches do not replace the database-side control. The Neo4j security guidance advises using a restricted Neo4j user and reviewing generated Cypher before running it against a production database. That user, its privileges and its roles are configured in Neo4j itself, so the security team must create and verify them there. Confirm in your own environment which Neo4j edition and deployment you run (Aura, Neo4j Desktop or self-managed), because role and privilege management and the way the server authenticates depend on that choice. Ask the platform owner to show the granted privileges for the account the MCP server uses, and to test that a write attempt fails under that account.

The read-cypher tool rejects writes, schema and admin operations and PROFILE queries, and it checks each query with an extra database round-trip. That check is not a complete boundary. The tools documentation notes that custom procedures or functions Neo4j misclassifies as read-only could bypass it, and the APOC plugin required by the server widens what procedures are available. Treat the read-only flag as one layer, restrict the database user, and review whether any installed procedure can write before approving production access. Confirm the current behavior with the Security page for Neo4j MCP and the Tools page for Neo4j MCP before you write the approval conditions.

Which permission controls are built in, and what depends on the database

This table compares each permission control in the Neo4j MCP server with the parts that depend on the Neo4j database itself. Read the status column first: server settings decide which tools a client is offered, while the database user and installed plugins decide what a permitted query can actually do. The main takeaway is that read-only mode and tool filtering work best alongside a restricted database user, and that the database side needs its own review.

ControlStatusWhat to check
Read-only modeBuilt in to serverDefault is false. Set NEO4J_MCP_READ_ONLY to true or use --read-only to stop write tools being exposed.
Tool filteringBuilt in to serverNEO4J_MCP_TOOLS or --tools limits advertised tools at startup. Four tools exist: get-schema, read-cypher, write-cypher, list-gds-procedures.
Per-request headers (HTTP mode)Built in to serverX-Neo4j-MCP-Tools and X-Neo4j-MCP-ReadOnly can narrow the tool list per request but cannot widen it.
read-cypher validationBuilt in to serverRejects writes, schema and admin operations and PROFILE queries, using an extra database round-trip to check each query.
write-cypher toolBuilt in to serverRuns arbitrary Cypher in write mode. The tools page says to use it only in development environments.
Restricted database userDepends on the Neo4j databaseThe security page advises a restricted user. Confirm with Neo4j which roles and privileges to grant for read-only use.
Custom procedures misclassified as read-onlyConfirm with Neo4jThe tools page warns these could bypass the read-only check. Ask Neo4j how procedure read or write mode is classified and enforced.
APOC plugin prerequisiteDepends on the Neo4j databaseAPOC must be installed in the instance. Confirm with Neo4j which APOC procedures a restricted user can still call.
Graph Data Science library (optional)Depends on the Neo4j databaseGDS is optional. If installed, list-gds-procedures exposes its procedures, so confirm what a restricted user may run.

What a connected client can read and change

The Neo4j MCP server exposes four tools: get-schema, read-cypher, write-cypher and list-gds-procedures. Only write-cypher is not read-only, and it runs arbitrary Cypher in write mode. The Neo4j introduction says a connected client can run Cypher reads and writes and inspect nodes, relationships and paths, so the write path is part of the default surface unless an administrator removes it. Before approval, the reviewer should confirm which tools a given version advertises, because the tool list is what the client sees at startup and what it will try to call.

Read-only use still exposes data. get-schema returns labels, relationship types and property names, which can reveal how patient, customer or account records are modeled even when no record values are returned. read-cypher returns whatever a query matches, and a graph query that follows relationships returns paths, so one question from an assistant can surface a chain of linked entities across several node types. An agent that is told to answer a business question will often explore widely, so the practical exposure is set by the database user's privileges and by which labels that user can see, not only by the tool list.

The decision to make is therefore two-fold: whether the tool list should include write-cypher at all for a given environment, and which database identity the server uses to read. The Neo4j security documentation advises using a restricted Neo4j user and reviewing generated Cypher before running it, especially against production, which makes the database role the control that limits reads as well as writes. Ask the Neo4j team to document which labels, relationship types and properties that role can access, and test the exposure with the same schema queries an agent would run.

Which tools and features carry the most risk

The Neo4j MCP server exposes four tools, and only one of them is marked as not read-only. The risk sits in write-cypher, in queries an LLM writes on its own, and in procedures that the read-only check may misjudge, so each card pairs a risk with the control that narrows it.

write-cypher runs arbitrary writes

The write-cypher tool runs arbitrary Cypher in write mode, and it is the only one of the four tools marked as not read-only. Neo4j documents it for development environments only. Before connecting any client to a shared or production graph, confirm that write-cypher is absent from the advertised list. Set NEO4J_MCP_READ_ONLY to true or pass the --read-only flag, and verify the result in each client's tool list rather than assuming the setting took effect.

Tools docs

LLM-generated queries can cause harm

Neo4j's tools page warns that queries generated by an LLM can cause harm, and the security page advises reviewing generated Cypher before running it, especially against production. A model can misread the schema, delete relationships it meant to match, or run a broad MATCH with a MERGE or DELETE clause. Ask the team to test against a copy of the graph with a restricted database user, and to require human review for any query that changes data.

Security docs

Custom procedures may bypass read-only

The read-cypher tool rejects writes, schema and admin operations and PROFILE queries, and it checks each query with an extra database round-trip. Neo4j's tools page notes that a custom procedure or function that is misclassified as read-only could bypass that check. Ask the database owner to inventory custom procedures and functions, and to confirm how each one is classified. Pair read-only mode with a database user that cannot execute procedures it does not need.

Tools docs

Restricted database user as backstop

The server's own read-only flag is a control inside the MCP layer, and the database still enforces what the account can do. Neo4j's security guidance recommends a restricted Neo4j user for the MCP connection. Ask who creates that user, which roles and privileges it holds, and whether the account is separate from administrator and application accounts. Review its grants on the same schedule as other service accounts, since a broad grant defeats the read-only setting.

Security docs

GDS procedure listing exposure

The list-gds-procedures tool lists Graph Data Science procedures, and the Graph Data Science library is an optional requirement of the Neo4j MCP server. Listing is read-only, but it reveals which algorithms and procedures exist in the instance, which helps a client plan its next call. Confirm whether GDS is installed at all, and if it is, restrict the advertised tools with NEO4J_MCP_TOOLS so only the tools the team needs appear at startup.

Tools docs

How the permission layers stack

The request starts at the MCP client, which asks the Neo4j MCP server for its tool list. Startup settings (NEO4J_MCP_READ_ONLY, --read-only, NEO4J_MCP_TOOLS, --tools) decide which tools are advertised at all. In HTTP mode, per-request headers can narrow that list further but never widen it. When read-cypher runs, the server checks the query and makes an extra database round-trip before execution. The Neo4j database user sits underneath every layer, so its privileges set the final limit that no MCP setting can exceed. Check each layer separately, because a bypass in one does not stop the others.

Each layer narrows access; the database user sets the final ceiling.

How to lock the server down before first connection

This sequence sets the Neo4j MCP server's privileges in layers, starting with the database account and ending with the tools a client can see, so that a connected assistant cannot do more than the team intended. Each step names the check that confirms it is done before anyone connects.

  1. Create a restricted database user first

    The database administrator creates a dedicated Neo4j user for the MCP server and grants it only the privileges the assistant needs, typically read access to the graph the team has approved. This is the layer that holds even if every MCP-side control is misconfigured, because the server runs queries as that user. Done means the database administrator can show the user's granted privileges and confirm the account cannot write to the production database, checked by attempting a test write under that user in a non-production instance first. Ask the vendor or your own administrators which privileges the APOC and Graph Data Science procedures need, since those are installed in the same instance.

  2. Set the write exposure for each environment

    The security team decides, environment by environment, whether the server may expose write tools at all. The Neo4j MCP security guidance advises reviewing generated Cypher before running it against a production database, and the tools documentation says write-cypher is for development environments only. Set NEO4J_MCP_READ_ONLY to true (or the --read-only flag) in production and any environment holding regulated or customer data, which stops write tools from being advertised. Done means a written environment matrix exists, and the team confirms in each environment's startup configuration that the read-only setting matches it.

  3. Filter the advertised tools at startup

    The platform engineer restricts the tools list with NEO4J_MCP_TOOLS or the --tools flag so that only the tools the use case requires are offered. The documented tools are get-schema, read-cypher, write-cypher and list-gds-procedures, and only write-cypher is marked as not read-only, so a read-only deployment that also omits write-cypher is the narrowest starting point. Done means the team starts the server with the chosen configuration and confirms, through the client's list of available tools, that only the intended tools appear. Record the exact configuration in version control so reviewers can compare it with the approved design.

  4. Decide whether HTTP headers may narrow tools

    If the deployment runs in HTTP mode, the architect decides whether clients may send the X-Neo4j-MCP-Tools or X-Neo4j-MCP-ReadOnly headers to narrow the tool list per request. The documentation says these headers can only narrow the list, never widen it, so they add flexibility without adding exposure. The decision should favor a fixed server configuration unless there is a clear need for per-client differences. Done means the architecture record states whether headers are honored, and the team tests that a request carrying a header cannot re-enable a tool the startup configuration removed.

  5. Confirm how custom procedures are classified

    The database owner reviews every custom procedure and function installed in the instance and checks how each is declared to Neo4j, because the tools documentation warns that procedures or functions misclassified as read-only could bypass the read-only check. Check the classification of APOC and Graph Data Science procedures against the vendor documentation, and treat any custom code as unverified until a reviewer has read it. Done means the team holds a signed list of procedures reviewed, with any misclassified or unneeded procedure removed or restricted at the database level, and the review is repeated after new plugins or code are deployed.

  6. Test the controls before any client connects

    The security team runs a test pass against a non-production copy of the database using the restricted user and the final configuration. It checks that write attempts fail through every path it can reach, that schema and admin operations are refused, that PROFILE queries are rejected as the documentation describes, and that custom procedures cannot change data. Done means the team has a written result for each test, with any failure fixed and retested, and the approval record references the configuration version that passed. Include prompt injection scenarios in the test set, since an assistant can be steered into generating harmful queries.

  7. Approve the configuration and record the review

    The accountable owner, usually the CISO or the head of data platform, signs off on the database user, environment matrix, tool list, header decision and procedure review as one approved configuration. The record should name who may connect, which clients are approved, and when the configuration must be reviewed again, such as after a server upgrade or a plugin change. Done means the approval is stored with the configuration version and the test results, and any later change to the server's startup settings or database privileges requires a new review.

How the restriction differs for development and production

The Neo4j MCP tools page says write-cypher runs arbitrary Cypher in write mode, warns that LLM-generated queries can cause harm, and says to use it only in development environments. That makes development the one place where enabling the write tool is consistent with the vendor's guidance, provided the data behind it is disposable or synthetic. The main control is data scope, not the tool list alone.

  • Confirm the database is non-production: Point the server only at a sandbox or copy that holds no customer, employee or regulated data.
  • Keep write access deliberate: Leave the default of read-only off only for the sessions that need write-cypher, and document who enabled it.
  • Use a dedicated development user: Give the connection a restricted Neo4j user with rights limited to the development graph.
  • Reset data regularly: Rebuild the sandbox from known fixtures so accidental writes do not persist.
  • Review generated Cypher: Read each query the assistant proposes before it runs, even against a sandbox.

Before approving development use, check that the database URI and credentials cannot reach a production cluster and that no production exports were loaded into the sandbox.

Where the server's controls stop short

The Neo4j MCP server's read-only and tool controls reduce what an assistant can do, but they are not a substitute for database privileges. The cards below cover where those controls stop, and what an organization should put in place around them.

Read-cypher is a validation layer

The read-cypher tool rejects writes, schema and admin operations and PROFILE queries, but it does this by checking each query with an extra database round-trip before running it. That is a check inside the server, not a permission in the database. Confirm with the vendor how the check is performed in your server version, and treat it as one layer of defense rather than the only one.

Tools docs

Misclassified procedures can bypass the check

The tools documentation notes that custom procedures or functions that Neo4j misclassifies as read-only could bypass the read-only check. A procedure that writes but is labeled as a read can get past the server's filter. Build an allowlist of approved procedures, review custom procedures and their classification before connecting, and do not assume every installed procedure is safe because the server is in read-only mode.

Database grants remain the real boundary

The security page advises using a restricted Neo4j user. The MCP server does not replace database-side grants: the account it uses sets what it can actually do. Create a dedicated user with read-only privileges on the databases and labels the assistant needs, and confirm that the grants hold even if the server's flags are changed or bypassed. Review those grants on a schedule, not only at setup.

Security docs

LLM-generated queries stay with the organization

The documentation warns that LLM-generated queries can cause harm and advises reviewing generated Cypher before running it, especially against production. That review step is an operating control the organization must own. Decide who reviews queries, whether reviews happen before execution or through logs afterward, and which data sets a query may touch, since the assistant can read whatever the database user can read.

Keep writes off production

The write-cypher tool runs arbitrary Cypher in write mode, and the documentation says to use it only in development environments. Where a team truly needs writes, use a non-production instance with synthetic or copied data, and keep the production connection in read-only mode. Confirm that the staging connection cannot reach production hosts or credentials.

Narrow tools at startup and per request

The NEO4J_MCP_TOOLS variable and --tools flag restrict advertised tools at startup, and HTTP headers can narrow the list per request but never widen it. These filters reduce exposure, yet they are set by whoever runs the server. Verify the startup configuration in every environment, and do not rely on a client-side request header as an access control for a shared deployment.

Questions security reviewers ask before approving Neo4j MCP

Is read-only mode enough to keep the Neo4j MCP server from changing data?

Read-only mode is a strong first control, but it is not the only one. Setting NEO4J_MCP_READ_ONLY to true or using the --read-only flag stops the server from exposing write tools such as write-cypher, and the default is false, so you must turn it on yourself. The server's read-cypher tool also rejects writes, schema and admin operations and PROFILE queries, and it checks each query with an extra database round-trip. The Neo4j tools documentation warns that custom procedures or functions that Neo4j misclassifies as read-only could bypass that check. For that reason, reviewers should pair read-only mode with a database user that has only read privileges, and should confirm which custom procedures exist in the instance.

Do we need a restricted Neo4j database user, or is the MCP setting enough?

Yes, a restricted user is the control we would require. The Neo4j MCP security documentation advises using a restricted Neo4j user and reviewing generated Cypher queries before running them, especially against a production database, to avoid data loss. The MCP flags only shape which tools the client sees, so a user with broad write rights could still be reached through another path, including a misclassified procedure. Ask the database team to create a dedicated account with read-only grants on the databases the assistant needs, and to confirm in writing that the account cannot run admin or write procedures. Keep write-capable accounts out of any environment that an AI client can reach.

Is write-cypher ever appropriate outside a development environment?

The Neo4j tools documentation says write-cypher runs arbitrary Cypher in write mode, warns that LLM-generated queries can cause harm, and says to use it only in development environments. Production should therefore run with read-only mode enabled so that write-cypher is not advertised at all. If a team has a business case for writes, the safer path is to document a narrow, reviewed workflow with a separate, scoped account and a named owner, and to confirm that decision with the database and security leads before any change to the server configuration.

How do tool filtering and read-only mode differ for admins?

Read-only mode removes write tools, while tool filtering decides which tools the server advertises at all. The NEO4J_MCP_TOOLS variable or the --tools flag restricts the advertised tools at startup. In HTTP mode, the X-Neo4j-MCP-Tools or X-Neo4j-MCP-ReadOnly headers can narrow the list for a single request, but they can never widen it. This means startup settings act as the ceiling for the whole deployment, and per-request headers can only tighten what a caller sees. Reviewers should set the strictest list at startup, so a client that sends a permissive header cannot regain a tool the operator removed. Verify this behavior in your own environment during testing, since the header rules depend on the HTTP mode configuration.

Does the APOC prerequisite expand what the connected user can do?

It can, and reviewers should treat it as a privilege question. The Neo4j MCP introduction lists the APOC plugin as a prerequisite, and APOC adds many procedures, some of which read external resources or change data. Its presence does not grant anything by itself, but any procedure APOC exposes becomes a possible route for a query that the MCP layer must classify correctly. Ask the database team to list the APOC procedures enabled in the instance, to restrict which ones the MCP user can call, and to confirm how read-only checks treat them. The Graph Data Science library is optional, and the same question applies if it is installed.

What does Neo4j MCP cost, and what effort is the configuration?

The Neo4j MCP server is an open-source project published in the neo4j/mcp repository, so the software license itself is not the main cost. The effort comes from prerequisites and controls: a running Neo4j database (Aura, Neo4j Desktop or self-managed), the APOC plugin, an MCP-compatible client, and the time to create restricted users, set read-only mode, define tool lists and test each client. Cost rises with the number of databases, the number of clients, and any need for HTTP mode authentication or logging. Ask the vendor or your database provider which hosting tier and support terms apply, and request a written scope from any implementation partner before work starts. Costs for Aura or self-managed hosting come from those vendors, not from this server.

Can our own team configure Neo4j MCP safely without outside help?

A team with Neo4j administration skills and an existing security review process can usually configure the server alone, provided it has the right people in the room. The work is mostly database privileges, environment variables or flags, client configuration and testing. Gaps tend to appear in privilege design, procedure review and testing of HTTP header behavior. If your team lacks those skills, or needs independent evidence for an approval, DeployOpen can plan, implement and test a self-hosted deployment under a fixed-scope written agreement, and can run AI agent rollout security reviews that test prompt injection, tool permissions, data exposure and credential handling. DeployOpen does not issue audit reports or certifications, so your assessors would still review the evidence.

How DeployOpen tests and governs a Neo4j MCP rollout

DeployOpen approaches Neo4j MCP security and permissions as a fixed-scope engagement inside your own infrastructure, covering the server's tools, its read-only and tool filtering settings, and the database user it connects with. Work is agreed in writing before it starts, and the findings feed directly into the controls your security team reviews.

How we scope

  • Agree in writing which Neo4j instances, clients and MCP deployment modes are in scope before testing begins
  • Map which of the four tools, including write-cypher, each client may reach and who approves that exposure
  • Confirm the Neo4j database user, the APOC and optional Graph Data Science dependencies, and the environments involved
  • Engagements are fixed-scope, and ongoing support is available as a retainer once the rollout is live

How we build

  • Configure read-only mode and tool filtering at startup so write tools are not advertised to clients that should not use them
  • Set up a restricted Neo4j user with the privileges the agreed use case needs, and test what that user can still change
  • Test read-cypher against writes, schema and admin operations, PROFILE queries and custom procedures that may be misclassified
  • Test prompt injection and generated Cypher against a non-production copy of the graph before any production access

How we hand over

  • Deliver a findings report with severity, evidence, the exact configuration changes and the fixes applied
  • Document the settings, environment variables, CLI flags and per-request headers that define the approved configuration
  • Provide a retest after fixes so your team sees which findings are closed and which remain open
  • Hand over the restricted user and configuration records so your compliance team can review the controls directly

How we support

  • Re-run tool and permission tests after Neo4j MCP server upgrades, including changes between major versions
  • Review new tools, client connections and database grants before they are added to the approved list
  • Keep test evidence current for security questionnaires and internal access reviews
  • Confirm with your team which controls the organization owns and which depend on Neo4j or client vendor settings

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.