server

server

3.7

If you are the rightful owner of server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

PHP MCP Server provides a robust and flexible server-side implementation of the Model Context Protocol (MCP) for PHP applications.

PHP MCP Server is a comprehensive package designed to facilitate the implementation of the Model Context Protocol (MCP) in PHP applications. It allows developers to expose parts of their applications as standardized MCP Tools, Resources, and Prompts, enabling AI assistants to interact with the PHP backend using the MCP standard. The package supports attribute-based definitions, manual registration, and explicit discovery of MCP elements, making it versatile and easy to integrate. It also offers flexible transport options, including stdio and http+sse, and is compliant with PSR standards for logging, container, and caching. The server architecture is decoupled, ensuring that core logic is separated from network communication, and it supports the 2024-11-05 version of the Model Context Protocol.

Features

  • Attribute-Based Definition: Define MCP elements using PHP 8 Attributes on methods or invokable classes.
  • Manual Registration: Programmatically register elements using a fluent builder API.
  • Explicit Discovery: Trigger attribute scanning on demand via the $server->discover() method.
  • Metadata Inference: Generate MCP schemas and descriptions from PHP type hints and DocBlocks.
  • Flexible Transports: Supports stdio and http+sse, separating core logic from network communication.