PHPackages                             monkeyscloud/monkeyslegion-mcp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. monkeyscloud/monkeyslegion-mcp

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

monkeyscloud/monkeyslegion-mcp
==============================

Production-grade MCP (Model Context Protocol) server and client for PHP 8.4 with attribute-based tool registration, stdio + Streamable HTTP transports, and JSON-RPC 2.0 engine.

1.0.0(2w ago)040↑425%MITPHPPHP ^8.4

Since May 23Pushed 2w agoCompare

[ Source](https://github.com/MonkeysCloud/MonkeysLegion-MCP)[ Packagist](https://packagist.org/packages/monkeyscloud/monkeyslegion-mcp)[ RSS](/packages/monkeyscloud-monkeyslegion-mcp/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

MonkeysLegion MCP
=================

[](#monkeyslegion-mcp)

[![PHP 8.4+](https://camo.githubusercontent.com/3a1b280ab7672f9ae08c93a083aa42ce8d0c82ff079314d77f5fea924e84927c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342532422d3838393242462e737667)](https://php.net)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

Production-grade **Model Context Protocol** (MCP) server and client for PHP 8.4+.
MonkeysLegion ships native MCP support — the first PHP framework to do so.

Features
--------

[](#features)

- **JSON-RPC 2.0 engine** with full batch support
- **Three MCP primitives**: Tools, Resources, and Prompts
- **Attribute-based discovery**: `#[McpTool]`, `#[McpResource]`, `#[McpPrompt]`, `#[McpParam]`
- **Two transports**: Stdio (local AI tools) and Streamable HTTP (remote)
- **PSR-15 Middleware**: Drop-in HTTP integration for any PSR-15 framework
- **DI Provider**: Bootstrap the full MCP stack from MLC configuration
- **MCP Client**: HTTP and Stdio clients for connecting to external MCP servers
- **Schema generation** from PHP method signatures via reflection
- **Schema validation** for tool arguments (types, enums, ranges)
- **Protocol negotiation**: `2024-11-05` and `2025-03-26`
- **Session management** via `MCP-Session-Id` header
- **PSR-3/PSR-7/PSR-15** integration

Installation
------------

[](#installation)

```
composer require monkeyscloud/monkeyslegion-mcp
```

### Requirements

[](#requirements)

- PHP 8.4+
- `psr/log ^3.0`
- `psr/http-message ^2.0`
- `psr/http-server-handler ^1.0`
- `psr/http-server-middleware ^1.0`
- `ext-curl` (for HTTP client transport, optional)

Quick Start
-----------

[](#quick-start)

### 1. Create an MCP Server

[](#1-create-an-mcp-server)

```
