MCP.so
登录

PHP MCP Server for Laravel

@php-mcp

关于 PHP MCP Server for Laravel

An SDK building Laravel MCP servers

基本信息

分类

其他

许可证

MIT

运行时

php

传输方式

stdio

发布者

php-mcp

配置

暂无标准配置

该服务器的 README 中没有可解析的 MCP 配置块,请前往代码仓库查看安装说明。

代码仓库

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is PHP MCP Server for Laravel?

It is a comprehensive Laravel SDK for building Model Context Protocol (MCP) servers with enterprise-grade features and Laravel-native integrations. It lets you expose your Laravel application’s functionality as standardized MCP Tools, Resources, Prompts, and Resource Templates for AI assistants like Claude, Cursor IDE, and ChatGPT.

How to use PHP MCP Server for Laravel?

Install via Composer (composer require php-mcp/laravel:^3.0 -W), publish the configuration (php artisan vendor:publish --provider="PhpMcp\Laravel\McpServiceProvider" --tag="mcp-config"), then define MCP elements in routes/mcp.php using the Mcp facade or via PHP 8 attributes. Run the server with php artisan mcp:serve --transport=stdio, or use the integrated HTTP or dedicated HTTP transports. All settings are managed through config/mcp.php.

Key features of PHP MCP Server for Laravel

  • Laravel-native integration with service container, caching, logging, and Artisan
  • Fluent element definition using the Mcp facade
  • Attribute-based discovery with automatic caching (e.g., #[McpTool])
  • Advanced session management with multiple storage backends
  • Flexible transport options: STDIO, integrated HTTP, dedicated HTTP server
  • Artisan commands for serving, discovery, and element management

Use cases of PHP MCP Server for Laravel

  • Expose Laravel business logic (e.g., user creation, email sending) as MCP tools for AI assistants
  • Provide dynamic resources and resource templates (e.g., user profiles, file contents) via URI patterns
  • Integrate with Cursor IDE or command-line tools using STDIO transport
  • Build enterprise-grade MCP servers with session persistence and caching

FAQ from PHP MCP Server for Laravel

What are the system requirements?

PHP >= 8.1 and Laravel >= 10.0 are required. Extensions json, mbstring, and pcre must be enabled.

Which transport options are available?

Three transports: STDIO (for direct client execution), Integrated HTTP (served through Laravel routes), and Dedicated HTTP Server (high-performance standalone ReactPHP server).

How do I define MCP elements?

You can use manual registration in routes/mcp.php with the Mcp facade, or use PHP 8 attributes (#[McpTool], #[McpResource], etc.) on classes/methods with automatic discovery.

Does it support caching?

Yes. Discovered elements are cached for performance; caches are automatically invalidated on fresh discovery runs. You can force re-discovery with php artisan mcp:discover --force.

Can I use it with Cursor IDE?

Yes. Cursor IDE can be configured to use STDIO transport with a command pointing to php artisan mcp:serve --transport=stdio.

评论

其他 分类下的更多 MCP 服务器