Overview
In June 2026, the official Laravel blog announced that AI agents built with the Laravel AI SDK can now connect to MCP (Model Context Protocol) servers. Until now, Laravel MCP provided the ability to expose your Laravel app as an MCP server. This release adds the opposite direction: your Laravel app can act as an MCP client and connect to other MCP servers.For the details of how MCP itself works, see the Laravel MCP documentation. This page focuses on the client feature.
Why this landed in Laravel MCP rather than in the AI SDK itself
MCP is a wide-ranging protocol that covers transport negotiation, handshakes, and authentication flows. Implementing it directly inside the AI SDK would prevent reuse in scenarios where you want to talk to an MCP server without an agent — queue jobs or console commands, for example. The Laravel team therefore split the feature in two.laravel/mcp: the MCP client itself, responsible for connection, negotiation, authentication, and tool invocation.laravel/ai: a thin integration layer that lets agents use that client fromtools()without friction.
Connecting to an MCP server
Both STDIO servers (started as a local process) and remote servers over HTTP are supported.tools().
Authentication
Bearer token
OAuth
Many hosted MCP servers, such as Nightwatch, require OAuth. Register a named client in a service provider.mcp.oauth.nightwatch.connect and the matching callback route. On the Blade side, all you need is a connect button.
Plugging it into an agent
The key point is that you can drop MCP tools into an agent’stools() method without changing anything else.
tools() array and wraps them so they match the agent’s tool contract. It converts MCP input schemas into Laravel’s JSON schema, performs remote invocation when the model calls a tool, and normalizes the results on the way back. Errors, structured data, plain text, and streaming updates are all handled automatically, so no MCP details leak into your agent code.
You can even mix multiple transports inside a single agent.
Caching the tool list
Fetching the tool list involves a round trip to the server. For remote servers behind OAuth in particular, it’s wasteful to make that call on every prompt. Because the tool list doesn’t change often, it’s a good caching target.Testing
Even without a running MCP server, you can test agents with Laravel AI’s fake helpers. MCP tool names follow anmcp_tools_<name> convention, so a tool called search appears as mcp_tools_search.
What’s supported today
This initial release supports tools and prompts over both the STDIO and Streamable HTTP transports. Authentication supports bearer tokens and OAuth. Coverage is expected to grow alongside MCP itself.Related pages
Building a custom AI SDK provider
How to implement a custom provider for AI services not supported out of the box.
Getting started with Laravel Nightwatch
A walkthrough of Nightwatch, the hosted monitoring service used as an example in this article.