
php-mcp/laravel
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Laravel MCPサーバーを構築するSDKです
概要
このSDKは強力なphp-mcp/serverライブラリのLaravel最適化ラッパーを提供し、Laravelアプリケーションの機能を標準化されたMCP、、として公開し、AnthropicのClaude、Cursor IDE、OpenAIのChatGPTなどのAIアシスタント向けに公開できます。 - : Laravelのサービスコンテナ、設定、キャッシュ、ログ、セッション、Artisanコンソールとの深い統合 - : Mcpのファサードを用いた洗練されたLaravelスタイルのAPIでMCP要素を定義 - : PHP 8属性(#[McpTool]、#[McpResource]など)を使用
概要(AI 翻訳)
エンタープライズレベルの機能とLaravelネイティブ統合を備えたモデルコンテキストプロトコル(MCP)サーバー構築のための包括的なLaravel SDKです。
このSDKは強力なphp-mcp/serverライブラリのララベルを最適化し、AnthropicのClaude、Cursor IDE、OpenAIのChatGPTなどのAIアシスタント向けに、Laravelアプリケーションの機能を標準化されたMCP(ツール)、資源、プロンプト、リソーステンプレートとして公開できます。
主な特徴
- Laravel-ネイティブ統合:Laravelのサービスコンテナ、設定、キャッシュ、ログ、セッション、Artisanコンソールとの深い統合
- Fluent Element Definition:
Mcpファサードを用いた洗練されたLaravelスタイルのAPIでMCP要素を定義します - 属性ベースディスカバリー:PHP 8属性(
#[McpTool]、#[McpResource]など)を自動発見とキャッシュで使用します - 高度なセッション管理:Laravelネイティブのセッションハンドラ(ファイル、データベース、キャッシュ、Redis)で自動ガベージコレクションを搭載
- 柔軟な輸送オプション:
- 統合HTTP:ミドルウェア対応のLaravelルート経由でサービス
- 専用HTTPサーバー:高性能のスタンドアロンReactPHPサーバー
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Laravel MCP Server SDK
A comprehensive Laravel SDK for building Model Context Protocol (MCP) servers with enterprise-grade features and Laravel-native integrations.
This SDK provides a Laravel-optimized wrapper for the powerful php-mcp/server library, enabling you to expose your Laravel application’s functionality as standardized MCP Tools, Resources, Prompts, and Resource Templates for AI assistants like Anthropic’s Claude, Cursor IDE, OpenAI’s ChatGPT, and others.
Key Features
- Laravel-Native Integration: Deep integration with Laravel’s service container, configuration, caching, logging, sessions, and Artisan console
- Fluent Element Definition: Define MCP elements with an elegant, Laravel-style API using the
Mcpfacade - Attribute-Based Discovery: Use PHP 8 attributes (
#[McpTool],#[McpResource], etc.) with automatic discovery and caching - Advanced Session Management: Laravel-native session handlers (file, database, cache, redis) with automatic garbage collection
- Flexible Transport Options:
- Integrated HTTP: Serve through Laravel routes with middleware support
- Dedicated HTTP Server: High-performance standalone ReactPHP server
- STDIO: Command-line interface for direct client integration
- Streamable Transport: Enhanced HTTP transport with resumability and event sourcing
- Artisan Commands: Commands for serving, discovery, and element management
- Full Test Coverage: Comprehensive test suite ensuring reliability
This package supports the 2025-03-26 version of the Model Context Protocol.
Requirements
- PHP >= 8.1
- Laravel >= 10.0
- Extensions:
json,mbstring,pcre(typically enabled by default)
Installation
Install the package via Composer:
composer require php-mcp/laravel:^3.0 -W
Publish the configuration file:
php artisan vendor:publish --provider="PhpMcp\Laravel\McpServiceProvider" --tag="mcp-config"
For database session storage, publish the migration:
php artisan vendor:publish --provider="PhpMcp\Laravel\McpServiceProvider" --tag="mcp-migrations"
php artisan migrate
Configuration
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"my-laravel-app": {
"command": "php",
"args": [
"/absolute/path/to/your/laravel/project/artisan",
"mcp:serve",
"--transport=stdio"
]
}
}
}