Configuration
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.
Environment variables
The following environment variables are used for configuration:
| Variable | Description | Default |
|---|---|---|
|
Connection URI (e.g., |
Required |
|
Neo4j username (STDIO mode only) |
Required for STDIO |
|
Neo4j password (STDIO mode only) |
Required for STDIO |
|
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: |
|
HTTP mode configuration
Additional environment variables for HTTP mode:
| Variable | 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 | Description | Default |
|---|---|---|
|
Enable TLS/HTTPS |
|
|
Path to TLS certificate file |
Required if TLS enabled |
|
Path to TLS private key file |
Required if TLS enabled |
|
TLS configuration enforces TLS 1.2 minimum with secure default cipher suites. When TLS is enabled, the default port changes from 80 to 443. For detailed TLS/HTTPS setup instructions, certificate requirements, and testing procedures, see TLS/HTTPS Setup. |
Command-line flags
The following command-line flags are available and take precedence over environment variables:
General flags
| Flag | Description |
|---|---|
|
Override |
|
Override |
|
Override |
|
Override |
|
Override |
|
Override |
|
Override |
|
Override |
|
Display version information |
HTTP mode flags
| Flag | Description |
|---|---|
|
Override |
|
Override |
|
Override |
|
Override |
|
Override |
Command-line flags take precedence over environment variables.
|
STDIO mode: The three required connection parameters (URI, username, and password) must be provided via environment variables, command-line flags, or a combination of both. HTTP mode: Only the URI is required via environment variables or command-line flags. Credentials are provided per-request via Basic Authentication headers. |