Laravel MCP
by InnoGE
Laravel MCP is a package that implements the Model Context Protocol (MCP), enabling seamless communication between your Laravel application and AI assistants through a standardized API. It allows you to expose your application's data and functionality to AI models.
Last updated: N/A
What is Laravel MCP?
Laravel MCP is a Laravel package that provides a standardized way to interact with your application's data and functionality from AI assistants or other systems using the Model Context Protocol. It allows you to define resources (data models) and tools (actions) that can be accessed through a defined API.
How to use Laravel MCP?
To use Laravel MCP, install the package via composer. Then, create a command to serve the MCP server using the provided trait. Define resources by using EloquentResourceProvider or InMemoryResourceProvider to expose your data. Create tools by implementing the ToolInterface and registering them in the getTools() method. You can test the server using Modelcontext Protocol Inspector or add it to Claude Desktop.
Key features of Laravel MCP
Standardized API for AI interaction
Eloquent and InMemory resource providers
Custom tool creation
Built-in example tools
STDIO transport support
Integration with Claude Desktop
Use cases of Laravel MCP
Exposing database records to AI assistants
Integrating with third-party APIs through AI
Enabling AI to perform actions within your application
Building AI-powered workflows
Creating custom AI tools for specific application needs
FAQ from Laravel MCP
Is HTTP transport supported?
Is HTTP transport supported?
No, HTTP transport is not yet supported but will be added in the future. Currently, only STDIO transport is supported.
Is the package ready for production use?
Is the package ready for production use?
No, this package is still in development and not yet ready for production use.
How do I expose my data models?
How do I expose my data models?
You can expose your data models using EloquentResourceProvider for Eloquent models or InMemoryResourceProvider for custom data structures.
How do I create a custom tool?
How do I create a custom tool?
You can create a custom tool by implementing the ToolInterface and defining the getName(), getDescription(), getInputSchema(), and execute() methods.
How do I test my MCP server?
How do I test my MCP server?
You can test your MCP server using Modelcontext Protocol Inspector or by adding it to Claude Desktop.