mcp  by laravel

AI server SDK for Laravel applications

Created 5 months ago
539 stars

Top 59.0% on SourcePulse

GitHubView on GitHub
Project Summary

This package provides a server SDK for integrating AI models with Laravel applications, enabling AI agents to interact with your application's logic and data. It's designed for developers looking to build AI-powered features within their existing Laravel projects.

How It Works

Laravel MCP allows developers to define "Servers" that act as endpoints for AI interactions. These servers expose "Tools" (PHP methods) and "Resources" (data providers) that AI models can call. Tools can accept structured inputs via a schema and return results, including streaming responses. Annotations can be used to provide metadata about tools to the AI client.

Quick Start & Requirements

  • Install via Composer: composer require laravel/mcp
  • Publish routes: php artisan vendor:publish --tag=ai-routes
  • Create servers and tools using Artisan commands: php artisan make:mcp-server, php artisan make:mcp-tool
  • Register servers in routes/ai.php.
  • Test with php artisan mcp:inspector <server_name>.

Highlighted Details

  • Define tool inputs using a schema for structured data exchange.
  • Annotate tools with attributes like #[Title], #[IsReadOnly], #[IsDestructive], #[IsIdempotent], and #[IsOpenWorld] for AI hints.
  • Support for streaming tool responses via generators for real-time feedback.
  • Resources and Prompts can be exposed for AI context and reusable LLM interactions.
  • Web-based servers can be secured using Laravel Passport for OAuth2 authentication.

Maintenance & Community

  • The project is open-source and welcomes contributions.
  • Contribution guide and Code of Conduct are available.
  • Security vulnerabilities can be reported following the project's security policy.

Licensing & Compatibility

  • Licensed under the MIT license.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

The package is explicitly stated to be in development and not recommended for public usage, intended primarily to power Boost. Security notes mention potential DNS rebinding attacks when exposing local development servers via HTTP.

Health Check
Last Commit

6 days ago

Responsiveness

Inactive

Pull Requests (30d)
14
Issues (30d)
13
Star History
58 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.