Skip to content

Commit bb37f7e

Browse files
authored
Bug fixes under v1.0.0 (#37)
Bug fixes under v1.0.0
1 parent 2170710 commit bb37f7e

12 files changed

Lines changed: 375 additions & 37 deletions

.env.example

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ APP_DEBUG=true
77
APP_KEY=
88

99
# Neo4j MCP transport mode:
10-
# - stdio (default): runs the local neo4j-mcp binary.
10+
# - driver (default): in-process Bolt via laudis/neo4j-php-client — no neo4j-mcp binary required.
11+
# - stdio: runs the local neo4j-mcp binary (set NEO4J_MCP_TRANSPORT=stdio).
1112
# - http: use when the MCP server runs elsewhere and NEO4J_MCP_URL points to it.
12-
NEO4J_MCP_TRANSPORT=stdio
13+
# NEO4J_MCP_TRANSPORT=driver
1314

14-
# Neo4j database credentials (required for STDIO mode — passed to the neo4j-mcp subprocess)
15+
# Neo4j database credentials (used by driver, stdio, and container:graph)
1516
NEO4J_URI=bolt://localhost:7687
1617
NEO4J_USERNAME=neo4j
1718
NEO4J_PASSWORD=

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Default `NEO4J_MCP_TRANSPORT` is now **`driver`** (in-process Bolt) instead of `stdio`. Set `NEO4J_MCP_TRANSPORT=stdio` explicitly to use the `neo4j-mcp` binary.
13+
1014
## [1.0.0] - 2026-07-06
1115

1216
### Added

README.md

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ Release notes: [CHANGELOG.md](CHANGELOG.md).
88

99
---
1010

11+
## Table of contents
12+
13+
- [Why Use It?](#why-use-it)
14+
- [Installation & Setup](#installation--setup)
15+
- [1. Install the Package](#1-install-the-package)
16+
- [2. Update Your Environment Variables](#2-update-your-environment-variables)
17+
- [3. Run the Interactive Setup](#3-run-the-interactive-setup)
18+
- [4. Start a Local Neo4j Instance (Optional)](#4-start-a-local-neo4j-instance-optional)
19+
- [5. Connect Your MCP Client](#5-connect-your-mcp-client)
20+
- [Usage](#usage)
21+
- [MCP Client Configuration](#mcp-client-configuration)
22+
- [Cursor](#cursor)
23+
- [Claude Code](#claude-code)
24+
- [Exploring Your Container Dependency Graph](#exploring-your-container-dependency-graph)
25+
- [Available Artisan Commands](#available-artisan-commands)
26+
- [Important Notes & Advanced Configuration](#important-notes--advanced-configuration)
27+
- [Transport Modes](#transport-modes)
28+
- [Using Docker Compose (HTTP mode)](#using-docker-compose-http-mode)
29+
- [Graph Data Science (GDS) Plugin](#graph-data-science-gds-plugin)
30+
- [Automating Setup After Updates](#automating-setup-after-updates)
31+
- [Publishing Configuration (Optional)](#publishing-configuration-optional)
32+
- [Binary Platform Support](#binary-platform-support)
33+
- [Common Issues & Troubleshooting](#common-issues--troubleshooting)
34+
- [License](#license)
35+
36+
---
37+
1138
## Why Use It?
1239

1340
Out of the box, AI coding assistants can only read your local files, they can't inspect your live database schema or run Cypher queries. This package bridges that gap by connecting the official Neo4j MCP server directly into Laravel Boost. This allows your assistant to:
@@ -42,7 +69,7 @@ NEO4J_PASSWORD=your-password
4269
4370
```
4471

45-
> **Note:** `NEO4J_MCP_TRANSPORT` defaults to `driver`. You can switch to `stdio` (spawns the `neo4j-mcp` binary as a subprocess) or `http` (remote MCP server) — see the Notes section below.
72+
> **Note:** `NEO4J_MCP_TRANSPORT` defaults to `driver`. You can switch to `stdio` (spawns the `neo4j-mcp` binary as a subprocess) or `http` (remote MCP server) — see [Transport Modes](#transport-modes) below.
4673
4774
### 3. Run the Interactive Setup
4875

@@ -149,15 +176,17 @@ Once exported, you can use the **get-class-dependency-graph** MCP tool to query
149176

150177
## Important Notes & Advanced Configuration
151178

152-
**Transport Modes**
179+
### Transport Modes
180+
153181
The default is `driver`, which runs Neo4j tools in PHP over Bolt via `laudis/neo4j-php-client`. No binary needed. You have two other options:
154182

155183
* **STDIO:** Spawns the official `neo4j-mcp` binary as a subprocess. Install it with `php artisan neo4j-boost:install-mcp`, then set `NEO4J_MCP_TRANSPORT=stdio` in your `.env`.
156184
* **HTTP:** Connects to a remote or containerized MCP server. Set `NEO4J_MCP_TRANSPORT=http` and `NEO4J_MCP_URL=http://localhost:8080/mcp`. In HTTP mode, this package sends your Neo4j credentials with every request, so do not set `NEO4J_USERNAME` or `NEO4J_PASSWORD` on the MCP server container itself.
157185

158186
Remember to run `php artisan config:clear` after editing your `.env` file so Laravel picks up the change.
159187

160-
**Using Docker Compose (HTTP mode, Neo4j + MCP server)**
188+
### Using Docker Compose (HTTP mode)
189+
161190
Here is a quick setup guide if you prefer Docker:
162191

163192
```yaml
@@ -209,10 +238,12 @@ NEO4J_PASSWORD=your-password
209238
210239
```
211240

212-
**Graph Data Science (GDS) Plugin**
241+
### Graph Data Science (GDS) Plugin
242+
213243
The `list-gds-procedures` tool specifically requires the [Graph Data Science](https://neo4j.com/docs/graph-data-science/current/) plugin. If you don't have it installed, that specific tool will throw an error, but don't worry—`get-schema`, `read-cypher`, and `write-cypher` will still work perfectly. For Docker setups, just add `NEO4J_PLUGINS: '["apoc", "graph-data-science"]'` and the necessary `NEO4J_dbms_security_procedures_*` variables to your Neo4j service.
214244

215-
**Automating Setup After Updates**
245+
### Automating Setup After Updates
246+
216247
To keep everything running smoothly when you update your dependencies, you can add this script to your `composer.json`:
217248

218249
```json
@@ -226,7 +257,8 @@ To keep everything running smoothly when you update your dependencies, you can a
226257

227258
```
228259

229-
**Publishing Configuration (Optional)**
260+
### Publishing Configuration (Optional)
261+
230262
If you want to tweak the underlying config directly, publish it using:
231263

232264
```bash
@@ -236,7 +268,8 @@ php artisan vendor:publish --tag=neo4j-boost-config
236268

237269
This lets you configure options in `config/neo4j-boost.php` like `neo4j_mcp.transport` (`driver`, `stdio`, or `http`), `bolt.uri`, `bolt.username`, `http.url`, and more.
238270

239-
**Binary Platform Support**
271+
### Binary Platform Support
272+
240273
If you're using `neo4j-boost:install-mcp`, the binary supports Linux (x86_64, arm64, i386), macOS (x86_64, Apple Silicon), and Windows (x86_64, arm64, i386). Windows uses `.zip` archives (requiring `ext-zip`), while Linux and macOS use `.tar.gz`. If auto-detection fails, you can manually override it by setting `NEO4J_MCP_PLATFORM_ASSET` in your `.env`.
241274

242275
### Common Issues & Troubleshooting
@@ -245,14 +278,14 @@ If you're using `neo4j-boost:install-mcp`, the binary supports Linux (x86_64, ar
245278
* **"There are no commands defined in the 'boost' namespace"** — Laravel Boost only registers its commands when your app is in a local environment. Make sure `"env": { "APP_ENV": "local" }` is included in your MCP server entry.
246279
* **STDIO fails with "Neo4j password is required"** — You need to set `NEO4J_PASSWORD` in your `.env` file, and then run `php artisan config:clear`.
247280
* **APOC/meta errors** — Your Neo4j instance might be missing the required plugins. Recreate it by running `php artisan neo4j-boost:start-neo4j --recreate`.
248-
* **Docker: cannot connect to `bolt://localhost:7687**` — Ensure `NEO4J_URI` is pointing to the Neo4j service hostname on your container network (for example, `neo4j://neo4j:password@neo4j-core1:7687`). If you use config caching, remember to clear it with `php artisan config:clear`.
281+
* **Docker: cannot connect to `bolt://localhost:7687`** — Ensure `NEO4J_URI` is pointing to the Neo4j service hostname on your container network (for example, `neo4j://neo4j:password@neo4j-core1:7687`). If you use config caching, remember to clear it with `php artisan config:clear`.
249282
* **HTTP 404 "This server only handles requests to /mcp"** — Some MCP clients send GET requests, but the Neo4j MCP server strictly accepts POST requests on `/mcp`. The best fix is to use Laravel Boost (`php artisan boost:mcp`) so the client talks to one STDIO server, and this package handles talking to Neo4j internally. If you *must* connect a client directly, ensure the URL ends exactly with `/mcp` and that `NEO4J_TRANSPORT_MODE=http` is set on your server.
250-
* **"Unknown function 'gds.version'"** — The GDS plugin is missing. Please see the GDS note above. (Your schema and Cypher tools will still function normally).
283+
* **"Unknown function 'gds.version'"** — The GDS plugin is missing. Please see the [GDS Plugin](#graph-data-science-gds-plugin) section above. (Your schema and Cypher tools will still function normally).
251284

252285
---
253286

254287
## License
255288

256289
MIT.
257290

258-
---
291+
---

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
"php": "^8.2",
3232
"laravel/framework": "^12.0|^13.0",
3333
"laravel/boost": "^2.0",
34-
"laravel/mcp": "^0.5.1",
3534
"laudis/neo4j-php-client": "^3.4"
3635
},
3736
"require-dev": {
3837
"larastan/larastan": "^3.0",
38+
"laravel/mcp": "^0.5.1",
3939
"laravel/pint": "^1.18",
4040
"nikic/php-parser": "^5.4",
4141
"orchestra/testbench": "^10.11|^11.0",

config/neo4j-boost.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
|
99
| How this package talks to the Neo4j MCP server:
1010
|
11-
| - http : Connect to a remote MCP server over HTTP (e.g. a separate
12-
| neo4j-mcp process or container). Set NEO4J_MCP_TRANSPORT=http
13-
| and configure the "http" section below.
11+
| - driver : Run MCP tools in PHP via laudis/neo4j-php-client (Bolt). No
12+
| neo4j-mcp binary required. This is the default. Set
13+
| NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD (or DSN).
1414
|
1515
| - stdio : Run the MCP server as a subprocess and talk over stdin/stdout.
1616
| Set NEO4J_MCP_TRANSPORT=stdio and configure the "stdio" section.
1717
| The subprocess receives NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD
1818
| from transport.stdio.env so it can connect to Neo4j.
1919
|
20-
| - driver : Run MCP tools in PHP via laudis/neo4j-php-client (Bolt). No
21-
| neo4j-mcp binary required. Set NEO4J_MCP_TRANSPORT=driver and
22-
| NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD (or DSN).
20+
| - http : Connect to a remote MCP server over HTTP (e.g. a separate
21+
| neo4j-mcp process or container). Set NEO4J_MCP_TRANSPORT=http
22+
| and configure the "http" section below.
2323
|
2424
*/
2525
'transport' => [

resources/boost/guidelines/core.blade.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22

33
This package integrates the official [Neo4j MCP](https://github.com/neo4j/mcp/releases) server into Laravel so you can use Neo4j tools from MCP clients (Cursor, Claude, etc.).
44

5+
### Index
6+
7+
- [Transport modes](#transport-modes)
8+
- [Cursor config](#cursor-config)
9+
- [Run the MCP server](#run-the-mcp-server)
10+
- [Config](#config)
11+
- [Container graph POC](#container-graph-poc)
12+
- [Cursor: "Loading tools" stuck or HTTP 404](#cursor-loading-tools-stuck-or-http-404)
13+
514
### Transport modes
615

7-
The package supports **STDIO** (default — local `neo4j-mcp` binary), **HTTP** (remote MCP server), and **driver** (in-process Bolt via `NEO4J_MCP_TRANSPORT=driver`). For HTTP-only setups, run the Neo4j MCP server elsewhere (e.g. Docker) with HTTP transport, then set in `.env`:
16+
The package supports **driver** (default — in-process Bolt via `laudis/neo4j-php-client`, no `neo4j-mcp` binary), **STDIO** (`NEO4J_MCP_TRANSPORT=stdio` — local `neo4j-mcp` binary), and **HTTP** (remote MCP server). For HTTP-only setups, run the Neo4j MCP server elsewhere (e.g. Docker) with HTTP transport, then set in `.env`:
817

918
```env
1019
NEO4J_MCP_URL=http://localhost:8080/mcp
@@ -24,7 +33,7 @@
2433

2534
### Run the MCP server
2635

27-
- **With Laravel Boost:** Use a single MCP server: run `php artisan boost:mcp`. This package adds the official Neo4j tools (get-schema, read-cypher, write-cypher, list-gds-procedures, **get-class-dependency-graph**, **contribute-graph-knowledge**) to Boost’s server automatically. Tools call the HTTP MCP URL from `config/neo4j-boost.http` except **get-class-dependency-graph** and **contribute-graph-knowledge**, which read/write the container graph directly from Neo4j using `config/neo4j-boost.container_graph`.
36+
- **With Laravel Boost:** Use a single MCP server: run `php artisan boost:mcp`. This package adds the official Neo4j tools (get-schema, read-cypher, write-cypher, list-gds-procedures, **get-class-dependency-graph**, **contribute-graph-knowledge**) to Boost’s server automatically. By default, tools use **driver** transport (Bolt in PHP). Set `NEO4J_MCP_TRANSPORT=http` or `stdio` to change that. **get-class-dependency-graph** and **contribute-graph-knowledge** always read/write the container graph directly from Neo4j using `config/neo4j-boost.container_graph`.
2837
- **Without Boost:** Add the Neo4j MCP server to Cursor as an HTTP server. Run `php artisan neo4j-boost:cursor-config` so `.cursor/mcp.json` includes the `neo4j-boost` server with the configured URL.
2938

3039
Set `NEO4J_URI`, `NEO4J_USERNAME`, and `NEO4J_PASSWORD` where the Neo4j MCP server runs (and in Laravel if you use the Neo4j driver).
@@ -74,4 +83,4 @@
7483
- Open your **Laravel app folder** (the project where you ran `composer require neo4j/laravel-boost`) as the Cursor workspace, not the neo4j-boost package folder.
7584
- If `.cursor/mcp.json` is missing, run `php artisan neo4j-boost:cursor-config` to create it.
7685
- Ensure the Neo4j MCP server is running at the URL set in `NEO4J_MCP_URL` and that it is started with HTTP transport.
77-
- If you see **404 "This server only handles requests to /mcp"**: Cursor may send GET requests (e.g. for SSE); the Neo4j MCP server only accepts POST on `/mcp`. Using **Boost** (one server: `boost:mcp`) avoids this—Cursor uses stdio and this package calls Neo4j MCP over HTTP. Otherwise ensure the URL ends with `/mcp` and the server is running with HTTP transport.
86+
- If you see **404 "This server only handles requests to /mcp"**: Cursor may send GET requests (e.g. for SSE); the Neo4j MCP server only accepts POST on `/mcp`. Using **Boost** (one server: `boost:mcp`) avoids this—Cursor uses stdio to Laravel and this package talks to Neo4j via driver (default), HTTP, or STDIO. Otherwise ensure the URL ends with `/mcp` and the server is running with HTTP transport.

src/Console/SetupCommand.php

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SetupCommand extends Command
1313
{--skip-mcp : Skip Neo4j MCP binary installation}
1414
{--no-cursor-config : Skip running neo4j-boost:cursor-config}';
1515

16-
protected $description = 'Interactive setup for Neo4j Laravel Boost (Cursor config, optional STDIO binary). Use -n/--no-interaction for manual steps only.';
16+
protected $description = 'Interactive setup for Neo4j Laravel Boost (Neo4j, optional MCP binary, Cursor config). Use -n/--no-interaction for manual steps only.';
1717

1818
public function handle(): int
1919
{
@@ -60,6 +60,14 @@ public function handle(): int
6060

6161
$this->newLine();
6262

63+
$transport = Neo4jMcpConfig::transport();
64+
65+
if ($transport === 'driver' && Neo4jMcpConfig::hasNeo4jPassword()) {
66+
$this->components->info('Neo4j Laravel Boost setup complete. Driver transport is ready (Bolt — no neo4j-mcp binary required).');
67+
68+
return self::SUCCESS;
69+
}
70+
6371
if ($installer->isInstalled() && Neo4jMcpConfig::hasNeo4jPassword()) {
6472
$this->components->info('Neo4j Laravel Boost setup complete. STDIO transport is ready with the local neo4j-mcp binary.');
6573

@@ -81,33 +89,36 @@ protected function printProxyModelDescription(): void
8189
{
8290
$this->newLine();
8391
$this->components->info('Neo4j Laravel Boost setup');
84-
$this->line('Default proxy path: <fg=cyan>Boost MCP -> driver -> laudis/neo4j-php-client (Bolt)</>');
85-
$this->line('Driver transport is the default — no neo4j-mcp binary required.');
92+
$this->line('Default path: <fg=cyan>Boost MCP -> driver transport (in-process Bolt)</>');
93+
$this->line('No neo4j-mcp binary is required unless you set <fg=cyan>NEO4J_MCP_TRANSPORT=stdio</>.');
8694
$this->newLine();
8795
$this->line('Add these lines to your <fg=cyan>.env</> (reminder):');
8896
$this->line(' <fg=gray>NEO4J_URI=bolt://localhost:7687</>');
8997
$this->line(' <fg=gray>NEO4J_USERNAME=neo4j</>');
9098
$this->line(' <fg=gray>NEO4J_PASSWORD=password</>');
91-
$this->line(' <fg=gray># Optional: set NEO4J_MCP_TRANSPORT=stdio to use the neo4j-mcp binary instead</>');
9299
$this->newLine();
93100
}
94101

95102
protected function printManualInstructions(): void
96103
{
97104
$this->components->warn('Non-interactive mode: run these steps manually.');
98105
$this->newLine();
99-
$this->line(' 1. Ensure .env contains:');
106+
$this->line(' 1. Install the Neo4j MCP binary:');
107+
$this->line(' <fg=gray>php artisan neo4j-boost:install-mcp</>');
108+
$this->newLine();
109+
$this->line(' 2. Start local Neo4j:');
110+
$this->line(' <fg=gray>php artisan neo4j-boost:start-neo4j</>');
111+
$this->newLine();
112+
$this->line(' 3. Ensure .env contains:');
100113
$this->line(' <fg=gray>NEO4J_URI=bolt://localhost:7687</>');
101114
$this->line(' <fg=gray>NEO4J_USERNAME=neo4j</>');
102115
$this->line(' <fg=gray>NEO4J_PASSWORD=password</>');
103116
$this->newLine();
104-
$this->line(' 2. Configure Cursor MCP:');
105-
$this->line(' <fg=gray>php artisan neo4j-boost:cursor-config</>');
117+
$this->line(' 4. (Optional) For STDIO transport, also run install-mcp and set:');
118+
$this->line(' <fg=gray>NEO4J_MCP_TRANSPORT=stdio</>');
106119
$this->newLine();
107-
$this->line(' Optional (STDIO transport only):');
108-
$this->line(' <fg=gray>php artisan neo4j-boost:install-mcp</>');
109-
$this->line(' <fg=gray>php artisan neo4j-boost:start-neo4j</>');
110-
$this->line(' Set NEO4J_MCP_TRANSPORT=stdio in .env');
120+
$this->line(' 5. Configure Cursor MCP:');
121+
$this->line(' <fg=gray>php artisan neo4j-boost:cursor-config</>');
111122
$this->newLine();
112123
}
113124

@@ -125,6 +136,13 @@ protected function shouldInstallMcpBinary(): bool
125136
return false;
126137
}
127138

139+
if (Neo4jMcpConfig::transport() === 'driver') {
140+
return $this->confirm(
141+
'Install the official Neo4j MCP server binary? (only required for NEO4J_MCP_TRANSPORT=stdio)',
142+
false
143+
);
144+
}
145+
128146
return $this->confirm(
129147
'Install the official Neo4j MCP server binary for this project?',
130148
true

src/Neo4jBoostServiceProvider.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
use Neo4j\LaravelBoost\StaticAnalysis\InstantiationEdgeFinder;
4242
use Neo4j\LaravelBoost\StaticAnalysis\ServiceLocationEdgeFinder;
4343
use Neo4j\LaravelBoost\Support\ContainerGraphConnection;
44+
use Neo4j\LaravelBoost\Support\DevDependencyConfigPublisher;
4445
use Neo4j\LaravelBoost\Support\Neo4jBoltClient;
4546

4647
class Neo4jBoostServiceProvider extends ServiceProvider
@@ -53,7 +54,7 @@ public function register(): void
5354
$this->app->singleton(BoltExecutorInterface::class, Neo4jBoltExecutor::class);
5455

5556
$this->app->singleton(Neo4jMcpClientInterface::class, function ($app) {
56-
$driver = strtolower((string) config('neo4j-boost.neo4j_mcp.transport', 'stdio'));
57+
$driver = strtolower((string) config('neo4j-boost.neo4j_mcp.transport', 'driver'));
5758

5859
return match ($driver) {
5960
'driver' => new Neo4jDriverClient($app->make(BoltExecutorInterface::class)),
@@ -90,10 +91,19 @@ public function register(): void
9091

9192
public function boot(): void
9293
{
94+
$configSource = __DIR__.'/../config/neo4j-boost.php';
95+
$configDestination = config_path('neo4j-boost.php');
96+
9397
$this->publishes([
94-
__DIR__.'/../config/neo4j-boost.php' => config_path('neo4j-boost.php'),
98+
$configSource => $configDestination,
9599
], 'neo4j-boost-config');
96100

101+
(new DevDependencyConfigPublisher)->publishIfMissing(
102+
$configSource,
103+
$configDestination,
104+
$this->app->basePath(),
105+
);
106+
97107
$this->mergeBoostTools();
98108

99109
if ($this->app->runningInConsole()) {

0 commit comments

Comments
 (0)