Download the PHP package dtyq/php-mcp without Composer
On this page you can find all versions of the php package dtyq/php-mcp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package php-mcp
Short Description PHP implementation of MCP server and client
License MIT
Informations about the package php-mcp
PHP MCP
A complete PHP implementation of the Model Context Protocol (MCP), providing both server and client functionality with support for multiple transport protocols.
Language: 简体中文
✨ Key Features
- 🚀 Latest MCP Protocol - Supports MCP 2025-03-26 specification
- 🔧 Complete Implementation - Tools, resources, and prompts support
- 🔌 Multiple Transports - STDIO ✅, HTTP ✅, Streamable HTTP 🚧
- 🌐 Framework Compatible - Works with any PSR-compliant framework, built-in Hyperf integration
- 📚 Well Documented - Comprehensive guides in English and Chinese
🚀 Quick Start
Installation
Hyperf Framework Quick Integration
If you're using Hyperf framework, integration is extremely simple:
Annotation-Based Registration:
Advanced Options:
- 🔐 AuthenticatorInterface - Custom authentication
- 📊 HttpTransportAuthenticatedEvent - Dynamic tool/resource registration
- 📝 Annotation System - Auto-register tools, resources and prompts
👉 View Complete Hyperf Integration Guide
Basic Server Example
Basic Client Example
📖 Documentation
- 📚 Complete Documentation - All guides and references
- 📖 Project Overview - Architecture, features, and use cases
- 🚀 Quick Start Guide - 5-minute tutorial
- 🔧 Server Guides - Build MCP servers
- 📡 Client Guides - Create MCP clients
Working Examples
Check the /examples
directory:
stdio-server-test.php
- Complete STDIO serverhttp-server-test.php
- HTTP server with toolsstdio-client-test.php
- STDIO client examplehttp-client-test.php
- HTTP client example
🌟 Transport Protocols
Protocol | Status | Description |
---|---|---|
STDIO | ✅ | Process communication |
HTTP | ✅ | JSON-RPC over HTTP |
Streamable HTTP | 🚧 | HTTP + Server-Sent Events |
🛠️ Requirements
- PHP: 7.4+ (8.0+ recommended)
- Extensions: json, mbstring, openssl, pcntl, curl
- Composer: For dependency management
🤝 Contributing
We welcome contributions! Please see our issues page for areas where you can help.
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
- Model Context Protocol for the specification
- Anthropic for creating MCP
- The PHP community for excellent tooling and support
⭐ Star this repository if you find it useful!
All versions of php-mcp with dependencies
ext-json Version *
ext-openssl Version *
ext-pcntl Version *
ext-curl Version *
psr/log Version ^1.0|^2.0|^3.0
psr/simple-cache Version ^1.0|^2.0|^3.0
psr/event-dispatcher Version ^1.0
psr/container Version ^1.0|^2.0
adbario/php-dot-notation Version ^3.3|^2.4
guzzlehttp/guzzle Version ^6.0|^7.0
opis/closure Version ^3.0|^4.0