server  by php-mcp

PHP MCP server for AI assistant integration

Created 6 months ago
758 stars

Top 45.9% on SourcePulse

GitHubView on GitHub
Project Summary

This library provides a robust PHP implementation for the Model Context Protocol (MCP) server, enabling PHP applications to expose functionality to AI assistants. It targets developers building AI-integrated applications who need to connect PHP backends with AI models like Claude or ChatGPT.

How It Works

The server leverages PHP 8.1+ features, PSR standards, and an event-driven architecture powered by ReactPHP. It supports multiple transport protocols (stdio, http+sse, streamable http) and uses PHP 8 Attributes for zero-configuration registration of MCP elements like Tools, Resources, and Prompts. Automatic JSON schema generation from method signatures enhances validation and client interaction.

Quick Start & Requirements

  • Install: composer require php-mcp/server
  • Requirements: PHP >= 8.1, Composer. Extensions: json, mbstring, pcre.
  • Transport: HTTP transport requires an event-driven PHP environment (CLI recommended).
  • Docs: https://github.com/php-mcp/server

Highlighted Details

  • Attribute-based definition of MCP elements (Tools, Resources, Prompts).
  • Multiple transport options: stdio, http+sse, and streamable HTTP with resumability.
  • Automatic JSON schema generation for parameter validation.
  • Event-driven architecture using ReactPHP for high concurrency.
  • Comprehensive testing and PSR-11 container support for dependency injection.

Maintenance & Community

The project appears actively maintained, with a clear structure for contributions. Links to examples and testing commands are provided.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Permissive license allows for commercial use and integration with closed-source applications.

Limitations & Caveats

The HttpServerTransport is deprecated in favor of StreamableHttpServerTransport. While the README provides extensive examples, setting up complex HTTP transports or custom dependency injection might require a deeper understanding of ReactPHP and PSR-11 containers.

Health Check
Last Commit

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
1
Star History
32 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Travis Fischer Travis Fischer(Founder of Agentic), and
1 more.

fastmcp by punkpeye

0.5%
3k
TypeScript framework for building MCP servers handling client sessions
Created 10 months ago
Updated 1 week ago
Starred by Assaf Elovic Assaf Elovic(Cofounder of Tavily), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
3 more.

airweave by airweave-ai

1.4%
4k
Semantic MCP server for AI agents
Created 10 months ago
Updated 13 hours ago
Feedback? Help us improve.