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

Product Decisions This Supports

  • AI/ML Integration Roadmap: Accelerate adoption of Model Context Protocol (MCP) for Laravel-based AI agents, enabling seamless interaction between AI clients (e.g., LLMs) and backend services. Aligns with broader trends in agentic architectures and AI-native applications.
  • Build vs. Buy: Buy—avoids reinventing MCP server logic (auth, JSON-RPC, OAuth, structured responses) while leveraging Laravel’s ecosystem. Reduces dev time by 60–80% for compliant endpoints.
  • Use Cases:
    • AI Copilots: Expose Laravel business logic (e.g., CRM, inventory) as tools for AI agents (e.g., "Book a flight using our system").
    • Autonomous Agents: Enable AI systems to query/update Laravel data via standardized MCP interfaces (e.g., GET /resources/users/{id}).
    • OAuth/Tool Integration: Simplify registration of Laravel apps as MCP tools (e.g., for platforms like Model Context Protocol’s ecosystem).
    • Hybrid AI Workflows: Combine AI-generated requests with Laravel’s validation/authorization (e.g., assertStructuredContent() for schema enforcement).
  • Competitive Differentiation: Differentiate products by offering AI-first APIs (e.g., "Our platform is natively compatible with AI agents via MCP").
  • Tech Debt Reduction: Replace ad-hoc JSON-RPC/OAuth implementations with a maintained, Laravel-idiomatic solution.

When to Consider This Package

Adopt if:

  • Your Laravel app needs to expose functionality to AI clients (e.g., agents, copilots) via MCP (not REST/gRPC).
  • You require OAuth 2.1 tool registration for AI platforms (e.g., registering your Laravel app as a "tool" in an AI orchestration system).
  • You need structured responses (e.g., JSON Schema validation, structuredContent assertions) for AI tool outputs.
  • Your team lacks expertise in JSON-RPC 2.0, MCP spec compliance, or OAuth 2.1 but wants to avoid custom implementations.
  • You’re building agentic workflows where AI systems dynamically invoke Laravel endpoints (e.g., "Find me users matching X criteria").
  • You need local development support for MCP (e.g., mcp:inspect command, localhost OAuth redirects).

Look elsewhere if:

  • You’re not using Laravel (package is framework-specific).
  • Your use case requires non-MCP protocols (e.g., OpenAI API, LangChain, or custom gRPC).
  • You need real-time streaming beyond Laravel’s Octane support (MCP v0.5.6+ has fixes but may not match WebSocket/gRPC performance).
  • Your AI integration is simple (e.g., static API keys) and doesn’t need OAuth/tool registration.
  • You’re constrained by PHP 8.1 or lower (dropped in v0.5.4).
  • You require enterprise-grade SLAs (package is MIT-licensed; no SLA guarantees).

How to Pitch It (Stakeholders)

For Executives:

*"Laravel MCP lets us turn our Laravel backend into AI-compatible tools—enabling our systems to work natively with AI agents, copilots, and orchestration platforms like Model Context Protocol. This is a strategic move to:

  • Future-proof our APIs for AI-driven workflows (e.g., autonomous agents querying our CRM).
  • Reduce dev time by 70% compared to custom MCP/JSON-RPC implementations.
  • Differentiate our product with AI-first integrations (e.g., ‘Our platform is built for AI agents’).
  • Leverage OAuth 2.1 to securely register our app as a ‘tool’ in AI ecosystems.

Risk: Minimal—MIT-licensed, maintained by Laravel, and battle-tested in early adopter projects. ROI: Enables new revenue streams (e.g., AI partnerships) and operational efficiency (e.g., automated data workflows)."*


For Engineering:

*"Laravel MCP is a drop-in solution to expose Laravel as an MCP-compliant server, giving AI clients (e.g., LLMs, agents) a standardized way to interact with our app. Here’s why it’s a no-brainer:

  • No reinventing the wheel: Handles JSON-RPC 2.0, OAuth 2.1 tool registration, and MCP spec compliance out of the box.
  • Laravel-native: Integrates with routes, middleware, and validation (e.g., assertStructuredContent() for schema enforcement).
  • Developer experience:
    • Artisan commands: mcp:install, mcp:inspect for local debugging.
    • Annotations: Decorate resources with @McpResource for metadata (e.g., icons, roles).
    • Testing: Built-in URI template resolution for resource testing.
  • Performance: Optimized for Laravel 10/11, with fixes for Octane streaming (v0.5.6+).
  • Extensibility: Add custom content types (e.g., images/audio via Storage) or client transports (e.g., stdio for CLI tools).

Migration path:

  1. Install via Composer: composer require laravel/mcp.
  2. Run php artisan mcp:install to scaffold OAuth/tool endpoints.
  3. Annotate resources (e.g., #[McpResource(name: 'users')]) and define schemas.
  4. Test with php artisan mcp:inspect or AI clients.

Alternatives considered:

  • Custom JSON-RPC: Too much maintenance (OAuth, spec updates).
  • REST APIs: Not MCP-compliant for AI tool use cases.
  • Other PHP packages: None match Laravel’s ecosystem or MCP’s maturity.

Next steps:

  • Evaluate with a proof-of-concept (e.g., expose a users resource to an AI agent).
  • Align with the AI/ML team on tool registration in their orchestration platform.
  • Plan for monitoring (e.g., track MCP request volumes, errors)."*
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