Skip to content

Commit b052504

Browse files
committed
First commit
0 parents  commit b052504

15 files changed

+971
-0
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
labels:
12+
- "dependencies"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: dependabot-auto-merge
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
15+
- name: Dependabot metadata
16+
id: metadata
17+
uses: dependabot/[email protected]
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
21+
- name: Auto-merge Dependabot PRs for semver-minor updates
22+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
23+
run: gh pr merge --auto --merge "$PR_URL"
24+
env:
25+
PR_URL: ${{github.event.pull_request.html_url}}
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
28+
- name: Auto-merge Dependabot PRs for semver-patch updates
29+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
30+
run: gh pr merge --auto --merge "$PR_URL"
31+
env:
32+
PR_URL: ${{github.event.pull_request.html_url}}
33+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Fix PHP code style issues
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
php-code-styling:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }}
21+
22+
- name: Fix PHP code style issues
23+
uses: aglipanci/[email protected]
24+
25+
- name: Commit changes
26+
uses: stefanzweifel/git-auto-commit-action@v5
27+
with:
28+
commit_message: Fix styling

.github/workflows/phpstan.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'composer.lock'
8+
- 'phpstan.neon.dist'
9+
- '.github/workflows/phpstan.yml'
10+
11+
jobs:
12+
phpstan:
13+
name: phpstan
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 5
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.4'
23+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, swoole, openssl
24+
coverage: none
25+
26+
- name: Install composer dependencies
27+
uses: ramsey/composer-install@v3
28+
29+
- name: Run PHPStan
30+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/run-tests.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: run-tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
os: [ubuntu-latest]
16+
php: [8.3, 8.4]
17+
laravel: [11.*, 12.*]
18+
stability: [prefer-lowest, prefer-stable]
19+
include:
20+
- laravel: 11.*
21+
testbench: ^9.9
22+
carbon: ^2.63
23+
- laravel: 12.*
24+
testbench: 10.*
25+
carbon: ^2.63|^3.0
26+
27+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Setup PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php }}
37+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, swoole, openssl
38+
coverage: pcov
39+
40+
- name: Setup problem matchers
41+
run: |
42+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
43+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
44+
45+
- name: Install dependencies
46+
run: |
47+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
48+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
49+
50+
- name: List Installed Dependencies
51+
run: composer show -D
52+
53+
- name: Execute tests
54+
run: vendor/bin/pest --ci --bail --compact --memory --coverage --parallel
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: main
20+
21+
- name: Update Changelog
22+
uses: stefanzweifel/changelog-updater-action@v1
23+
with:
24+
latest-version: ${{ github.event.release.name }}
25+
release-notes: ${{ github.event.release.body }}
26+
27+
- name: Commit updated CHANGELOG
28+
uses: stefanzweifel/git-auto-commit-action@v5
29+
with:
30+
branch: main
31+
commit_message: Update CHANGELOG
32+
file_pattern: CHANGELOG.md

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
vendor
2+
composer.lock
3+
node_modules
4+
build
5+
.pint.cache
6+
.idea

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) Kirschbaum Development Group
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Filament MCP Server - Laravel Loop
2+
3+
The Laravel Loop Filament MCP Server is an extension for [Laravel Loop](https://github.com/kirschbaum-development/laravel-loop) that exposes your Filament Resources as an MCP server. This allows AI assistants and MCP clients to interact with your Filament Resources for data listing, querying, and (optionally) actions.
4+
5+
## What It Does
6+
7+
- Exposes your Filament Resources as MCP tools
8+
- Allows AI assistants and MCP clients to:
9+
- List available Filament Resources
10+
- Describe resource structure, fields, columns, filters, and relationships
11+
- Query resource data with filters
12+
- (Optionally) Execute resource actions (bulk actions, etc.)
13+
14+
## Installation
15+
16+
1. Make sure you have Laravel Loop installed and configured.
17+
18+
2. Install the package:
19+
20+
```bash
21+
composer require kirschbaum-development/laravel-loop-filament
22+
```
23+
24+
3. Register the Filament toolkit in your application. This is typically done in a service provider (e.g., AppServiceProvider):
25+
26+
```php
27+
use Kirschbaum\Loop\Loop;
28+
use Kirschbaum\Loop\Filament\FilamentToolkit;
29+
30+
Loop::toolkit(FilamentToolkit::make());
31+
```
32+
33+
By default, it exposes all your Filament resources. You can control which resources are exposed with the `resources` parameter.
34+
35+
```php
36+
use Kirschbaum\Loop\Loop;
37+
use Kirschbaum\Loop\Filament\FilamentToolkit;
38+
39+
Loop::toolkit(FilamentToolkit::make(resources: [
40+
\App\Filament\Resources\UserResource::class,
41+
\App\Filament\Resources\PostResource::class,
42+
]));
43+
```
44+
45+
By default, the toolkit is in read-only mode. To expose the bulk actions of your Filament resources, you can register the tool with ReadWrite model.
46+
47+
```php
48+
use Kirschbaum\Loop\Loop;
49+
use Kirschbaum\Loop\Filament\FilamentToolkit;
50+
use Kirschbaum\Loop\Enums\Mode;
51+
52+
Loop::toolkit(
53+
FilamentToolkit::make(mode: Mode::ReadWrite)
54+
);
55+
```
56+
57+
## Usage
58+
59+
60+
## Security
61+
Only expose the MCP endpoint to trusted clients. Use authentication middleware (e.g., Sanctum) for HTTP endpoints.
62+
63+
## License
64+
65+
MIT

composer.json

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"name": "kirschbaum-development/laravel-loop-filament-mcp-server",
3+
"description": "Filament MCP Server for Laravel Loop",
4+
"type": "library",
5+
"license": "MIT",
6+
"autoload": {
7+
"psr-4": {
8+
"Kirschbaum\\Loop\\Filament\\": "src/"
9+
}
10+
},
11+
"autoload-dev": {
12+
"psr-4": {
13+
"Tests\\": "tests/",
14+
"Workbench\\App\\": "workbench/app/",
15+
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
16+
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
17+
}
18+
},
19+
"authors": [
20+
{
21+
"name": "Luís Dalmolin",
22+
"email": "[email protected]"
23+
}
24+
],
25+
"require": {
26+
"spatie/laravel-package-tools": "^1.18",
27+
"filament/support": "^3.2",
28+
"filament/notifications": "^3.2",
29+
"filament/filament": "^3.2"
30+
},
31+
"require-dev": {
32+
"pestphp/pest": "^3.8",
33+
"illuminate/auth": "^11.0|^12.0",
34+
"orchestra/testbench": "^9.9|^10.0",
35+
"pestphp/pest-plugin-laravel": "^3.1",
36+
"pestphp/pest-plugin-livewire": "^3.0",
37+
"laravel/pint": "^1.21",
38+
"larastan/larastan": "^3.4"
39+
},
40+
"config": {
41+
"allow-plugins": {
42+
"pestphp/pest-plugin": true
43+
}
44+
},
45+
"scripts": {
46+
"post-autoload-dump": [
47+
"@clear",
48+
"@prepare"
49+
],
50+
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
51+
"prepare": "@php vendor/bin/testbench package:discover --ansi",
52+
"build": "@php vendor/bin/testbench workbench:build --ansi",
53+
"serve": [
54+
"Composer\\Config::disableProcessTimeout",
55+
"@build",
56+
"@php vendor/bin/testbench serve --ansi"
57+
],
58+
"analyse": [
59+
"@php vendor/bin/phpstan analyse"
60+
],
61+
"lint": [
62+
"@php vendor/bin/pint --ansi"
63+
],
64+
"test": [
65+
"@clear",
66+
"@php vendor/bin/pest"
67+
],
68+
"check": [
69+
"@lint",
70+
"@analyse",
71+
"@test"
72+
]
73+
}
74+
}

0 commit comments

Comments
 (0)