laravel
A Laravel package that implements the Model Context Protocol (MCP) server specification, enabling AI models to interact with your Laravel application through a standardized protocol.
claude mcp add --transport stdio chaoticingenuity-laravel-mcp-server docker run -i chaoticingenuity/laravel-mcp-server \ --env MCP_SERVER_NAME="Your MCP Server" \ --env MCP_LOG_REQUESTS="true" \ --env MCP_REQUIRE_HTTPS="true" \ --env MCP_SERVER_VERSION="1.0.0" \ --env MCP_LOG_PERFORMANCE="true"
How to use
This Laravel MCP server implements the Model Context Protocol (MCP) and exposes tools and resources via a standard JSON-RPC 2.0 interface. It supports multiple authentication methods (API keys, Basic Auth, Bearer tokens) and includes a robust permission system with field-level access control, plus per-key rate limiting and audit logging. After running the server container, clients can send JSON-RPC requests to discover, call, and manage tools and resources defined by your Laravel application. Typical use cases include prompting an AI agent to query product catalogs, status endpoints, or perform read/write operations within the app, all while respecting configured permissions and rate limits. The server auto-discovers tools and resources from your Laravel codebase and provides a consistent API surface for model-driven workflows.
How to install
Prerequisites:
- Docker installed on host
- Access to a container registry for the laravel MCP server image
- A Laravel application with the chaoticingenuity/laravel-mcp-server package installed or available via image
- Pull and run the container
$ docker pull chaoticingenuity/laravel-mcp-server $ docker run -i --env-file .env -p 8080:80 chaoticingenuity/laravel-mcp-server
- (Alternative) Build your own image from source
- Ensure PHP 8.1+ and Composer are available in the image
- Install the package: composer require chaoticingenuity/laravel-mcp-server
- Publish configuration and controllers as needed:
$ php artisan vendor:publish --tag=mcp-config $ php artisan vendor:publish --tag=mcp-controllers
- Configure environment
- Create a .env with MCP settings (see section 4 of README for examples)
- Ensure SSL/HTTPS is enabled in production (MCP_REQUIRE_HTTPS=true)
- Verify the server is running
- Access the MCP endpoint (e.g., http(s)://your-host/api/mcp) and test authentication and a sample RPC call
- Use artisan route:list and route:show to confirm MCP routes and middleware are loaded
- Optional: Run tests
- $ vendor/bin/phpunit --testsuite mcp
Note: The container image and command may vary; adapt the docker run command to your hosting environment and image naming.
Additional notes
Tips and common issues:
- Ensure environment variables for server name, version, authentication, and security are correctly set in .env or docker environment.
- If you enable per-key rate limiting, monitor bursts to avoid false positives; tune MCP_RATE_LIMIT and MCP_BURST_LIMIT accordingly.
- For advanced permission resolution, implement custom resolvers by extending the provided interfaces and registering them in your Laravel service provider.
- If you publish mcp-config or mcp-controllers, keep a versioned backup so upgrades don’t overwrite custom changes.
- Use MCP_TRACK_PERMISSIONS to log permission checks for auditing purposes.
- When using API keys, rotate keys regularly and implement scope-based permissions to minimize risk.
- Enable MCP_LOG_REQUESTS and MCP_LOG_PERFORMANCE in production to facilitate debugging and monitoring.
Related MCP Servers
drift
Codebase intelligence for AI. Detects patterns & conventions + remembers decisions across sessions. MCP server for any IDE. Offline CLI.
laravel
A Laravel package for implementing secure Model Context Protocol servers using Streamable HTTP and SSE transport, providing real-time communication and a scalable tool system for enterprise environments.
php
基于 PHP 实现的 MCP (Model Control Protocol) 服务器框架,通过注解优雅地定义 MCP 服务,支持 Tool、Prompt、Resource 三种处理器,支持Stdio、Sse 两种 transport。
mcp-profiler-bundle
The Symfony MCP Profiler Bundle mimics the WebProfiler Bundle. It bridges the gap between Profiler data and your favorite MCP-enabled AI-powered IDE.
elementor
Comprehensive Elementor MCP Server plugin.
mcp
Model Context Protocol for Hyperf