laravel-inertia-integration

laravel-inertia-integration is a cursor rule for Cursor from dalehurley/php-mcp-sdk. It costs 13 tokens per session (3,095 once invoked), scanned A, original, MIT.

Guidance for connecting a PHP MCP software kit to Laravel, a PHP web framework, and InertiaJS, a tool for building web pages with server-side routing and front-end components. It covers registering MCP servers, clients, and tools in Laravel.

In plain words
What is it for?
Use it when adding MCP server or client features to a Laravel and InertiaJS application, including registering tool handlers through configuration.
Why use it?
It provides an organized way to make MCP components available through Laravel’s application container instead of wiring them into each request manually.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding MCP server or client features to a Laravel and InertiaJS application, including registering tool handlers through configuration.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/dalehurley/php-mcp-sdk/laravel-inertia-integration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/dalehurley/php-mcp-sdk

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for laravel-inertia-integration

README.md
[![agentmods](https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/laravel-inertia-integration/github.svg)](https://agentmods.dev/rules/dalehurley/php-mcp-sdk/laravel-inertia-integration)
Your own site
<a href="https://agentmods.dev/rules/dalehurley/php-mcp-sdk/laravel-inertia-integration"><img src="https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/laravel-inertia-integration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for laravel-inertia-integration

Your own site · 80×15
<a href="https://agentmods.dev/rules/dalehurley/php-mcp-sdk/laravel-inertia-integration"><img src="https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/laravel-inertia-integration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,095 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.03095
Opus 5 $0.00006 $0.01548
Sonnet 5 $0.00003 $0.00619
Haiku 4.5 $0.00001 $0.00310

Measured 10d ago against content hash 1ce6269b0c31, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

laravel-inertia-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/laravel-inertia-integration.mdc · 458 lines

How it starts

The opening of the file, as written. The whole thing — 458 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Laravel and InertiaJS Integration Guide

Laravel Service Provider

Create a service provider to register MCP components in Laravel:

namespace MCP\Laravel;

use Illuminate\Support\ServiceProvider;
use MCP\Server\McpServer;
use MCP\Client\Client;
use MCP\Types\Implementation;

class McpServiceProvider extends ServiceProvider {
    public function register(): void {
        // Register MCP Server as singleton
        $this->app->singleton(McpServer::class, function ($app) {
            $server = new McpServer(
                new Implementation(
                    name: config('mcp.server.name', 'laravel-mcp'),
                    version: config('mcp.server.version', '1.0.0')
                )
            );

            // Auto-register tools from config
            foreach (config('mcp.tools', []) as $name => $config) {
                $handler = $app->make($config['handler']);
                $server->registerTool($name, $config['definition'], [$handler, 'handle']);
            }

            return $server;
        });

        // Register MCP Client
        $this->app->singleton(Client::class, function ($app) {
            return new Client(
                new Implementation(
                    name: config('mcp.client.name', 'laravel-client'),
                    version: config('mcp.client.version', '1.0.0')
                ),
                [
                    'capabilities' => config('mcp.client.capabilities', [])
                ]
            );
        });
    }

    public function boot(): void {
        // Publish config
        $this->publishes([
            __DIR__ . '/../config/mcp.php' => config_path('mcp.php'),
        ], 'mcp-config');

        // Register routes if enabled
        if (config('mcp.routes.enabled', false)) {
            $this->loadRoutesFrom(__DIR__ . '/../routes/mcp.php');
        }
    }
}

Configuration File

// config/mcp.php
return [
    'server' => [
        'name' => env('MCP_SERVER_NAME', 'laravel-mcp-server'),
        'version' => env('MCP_SERVER_VERSION', '1.0.0'),
        'transport' => env('MCP_SERVER_TRANSPORT', 'streamable-http'),
    ],

    'client' => [
        'name' => env('MCP_CLIENT_NAME', 'laravel-mcp-client'),
        'version' => env('MCP_CLIENT_VERSION', '1.0.0'),
        'capabilities' => [
            'sampling' => [],
            'roots' => ['listChanged' => true],
        ],
    ],

    'routes' => [
        'enabled' => env('MCP_ROUTES_ENABLED', true),
        'prefix' => env('MCP_ROUTES_PREFIX', 'mcp'),
        'middleware' => ['api'],
    ],

    'tools' => [
        'database-query' => [
            'definition' => [
                'title' => 'Database Query',
                'description' => 'Execute database queries',
                'inputSchema' => [
                    'type' => 'object',
                    'properties' => [
                        'query' => ['type' => 'string'],
                        'bindings' => ['type' => 'array'],
                    ],
                    'required' => ['query'],
                ],
            ],
            'handler' => \App\Mcp\Tools\DatabaseQueryTool::class,
        ],
    ],

    'auth' => [
        'enabled' => env('MCP_AUTH_ENABLED', false),
        'provider' => env('MCP_AUTH_PROVIDER', 'oauth'),
        'oauth' => [
            'client_id' => env('MCP_OAUTH_CLIENT_ID'),
            'client_secret' => env('MCP_OAUTH_CLIENT_SECRET'),
            'redirect_uri' => env('MCP_OAUTH_REDIRECT_URI'),
        ],
    ],
];

Read the full file on GitHub · 458 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 458 lines · 13 tokens per session scan A 1ce6269b0c31

Subscribe to this mod's changes

laravel-inertia-integration is a cursor rule published in the GitHub repository dalehurley/php-mcp-sdk (27 stars, last pushed 9mo ago), licensed MIT. It adds 13 tokens to every session and 3,095 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.