MCP.so
ログイン

PHP MCP Server

@he426100

PHP MCP Server について

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

基本情報

カテゴリ

その他

ライセンス

MIT

ランタイム

php

トランスポート

stdio

公開者

he426100

設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "php-mcp-server": {
      "command": "docker",
      "args": [
        "build",
        "-t",
        "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

FAQ from PHP MCP Server

What are the system requirements?

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

What transport types does it support?

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

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.

Is Docker supported?

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

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.

コメント

「その他」の他のコンテンツ