English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Stratagem.php: A Pure-PHP AI Agent Skill Library with MCP and A2A Protocol Support

Forum topic · 小凯 · 2026-02-13

Summary

Stratagem.php is an open-source project implementing an AI Agent skill library, MCP server, and A2A protocol entirely in pure PHP with no external dependencies. The project packages practical capabilities as self-contained units called 'Stratagems' (锦囊), which function both as executable tools and as readable documentation for AI agents, improving accuracy and efficiency on specific tasks. Its architecture is described as a three-layer cake: a stratagem core layer of self-contained PHP files, a protocol support layer with a complete MCP and A2A protocol stack, and an application collaboration layer exemplified by the Yongle Academy system for project management and content generation workflows. Built on PHP 8.0+, it supports MCP over Stdio, SSE, and HTTP transports, offers dual-mode operation, metadata search, and self-documenting annotations, and includes enterprise-grade security features such as path traversal protection, operation whitelisting, and rate limiting.

Stratagem.php: Project Overview

*(Translated from the original Chinese forum post on zhichai.net.)*

Core Value Proposition

Stratagem.php is a pure-PHP implementation of an AI Agent skill library, MCP server, and A2A protocol. It packages practical capabilities into independent "Stratagems" (锦囊) — units that serve both as executable tools and as agent-readable documentation, aiming to improve AI accuracy and efficiency when performing specific tasks.

Technical Architecture

The architecture follows a "simple yet powerful" design philosophy, visualized as a carefully designed three-layer cake:

  • Stratagem Core Layer: Contains all foundational functional modules; every stratagem is a self-contained PHP file.
  • Protocol Support Layer: Implements the complete MCP and A2A protocol stacks.
  • Application Collaboration Layer: Exemplified by the Yongle Academy (永乐书院) system, providing project management and content generation workflows.
  • Protocol Support

    | Protocol | Description | Purpose | |----------|-------------|---------| | MCP | Model Context Protocol | Connecting agents with tool resources | | A2A | Agent-to-Agent Protocol | Dynamic collaboration and communication between agents |

    Key Features

  • Pure PHP implementation: Based on PHP 8.0+, zero external dependencies
  • Complete MCP support: Supports Stdio, SSE, and HTTP transport modes
  • Intelligent stratagem system: Dual-mode operation, metadata search, self-documenting annotations
  • Enterprise-grade security: Path traversal protection, operation whitelisting, rate limiting
--- *Source: Stratagem.php project documentation*

Tags

#php#ai-agents#mcp#a2a-protocol#skill-library#open-source#llm-tools

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/176922720