Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mcp Laravel Package

laravel/mcp

Build MCP servers in Laravel so AI clients can securely interact with your app via the Model Context Protocol. Quick setup, Laravel-native conventions, and official Laravel documentation support for exposing tools, resources, and prompts to MCP-compatible clients.

View on GitHub
Deep Wiki
Context7

Rapidly build MCP servers for your Laravel applications.

Frequently asked questions about Mcp
How do I install Laravel MCP in my Laravel 11+ project?
Run `composer require laravel/mcp` in your project directory. Ensure you’re using PHP 8.2+ and Laravel 10+. The package integrates via service provider and requires no manual configuration for basic setup—just define tools in your routes.
Can I use Laravel MCP with existing REST APIs without rewriting everything?
Yes, but with effort. MCP encourages a tool-first approach, so you’ll need to wrap existing routes in tool definitions with JSON Schema validation. Start by exposing high-value endpoints as tools and gradually migrate others.
What’s the difference between MCP tools and traditional Laravel routes?
MCP tools are structured, schema-validated endpoints designed for AI clients, while traditional routes are generic HTTP handlers. Tools include metadata (description, parameters), enforce JSON Schema, and support rich responses like images or audio—unlike REST’s uniform interface.
Does Laravel MCP support OAuth2 for AI client authentication?
Yes, MCP integrates with Laravel’s OAuth2/Passport or third-party providers (Auth0, Keycloak). Configure the issuer URL and redirect URIs in your MCP server setup to authenticate AI clients via MCP’s OAuth2 flow.
How do I validate tool inputs using JSON Schema in MCP?
Define schemas in your tool definitions using Laravel’s `JsonSchema` contracts. For example, specify `parameters: ['type' => 'object', 'properties' => [...]]` in your tool’s metadata. Invalid requests trigger automatic 422 errors with schema details.
Will Laravel MCP work with Laravel Octane for async/streaming responses?
Yes, MCP supports Octane for async tool execution and streaming responses (e.g., real-time data). Use `MCP::tool()->stream()` to return generators or async responses. Traditional requests fall back to synchronous handling.
Are there performance considerations for high-traffic MCP tools?
Optimize by caching tool schemas, using Octane for async tools, and batching database queries. Monitor tool execution time—MCP adds validation overhead. For critical paths, consider pre-validating inputs or using Laravel’s queue system.
How do I test MCP tools in my Laravel app?
Use Laravel’s testing tools with MCP-specific assertions like `assertToolResponse()` or `assertStructuredContent()`. Test OAuth flows with `McpTesting::actingAsClient()`, and validate schemas with `JsonSchema::validate()`. Mock AI clients to simulate requests.
Can I expose sensitive data (e.g., user PII) via MCP tools?
No, MCP enforces data protection guidelines. Avoid exposing PII directly; use tool parameters to reference IDs (e.g., `userId`) and fetch data internally. Implement rate-limiting and audit logs for sensitive tools.
What alternatives exist if Laravel MCP doesn’t fit my needs?
For REST APIs, use Laravel’s built-in routing. For gRPC, integrate `grpc/grpc` or `rector/rector`. If you need lightweight AI tooling, consider custom middleware or packages like `spatie/laravel-ai-tools`. MCP is ideal for AI-native Laravel apps.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai