php-mcp-server

php-mcp-server

16

The PHP MCP Server project is a PHP framework for implementing Model Control Protocol (MCP) servers. It supports service definitions via annotations and offers tools, prompts, and resource processors. Features include compatibility with Swow and Swoole environments, multiple transport methods, and Docker support.

PHP MCP Server

This project provides a complete implementation of an MCP (Model Control Protocol) server framework built with PHP, designed to elegantly define MCP services using annotations.

Key Features

  • Annotation-based MCP service definitions
  • Supports Tool, Prompt, and Resource processors
  • Offers Stdio and Sse transport methods
  • Compatible with Swow and Swoole environments
  • Comprehensive logging system
  • Docker support

System Requirements

  • PHP >= 8.1
  • Composer
  • Swow extension > 1.5 or Swoole > 5.1
  • Docker (optional)

Quick Start

  1. Clone the project and install dependencies using Composer.
  2. Optionally install the Swow extension.
  3. Run the sample server with provided commands.

Annotations Guide

  • Tool, Prompt, and Resource annotations are used to define various MCP service processors.

Docker Support

Build and run the container using Docker commands.

CPX Usage

The project can be run directly with CPX without pre-installation.

License

MIT License

Contribution

Contributions via Issues and Pull Requests are welcome.