Skip to main content
Glama
Laravel MCP Companion

Laravel MCP Companion

Laravel ドキュメント MCP サーバー

GitHub リリース(最新日付) パイパイ Pythonバージョン GitHub ワークフローステータス ライセンス Dockerイメージ 鍛冶屋のバッジ GitHubスター GitHubフォーク

⚠️アルファソフトウェア- このプロジェクトはまだ開発初期段階です。機能が期待どおりに動作しない可能性があり、予告なく変更が行われる可能性があります。

Laravel開発者向けのAIアシスタント。最新のLaravelドキュメントへのアクセスと、Model Context Protocol(MCP)を介したインテリジェントなパッケージレコメンデーションを提供します。これにより、AIツールは最新の情報とベストプラクティスに基づいたLaravelアプリケーションの構築を支援します。

概要

このサーバーにより、AIアシスタントはモデルコンテキストプロトコル(MCP)を使用してLaravelのドキュメントやパッケージの推奨事項にアクセスできるようになります。これにより、AIツールは以下のことが可能になります。

  • Laravelドキュメントにアクセスして検索する

  • 特定のユースケースに基づいてパッケージの推奨事項を受け取る

  • 人気のLaravelパッケージの実装ガイドを入手

  • Laravel の GitHub リポジトリからドキュメントを自動的に更新する

Related MCP server: Apple Doc MCP

インストール

Smithery経由のクイックインストール

npx -y @smithery/cli install @brianirish/laravel-docs-mcp --client claude

PyPIからインストール

pip install laravel-docs-mcp

ドッカー

# Pull and run the latest version
docker run -p 8000:8000 ghcr.io/brianirish/laravel-docs-mcp:latest

# Or run a specific version
docker run -p 8000:8000 ghcr.io/brianirish/laravel-docs-mcp:v0.1.4

ソースからの手動インストール

前提条件

  • Python 3.12以上

  • uvパッケージ マネージャー (推奨)

手順

  1. リポジトリをクローンします。

    git clone https://github.com/brianirish/laravel-docs-mcp.git
    cd laravel-docs-mcp
  2. 環境をセットアップし、依存関係をインストールします。

    # Create and activate virtual environment
    uv venv
    source .venv/bin/activate  # Linux/macOS
    # or
    .venv\Scripts\activate     # Windows
    
    # Install dependencies
    uv pip install .

使用法

サーバーの起動

python laravel_docs_server.py

サーバーは最初の実行時に Laravel ドキュメントを自動的に取得し、Ctrl+C で停止できます。

コマンドラインオプション

オプション

説明

--docs-path PATH

ドキュメントディレクトリのパス(デフォルト: ./docs)

--server-name NAME

サーバー名(デフォルト:LaravelDocs)

--log-level LEVEL

ログレベル: DEBUG、INFO、WARNING、ERROR、CRITICAL (デフォルト: INFO)

--transport TYPE

トランスポート方法: stdio、websocket、sse (デフォルト: stdio)

--host HOST

バインドするホスト(ネットワークトランスポート)

--port PORT

リッスンするポート(ネットワークトランスポート)

--version VERSION

Laravel バージョン ブランチ (デフォルト: 12.x)

--update-docs

開始前にドキュメントを更新する

--force-update

フォースドキュメントの更新

カスタム オプションの例:

python laravel_docs_server.py --docs-path /path/to/docs --version 11.x --update-docs --transport websocket --host localhost --port 8000

ドキュメントアップデータ

ドキュメントを個別に更新することもできます。

# Update documentation
python docs_updater.py --target-dir ./docs --version 12.x

# Check if update is needed
python docs_updater.py --check-only

# Force update
python docs_updater.py --force

APIリファレンス

クライアントの例

import asyncio
from fastmcp import Client

async def main():
    client = Client("path/to/laravel_docs_server.py")
    
    async with client:
        # List documentation
        result = await client.call_tool("list_docs", {})
        print(result)
        
        # Search documentation
        result = await client.call_tool("search_docs", {"query": "routing"})
        print(result)
        
        # Get package recommendations
        result = await client.call_tool("get_package_recommendations", 
                                       {"use_case": "implementing subscription billing"})
        print(result)
        
        # Read documentation
        resource = await client.read_resource("laravel://routing.md")
        print(resource)

if __name__ == "__main__":
    asyncio.run(main())

利用可能なツール

ドキュメントツール

  • list_docs() - すべてのドキュメントファイルを一覧表示する

  • search_docs(query: str) - 特定の用語でドキュメントを検索する

  • update_docs(version: Optional[str], force: bool) - ドキュメントを更新する

  • docs_info() - ドキュメントのバージョン情報を取得する

パッケージ推奨ツール

  • get_package_recommendations(use_case: str) - ユースケースのパッケージ推奨事項を取得する

  • get_package_info(package_name: str) - 特定のパッケージの詳細を取得する

  • get_package_categories(category: str) - 特定のカテゴリ内のパッケージを一覧表示する

  • get_features_for_package(package: str) - パッケージで利用可能な機能を取得する

リソースアクセス

ドキュメント ファイルには、次の方法でリソースとしてアクセスできます。

laravel://{path}

例:

  • laravel://routing.md

  • laravel://authentication.md

自動化されたワークフロー

このプロジェクトには、自動化された GitHub Actions ワークフローがいくつか含まれています。

毎日のドキュメント更新

  • トリガー: 毎日午前0時UTC(手動でトリガーすることもできます)

  • プロセス: Laravel ドキュメントの更新をチェック → PR を作成 → 自動マージ → パッチ バージョン タグを作成

  • 結果: Laravelドキュメントが更新されると自動的にパッチがリリースされる

リリースパブリッシング

  • トリガー: バージョンタグがプッシュされたとき (例: v0.1.4 )

  • プロセス: パッケージをビルド → PyPI に公開 → Docker イメージをビルドして GHCR にプッシュ

  • 結果: PyPIとDocker Hub間でリリースが同期されました

動的バージョン管理

  • バージョンソース: hatch-vcsを使用して git タグから自動的に導出されます

  • 開発ビルド: 一意の識別子を取得します (例: 0.1.3.dev1+g75aec71 )

  • リリースビルド: タグに一致するクリーンなバージョン番号 (例: 0.1.4 )

機能とロードマップ

現在の機能:

  • ✅毎日のドキュメント更新: Laravel の GitHub リポジトリと毎日自動的に同期します

  • ✅動的バージョン管理: Git タグに基づく自動バージョン管理

  • ✅自動リリース: ドキュメントの更新によってトリガーされるパッチリリース

  • ✅複数のデプロイメントオプション: PyPI パッケージ、Docker イメージ、Smithery マーケットプレイス

  • ✅パッケージの推奨事項: 特定のユースケースに基づいたインテリジェントな提案

  • ✅実装ガイダンス: 一般的な Laravel パッケージの詳細情報

  • ✅柔軟な構成: 複数の Laravel バージョンとトランスポート方法をサポート

  • ✅正常なシャットダウン:適切なクリーンアップとシグナル処理

計画されている機能:

  • 🔄 マルチバージョンサポート(複数の Laravel バージョンのドキュメントに同時にアクセス)

  • 🔍 ユーザープロジェクト分析によるカスタマイズされた推奨事項

  • 🚀 セマンティックマッチングによる検索機能の強化

  • 📊 使用状況分析と洞察

  • 🔗 Laravelエコシステムの追加統合

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

貢献

貢献を歓迎します!ガイドラインについてはCONTRIBUTING.mdをご覧ください。

謝辞

  • 優れたドキュメントを提供するLaravel

  • エコシステムへの貢献に対して Laravel パッケージの作者に感謝

Available Tools

4 tools
call_toolA

Call a tool by name with the given arguments.

Use this to execute tools discovered via search_tools.

Inputs: name (required), arguments.

read_laravel_doc_sectionA
Read-onlyIdempotent

Read one section of a documentation page.

Give it a search result's file (as filename) and section, and it returns that section's markdown and nothing else. This is the cheap way to read: a whole page such as queues.md runs to tens of thousands of tokens, and an answer usually needs one section of it.

section may be an anchor ("dealing-with-failed-jobs"), a heading ("Dealing With Failed Jobs") or a heading written as a slug. If the section is not found, the error lists the sections the page does have.

Inputs: section (required), filename (required), version. Returns: file, corpus, content, heading, +2 more

search_laravel_docsA
Read-onlyIdempotent

Search Laravel's documentation and get back the sections that answer the question.

Covers every corpus on this server at once: the framework docs for the selected Laravel version, the first-party services (Forge, Vapor, Envoyer, Nova, Cloud, Nightwatch, Herd), fetched package docs (Livewire, Filament, Inertia, Spatie and others) and learning resources. Each result names a file and a section; pass them to read_laravel_doc_section as filename and section to read just that section.

Use it first for any Laravel question. Narrow with sources when you know the corpus, and set version for an older Laravel release. Results are ranked across corpora, and no single source takes the whole page when others match. Nothing found is a normal result with count 0.

Inputs: query (required), limit, sources, version, +1 more. Returns: count, query, scope, results, +2 more

search_toolsA

Search for tools using natural language.

Returns matching tool definitions ranked by relevance, in the same format as list_tools.

Inputs: query (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation4/5

    The core docs tools are clearly distinct: search_laravel_docs finds sections and read_laravel_doc_section reads them. The main ambiguity comes from the meta pair search_tools/call_tool, which creates an alternate path for invoking tools and could be confused with the docs search tool due to the shared 'search' prefix.

    Naming Consistency4/5

    All names are snake_case and follow a verb_noun pattern (call_tool, search_laravel_docs, read_laravel_doc_section, search_tools). Minor inconsistencies exist: 'docs' vs 'doc' and 'laravel' is included in the docs tools but not in the generic meta tools.

    Tool Count4/5

    Four tools is a reasonable size for a documentation retrieval server. The two core domain tools cover the main workflow, while search_tools and call_tool add a dynamic tool-discovery layer that is useful but slightly redundant given the tools are already exposed directly.

    Completeness4/5

    The essential docs lifecycle is covered: search across corpora and read a specific section cheaply. Minor gaps include no explicit tool to list available sources, corpora, or Laravel versions, though those can be supplied as search parameters.

    Maintenance

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server providing file search and question tools for AI models. Enables keyword search in files with line numbers and integration with external chat services.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to introspect a Laravel application's routes, models, controllers, migrations, and more through the Model Context Protocol, running locally via php artisan commands and filesystem scanning.
      8 npm
      MIT