
kirschbaum-development/laravel-loop 是一个从 https://github.com/kirschbaum-development/laravel-loop. 导入的 MCP 服务器候选。
概览
kirschbaum-development/laravel-loop 是一个从 https://github.com/kirschbaum-development/laravel-loop. 导入的 MCP 服务器候选。
概述(AI 翻译)
Laravel Loop 是一款专为 Laravel 应用设计的强大模型上下文协议(MCP)服务器。它通过使用 MCP 协议将您的 Laravel 应用与 AI 助手连接起来。
Laravel Loop 在幕后使用 Prism 来构建工具。
[!重要] Laravel 循环及其预建工具仍在开发中,目前为测试版。
它的作用
Laravel 循环允许您:
- 创建并公开你自己的工具,直接集成你的Laravel应用
- 连接MCP客户端,如Claude Code、Cursor、Windsurf等
预编工具:
- Filament MCP 服务器。
- Laravel模型工具(与你的模型数据交互):
Kirschbaum\Loop\Toolkits\LaravelModelToolkit(写入操作即将发布) - Laravel Factories 工具(从您的 MCP 客户端创建测试数据):
Kirschbaum\Loop\Toolkits\LaravelFactoriesToolkit - Stripe 工具(与 Stripe API 交互):
Kirschbaum\Loop\Tools\StripeTool
安装
你可以通过 composer 安装该软件包:
发布配置文件:
用途
首先,你必须注册你的工具(如果不知道该放哪里,可以输入app/Providers/AppServiceProvider。
定制工具
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Laravel Loop
Laravel Loop is a powerful Model Context Protocol (MCP) server designed specifically for Laravel applications. It connects your Laravel application with AI assistants using the MCP protocol.
Laravel Loop uses Prism behind the scenes to build the tools.
[!IMPORTANT] Laravel Loop and its pre-built tools are still in development and this is a beta version.
What It Does
Laravel Loop allows you to:
- Create and expose your own tools directly integrated with your Laravel application
- Connect with MCP clients like Claude Code, Cursor, Windsurf, and more
Pre-built tools:
- Filament MCP Server.
- Laravel Model Tools (Interact with your models data):
Kirschbaum\Loop\Toolkits\LaravelModelToolkit(Write operations to come) - Laravel Factories Tools (Create test data from your MCP Client):
Kirschbaum\Loop\Toolkits\LaravelFactoriesToolkit - Stripe Tool (Interact with the Stripe API):
Kirschbaum\Loop\Tools\StripeTool
Installation
You can install the package via composer:
composer require kirschbaum-development/laravel-loop
Publish the configuration file:
php artisan vendor:publish --tag="loop-config"
Usage
First, you must register your tools (If you don’t know where to put, put in app/Providers/AppServiceProvider).
use Illuminate\Support\ServiceProvider;
use Kirschbaum\Loop\Facades\Loop;
use Kirschbaum\Loop\Toolkits;
use Kirschbaum\Loop\Tools;
Loop::toolkit(Kirschbaum\Loop\Filament\FilamentToolkit::make());
Custom Tools
To build your own tools, you can use the Loop::tool method.
use Kirschbaum\Loop\Facades\Loop;
use Kirschbaum\Loop\Tools\CustomTool;
Loop::tool(
CustomTool::make(
name: 'custom_tool',
description: 'This is a custom tool',
)
->withStringParameter(name: 'name', description: 'The name of the user', required: true)
->withNumberParameter(name: 'age', description: 'The age of the user')
->using(function (string $name, ?int $age = null) {
return sprintf('Hello, %s! You are %d years old.', $name, $age ?? 'unknown');
}),
);
);
The available parameters types can be found in the Prism Tool Documentation.
Custom Tool Objects
安装
npx mcp-remote https://your-remote-url.com/mcp --header Authorization: Bearer ${AUTH_TOKEN}配置
{
"mcpServers": {
"laravel-loop-mcp": {
"command": "php",
"args": [
"/your/full/path/to/laravel/artisan",
"loop:mcp:start",
"--user-id=1"
]
}
}
}