Skip to content
LaravelBlog

laravel/mcp patch: mcp:inspector now launches with a modern era config

LaravelBlogBot
LaravelBlogBot

Contributed by pushpak1300

Part of the mcp v1.0.1 release

This week's laravel/mcp patch ships a small but important bug fix for the mcp:inspector Artisan command. Instead of passing ad-hoc --transport and --server-url flags to the MCP Inspector, the command now generates a temporary Inspector config file with "protocolEra": "modern" and launches the Inspector with --config. If you were on v0.9.6 and found that every Inspector session opened by php artisan mcp:inspector was rejected before it could connect, this is the fix.

What changed in the launch flow

Previously, the command built one of two hard-coded flag arrays depending on whether it detected a local server. For stdio it ran npx @modelcontextprotocol/inspector --transport stdio <php> <artisan> mcp:start <handle>, and for a running HTTP server it ran --transport http --server-url <url>. Neither path had any way to influence the Inspector's protocol era, which defaults to legacy.

Now both branches build a $serverConfig array instead — type, command, and args for stdio, or type and url for HTTP. The command merges in 'protocolEra' => 'modern', writes the whole thing to a temporary file created with tempnam(sys_get_temp_dir(), 'mcp-inspector-'), and launches the Inspector with --config <path>. The guidance output also gained two new lines: the protocol era and the generated config path. If the temp file cannot be created, the command fails gracefully with an error instead of launching a doomed session.

Why it matters

The MCP Inspector's protocolEra can only be set through a config file — not through the ad-hoc --transport / --server-url flags the command was passing. Since the Laravel MCP server only speaks the modern era, every session opened by mcp:inspector started with a legacy initialize request and was rejected at the handshake. The Inspector UI launched and looked functional, but the connection could never be established.

With a modern-era config in place, the Inspector sends modern per-request _meta out of the box, so the handshake succeeds and you can actually exercise your tools, resources, and prompts from the Inspector UI.

What the generated config looks like

For a server registered as weather, inspected over stdio, the command writes something like this to your system temp directory:

{
    "mcpServers": {
        "weather": {
            "type": "stdio",
            "command": "/usr/local/bin/php",
            "args": ["/var/www/weather-app/artisan", "mcp:start", "weather"],
            "protocolEra": "modern"
        }
    }
}

and then launches:

npx @modelcontextprotocol/inspector --config /tmp/mcp-inspector-xK9f2a

The same shape is used for HTTP servers, with the entry becoming { "type": "http", "url": "...", "protocolEra": "modern" }.

Upgrade impact

There is nothing to do beyond pulling in the new version:

composer update laravel/mcp

No server code, configuration, or environment changes are required, and the fix applies to both stdio and HTTP inspection modes. The NODE_TLS_REJECT_UNAUTHORIZED handling for local HTTPS endpoints is unchanged. If you worked around the broken handshake on v0.9.6 — for example by maintaining your own Inspector config file or launching npx @modelcontextprotocol/inspector manually — you can now delete that workaround and go back to running php artisan mcp:inspector directly.

Testing by hand

Because the command now prints the era and the generated config path, and the temp file is left in place, you can reuse it for manual experiments:

npx @modelcontextprotocol/inspector --config /tmp/mcp-inspector-xK9f2a

If you prefer to launch the Inspector yourself against a running server, mirror the same structure in your own config: an mcpServers entry with "type": "http", your server URL, and — critically — "protocolEra": "modern". That last key is the one that makes the connection work.

Takeaways

  • mcp:inspector now writes a temporary Inspector config containing "protocolEra": "modern" and launches the Inspector via --config instead of transport flags.
  • This fixes Inspector sessions that were previously rejected at the legacy initialize handshake; connections now use modern per-request _meta.
  • Both stdio and HTTP modes are covered, with no changes to TLS handling or your application code.
  • Upgrading is a simple composer update laravel/mcp from v0.9.6 — no breaking changes.
  • The command prints the config path, which you can reuse (or copy the protocolEra key from) when running the Inspector by hand.

Sources

More from this release

Related Articles