MCP.so
登录

PHP MCP Server

@he426100

基本信息

分类

其他

许可证

MIT

传输方式

stdio

作者

he426100

关于 PHP MCP Server

基于 PHP 实现的 MCP (Model Control Protocol) 服务器框架,通过注解优雅地定义 MCP 服务,支持 Tool、Prompt、Resource 三种处理器,支持Stdio、Sse 两种 transport。

PHP MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "php-mcp-server": {
      "command": "docker",
      "args": [
        "build",
        "-t",
        "php-mcp-server",
        "."
      ]
    }
  }
}

PHP MCP Server 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

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

概览

What is PHP MCP Server?

PHP MCP Server is a PHP implementation of the Model Context Protocol (MCP) framework that enables developers to define MCP services using annotations. It supports Tool, Prompt, and Resource handlers and can operate over Stdio or SSE transports. It is intended for PHP developers building MCP-compatible servers for AI assistants or other contextual agents.

How to use PHP MCP Server?

Clone the repository and install dependencies via Composer. Run the test server with php bin/console mcp:test-server and optionally pass --transport (stdio or sse) and --port (default 8000 for SSE). The server can also be executed without local installation via CPX (Composer Package Executor) using cpx he426100/php-mcp-server mcp:test-server.

Key features of PHP MCP Server

  • Annotation-based definition of MCP services
  • Support for Tool, Prompt, and Resource handlers
  • Stdio and SSE transport modes
  • Compatible with Swow (>1.5) and Swoole (>5.1) environments
  • Integrated logging system
  • Docker support for containerized deployment

Use cases of PHP MCP Server

  • Build custom MCP tools that AI assistants can invoke
  • Expose reusable prompt templates via MCP Prompt handlers
  • Serve structured resources (text, binary, JSON) through MCP Resource endpoints
  • Run a lightweight MCP server in containerized or serverless environments

常见问题

1

What are the system requirements?

PHP >=8.1, Composer, and either Swow extension >1.5 or Swoole >5.1. Docker is optional.

2

What transport types does it support?

Stdio and SSE (Server-Sent Events). The default transport is stdio.

3

Can I run PHP MCP Server without installing it locally?

Yes, via CPX (Composer Package Executor). Run `cpx he426100/php-mcp-server mcp:test-server` directly.

4

Is Docker supported?

Yes. Build the image with `docker build -t php-mcp-server .` and run with the SSE transport on port 8000.

5

Where are server logs stored?

Logs are saved to `runtime/server_log.txt` by default. The path can be customised by overriding `$logFilePath` in a subclass of `AbstractMcpServerCommand`.

评论

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