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 (Model Context Protocol) servers in Laravel so AI clients can securely interact with your app. Expose tools, resources, and prompts using familiar Laravel patterns, with docs and integrations designed for rapid setup and deployment.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • AI/ML Integration Roadmap: Accelerate adoption of Model Context Protocol (MCP) for seamless AI-agent interactions with Laravel applications, reducing custom integration effort by 60%+.
  • Build vs. Buy: Buy—avoids reinventing OAuth/OIDC, JSON-RPC, and structured content handling for AI tooling. Leverages Laravel’s ecosystem (e.g., Octane for streaming, Storage for media).
  • Use Cases:
    • Enterprise AI Agents: Expose internal tools (e.g., CRM, ERP) as MCP-compliant APIs for LLMs (e.g., Anthropic, Mistral).
    • Developer Tools: Ship Laravel-based AI plugins (e.g., GitHub Copilot integrations) with pre-built MCP endpoints.
    • Multi-Modal Apps: Handle image/audio content (v0.6.0+) via Laravel Storage adapters (S3, local, etc.).
    • Compliance: Standardized OAuth security (v0.3.1+) and structured schemas (v0.4.0+) for auditable AI interactions.
  • Monetization:
    • SaaS: Offer MCP-enabled APIs as premium features (e.g., "AI Toolkit" add-on).
    • Marketplace: Package MCP tools as Laravel packages (e.g., laravel/mcp-tools-crm).
  • Tech Debt Reduction:
    • Replace ad-hoc JSON-RPC/OAuth implementations with maintained, Laravel-native solutions.
    • Annotation-driven tool registration (v0.4.0+) reduces boilerplate for new endpoints.

When to Consider This Package

Adopt If:

  • Your Laravel app needs to interact with AI agents (e.g., Anthropic, Mistral, custom LLMs) via MCP.
  • You’re building AI tooling and want to avoid reinventing:
    • OAuth/OIDC registration (v0.3.1+).
    • JSON-RPC/structured content handling (v0.4.0+).
    • Session management (v0.5.7+).
  • You need multi-modal support (images/audio via Laravel Storage, v0.6.0+).
  • Your team uses Laravel and wants zero-config integration with existing auth (Sanctum/Passport) and validation.
  • You’re targeting 2025+ AI standards (supports protocolVersion: "2025-11-25").

Look Elsewhere If:

  • You’re not using Laravel: MCP is Laravel-specific (uses Eloquent, Facades, etc.).
  • You need non-MCP AI integrations: Consider:
    • LangChain (for general LLM orchestration).
    • OpenAPI/Swagger (for REST-based AI tools).
    • Custom gRPC (for high-performance tooling).
  • Your use case requires real-time WebSocket streaming: MCP supports streaming (v0.5.6+), but for WebSocket-heavy apps, evaluate Laravel Echo or Pusher.
  • You need pre-2024 MCP versions: This package targets future-proof standards (v0.4.0+).
  • Your security team mandates custom OAuth: MCP uses Laravel’s Passport/Sanctum; bypass if you need bespoke auth.

How to Pitch It (Stakeholders)

For Executives:

"Laravel MCP lets us ship AI integrations 10x faster—without hiring specialized API experts.

  • Turn internal tools into AI plugins (e.g., expose our CRM as a ‘search database’ tool for LLMs).
  • Future-proof with Model Context Protocol, the emerging standard for AI-agent interactions (backed by Anthropic, Mistral).
  • Zero dev overhead: Uses Laravel’s existing auth (Sanctum/Passport) and validation. Example: Add an AI tool in 5 minutes with annotations.
  • Monetization: Package MCP tools as premium features (e.g., ‘AI Toolkit’) or sell them as standalone Laravel packages.
  • Risk mitigation: MIT-licensed, maintained by Laravel core team, with OAuth security and structured schema validation built-in."

Ask: "Should we prioritize this for [Q3 roadmap] to enable our AI/agent strategy?"


For Engineering:

"Laravel MCP is the fastest way to expose Laravel apps to AI agents—here’s how to use it:

  1. Installation:
    composer require laravel/mcp
    php artisan mcp:install
    
  2. Expose a Tool (e.g., a database query):
    use Laravel\MCP\Attributes\Tool;
    
    #[Tool(name: 'search_database', description: 'Query the company database')]
    public function search(SearchRequest $request) {
        return Database::search($request->query);
    }
    
  3. Handle Media (v0.6.0+):
    use Laravel\MCP\Attributes\ContentType;
    
    #[ContentType('image/png')]
    public function generateReportImage() {
        return Storage::disk('s3')->get('reports/image.png');
    }
    
  4. Security: Uses Laravel’s Passport/Sanctum for OAuth—no custom auth code.
  5. Testing: Built-in MCPInspector for local debugging.

Why this beats custom code:

  • No JSON-RPC boilerplate: Handles serialization, errors, and streaming.
  • Schema validation: Auto-generates OpenAPI-like schemas for tools.
  • Octane support: Streams responses efficiently (v0.5.6+).
  • Backward-compatible: Works with Laravel 10+ (tested up to v13).

Next Steps:

  • Spike: Build a prototype tool (e.g., ‘fetch_user_orders’) in 1 hour.
  • Architecture: Decide if we’ll use MCP for [internal agents/third-party LLMs].
  • Security Review: Focus on OAuth scopes and tool permissions.

Blockers to Address:

  • Does our AI partner (e.g., Anthropic) support MCP?
  • Will existing APIs need wrappers, or can we expose them directly?"
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4