Skip to content

Commit 80423d3

Browse files
authored
Merge pull request #83 from opgginc/feat/add-lumen-support-for-v9
Add Lumen v9+ compatibility
2 parents d10ec99 + deff734 commit 80423d3

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ The MCP protocol also defines a "Streamable HTTP SSE" mode, but this package doe
274274
## Requirements
275275

276276
- PHP >=8.2
277-
- Laravel >=10.x or Lumen >=11.x
277+
- Laravel >=10.x or Lumen >=9.x
278278

279279
## Installation
280280

@@ -291,7 +291,7 @@ The MCP protocol also defines a "Streamable HTTP SSE" mode, but this package doe
291291

292292
### Lumen Setup
293293

294-
The package also supports Lumen 11.x applications. After installing the dependency via Composer:
294+
The package also supports Lumen 9.x and newer applications. After installing the dependency via Composer:
295295

296296
1. Enable the optional helpers you need inside `bootstrap/app.php`:
297297
```php

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
"require": {
1212
"php": "^8.2",
1313
"spatie/laravel-package-tools": "^1.16",
14-
"illuminate/contracts": "^10.0||^11.0||^12.0"
14+
"illuminate/contracts": "^9.0||^10.0||^11.0||^12.0"
1515
},
1616
"require-dev": {
1717
"laravel/pint": "^1.14",
18-
"laravel/lumen-framework": "^11.0",
18+
"laravel/lumen-framework": "^9.0||^10.0||^11.0",
1919
"nunomaduro/collision": "^8.1.1||^7.10.0",
2020
"larastan/larastan": "^2.9||^3.0",
2121
"orchestra/testbench": "^9.0.0||^8.22.0",

src/LaravelMcpServerServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function registerRoutes(): void
7676
}
7777

7878
// Skip route registration if MCPServer instance doesn't exist
79-
if (! app()->has(MCPServer::class)) {
79+
if (! $this->app->bound(MCPServer::class)) {
8080
return;
8181
}
8282

tests/Lumen/TestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ protected function setUp(): void
1616
{
1717
parent::setUp();
1818

19+
if (! class_exists(\Laravel\Lumen\Application::class)) {
20+
$this->markTestSkipped('Laravel Lumen is not installed.');
21+
}
22+
1923
$this->app = new TestingApplication($this->basePath());
2024
$this->app->instance('path.config', $this->basePath('config'));
2125
$this->app->instance('config', new ConfigRepository);

0 commit comments

Comments
 (0)