Configuration reference
neo4j-mcp requires explicit configuration to connect to your Neo4j instance.
Configuration can be provided through environment variables or command-line flags.
Transport modes
The server supports two transport modes:
-
STDIO (default): Traditional standard input/output mode for desktop clients
-
HTTP: Web-based mode for multi-tenant scenarios and web clients
Set the transport mode using the NEO4J_TRANSPORT_MODE environment variable or --neo4j-transport-mode flag.
STDIO mode
In STDIO mode, credentials are provided via environment variables (NEO4J_USERNAME and NEO4J_PASSWORD).
The server validates connectivity and APOC availability at startup.
HTTP mode
In HTTP mode, the server operates statelessly and accepts per-request authentication credentials (Bearer Token or Basic Authentication). Also see Authentication → Bearer token authentication and Authentication → Basic authentication.
Do NOT set NEO4J_USERNAME or NEO4J_PASSWORD environment variables in HTTP mode, as credentials come from per-request authentication headers.
General configuration
The following environment variables and equivalent command-line flags are general configuration options:
| Variable | Equivalent command-line flag | Description | Default |
|---|---|---|---|
|
|
Connection URI (e.g., |
Required |
|
|
Database name |
|
|
|
Set to |
|
|
|
Set to |
|
|
|
Log level (see Logging) |
|
|
|
Log output format: |
|
|
|
Number of nodes to sample for schema inference |
100 |
|
|
This option is deprecated. Please use NEO4J_TRANSPORT_MODE |
|
|
|
Transport mode: |
|
|
|
Exclude the ping method from authentication requirements to account for integrations (such as AWS AgentCore) which rely on pings prior to initialization |
|
STDIO configuration
Additional environment variables and equivalent command-line flags for STDIO mode:
| Variable | Equivalent command-line flag | Description | Default |
|---|---|---|---|
|
|
Neo4j username (STDIO mode only) |
Required for STDIO |
|
|
Neo4j password (STDIO mode only) |
Required for STDIO |
HTTP configuration
Additional environment variables and equivalent command-line flags for HTTP mode:
| Variable | Equivalent command-line flag | Description | Default |
|---|---|---|---|
|
|
Server binding address |
|
|
|
Server listening port |
|
|
|
CORS configuration (comma-separated list, |
empty (disabled) |
TLS/HTTPS configuration
Configure TLS for secure HTTPS connections in HTTP mode:
| Variable | Equivalent command-line flag | Description | Default |
|---|---|---|---|
|
|
Enable TLS/HTTPS |
|
|
|
Path to TLS certificate file |
Required if TLS enabled |
|
|
Path to TLS private key file |
Required if TLS enabled |
|
Command-line flags take precedence over environment variables. |