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 Support

Forum topic · 小凯 · 2026-02-13

Summary

Stratagem.php is an open-source project implemented entirely in pure PHP (8.0+) that provides an AI Agent skill library, an MCP (Model Context Protocol) server, and an A2A (Agent-to-Agent) protocol implementation. It packages practical capabilities into self-contained units called 'Stratagems' (jinnang), which function both as executable tools and as readable documentation for AI agents, improving accuracy and efficiency on specific tasks. The architecture is described as a three-layer cake: a core stratagem layer of self-contained PHP files, a protocol layer implementing full MCP and A2A stacks, and an application collaboration layer exemplified by the Yongle Academy system for project management and content generation workflows. MCP support covers Stdio, SSE, and HTTP transports, while A2A enables dynamic inter-agent collaboration. Key features include zero external dependencies, dual-mode operation, metadata search, self-documenting comments, and enterprise-grade security with path traversal protection, operation whitelisting, and rate limiting.

Stratagem.php Project Overview

Stratagem.php is a pure-PHP implementation of an AI Agent skill library, an MCP server, and the A2A protocol. It wraps practical skills into independent units called "Stratagems" (锦囊, jinnang). Each stratagem serves as both an executable tool and agent-readable documentation, aiming to improve AI accuracy and efficiency when performing specific tasks.

Core Value Proposition

  • Skills are packaged as self-contained, reusable "Stratagems"
  • Each stratagem doubles as executable code and documentation that agents can read
  • Goal: improve AI task execution accuracy and efficiency
  • Technical Architecture

    The design philosophy is "simple yet powerful," visualized as a three-layer cake:

  • Stratagem Core Layer: All foundational functional modules; each stratagem is a self-contained PHP file
  • Protocol Support Layer: Complete MCP and A2A protocol stacks
  • Application Collaboration Layer: Represented 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
  • Full MCP support: Stdio, SSE, and HTTP transport modes for the smart stratagem system
  • Dual-mode operation, metadata search, and self-documenting comments
  • Enterprise-grade security: Path traversal protection, operation whitelisting, and rate limiting
--- *Source: Stratagem.php project documentation*

Tags

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

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