メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://kawax.biz/llms.txt

Use this file to discover all available pages before exploring further.

MCP

SessionConfigのmcpServersにMCPサーバーを指定すれば使うことができます。 Copilot CLIでLaravel Boostを使う場合は laravel-boost-copilot-cli も使いましょう。 'type' => 'stdio'(または'local')と'tools' => ['*']が必須なことが分かっています。これがないとMCPサーバーとして認識されません。
Artisan::command('copilot:mcp', function () {
    $config = new SessionConfig(
        mcpServers: [
            'laravel-boost' => [
                'type' => 'stdio',
                'command' => 'php',
                'args' => ['artisan', 'boost:mcp'],
                'tools' => ['*'],
            ],
        ],
    );

    Copilot::start(function (CopilotSession $session) {
        info('Starting Copilot with Laravel Boost MCP: '.$session->id());

        $prompt = 'どのMCPが読み込まれている? laravel-boostが使える場合はapplication-infoでアプリ情報を取得して。';

        warning($prompt);

        $response = spin(
            callback: fn () => $session->sendAndWait($prompt),
            message: 'Thinking...',
        );

        note($response->content());
    }, config: $config);
});

MCPサーバーのステータス

セッション内のMCPサーバーのステータスは以下の値を取ります:
ステータス説明
connected接続済み
failed接続失敗
needs-auth認証が必要
pending接続待ち
disabled無効化済み
not_configured未設定

MCPサーバー設定の管理(Server RPC)

セッションとは別に、サーバーレベルでMCPサーバーの設定を管理できます。
use Revolution\Copilot\Facades\Copilot;
use Revolution\Copilot\Types\Rpc\McpConfigAddRequest;
use Revolution\Copilot\Types\Rpc\McpConfigUpdateRequest;
use Revolution\Copilot\Types\Rpc\McpConfigRemoveRequest;
use Revolution\Copilot\Types\Rpc\McpServerValue;

// 設定済みのMCPサーバー一覧を取得
$result = Copilot::client()->rpc()->mcp()->list();
foreach ($result->servers as $name => $config) {
    dump($name, $config->type, $config->command);
}

// MCPサーバーを追加
Copilot::client()->rpc()->mcp()->add(new McpConfigAddRequest(
    name: 'laravel-boost',
    config: new McpServerValue(
        type: 'stdio',
        command: 'php',
        args: ['artisan', 'boost:mcp'],
        tools: ['*'],
    ),
));

// MCPサーバーの設定を更新
Copilot::client()->rpc()->mcp()->update(new McpConfigUpdateRequest(
    name: 'laravel-boost',
    config: new McpServerValue(
        type: 'stdio',
        command: 'php',
        args: ['artisan', 'boost:mcp', '--verbose'],
        tools: ['*'],
    ),
));

// MCPサーバーを削除
Copilot::client()->rpc()->mcp()->remove(new McpConfigRemoveRequest(name: 'laravel-boost'));
最新情報は GitHub リポジトリ を参照してください。
Last modified on April 19, 2026