Breaking change — must NOT be merged into main. Target branch: v2.
Context
The Neo4j MCP server currently accepts only a single database per deployment, configured at startup via the NEO4J_DATABASE environment variable or CLI argument. As part of the multi-tenant proposal, the database name must become a per-request concern in HTTP mode, expressed directly in the URL path.
The new path format is:
When the {databaseName} segment is absent the server should fail.
Goals
1 — Expose the new URL path handler
Register the /db/{databaseName}/mcp/ route in the HTTP server replacing the existing /mcp route.
2 — Extract database name from URL path and inject into context.Context
Parse {databaseName} from the matched route and place it on the request context so the Neo4j driver can consume it downstream, mirroring the existing pattern used for auth headers.
3 — Raise an error when NEO4J_DATABASE or --neo4j-database is set in HTTP mode
The NEO4J_DATABASE environment variable and its CLI argument equivalent are meaningful only in STDIO mode. In HTTP mode the database is expressed via the URL path (sub-task 2).
This change must land in the v2 branch and must not be backported to main.
Context
The Neo4j MCP server currently accepts only a single database per deployment, configured at startup via the
NEO4J_DATABASEenvironment variable or CLI argument. As part of the multi-tenant proposal, the database name must become a per-request concern in HTTP mode, expressed directly in the URL path.The new path format is:
When the
{databaseName}segment is absent the server should fail.Goals
1 — Expose the new URL path handler
Register the
/db/{databaseName}/mcp/route in the HTTP server replacing the existing/mcproute.2 — Extract database name from URL path and inject into
context.ContextParse
{databaseName}from the matched route and place it on the request context so the Neo4j driver can consume it downstream, mirroring the existing pattern used for auth headers.3 — Raise an error when
NEO4J_DATABASEor--neo4j-databaseis set in HTTP modeThe
NEO4J_DATABASEenvironment variable and its CLI argument equivalent are meaningful only in STDIO mode. In HTTP mode the database is expressed via the URL path (sub-task 2).This change must land in the
v2branch and must not be backported tomain.