Verified Agent Skill record
Php MCP Server Generator
Use this Skill as a template-driven guide for generating a PHP 8.2-or-later MCP server project with stdio startup, attribute-based tools, optional resources and prompts, discovery caching, documentation, and PHPUnit tests. Keep claims bounded to the templates and patterns shown in SKILL.md.
Tasks
- Scaffold a PHP MCP server project with composer.json, .gitignore, README.md, server.php, PSR-4 source directories, PHPUnit configuration, and tool tests.
- Implement requested tools as strict-typed PHP classes using #[McpTool] and, where applicable, #[Schema] parameter validation.
- Add requested static or templated resources using #[McpResource] or #[McpResourceTemplate].
- Add requested prompts using #[McpPrompt] and the demonstrated inline #[CompletionProvider] value lists.
- Configure source discovery in server.php with the demonstrated PSR-16 filesystem cache and StdioTransport.
- Write PHPUnit tests for generated tools, including normal results and documented exception cases.
Inputs
- Project name
- Server description
- Requested transport type: stdio, http, or both
- Tools to include
- Whether to include resources and prompts
- PHP version, with 8.2 or later required
Outputs
- composer.json with PHP, mcp/sdk, PHPUnit, Symfony Cache, and PSR-4 declarations
- .gitignore
- README.md with requirements, installation, stdio usage, testing, Inspector usage, and Claude Desktop configuration
- server.php using discovery, a PSR-16 filesystem cache, and StdioTransport
- Tool classes under src/Tools
- Optional resource classes under src/Resources
- Optional prompt classes under src/Prompts
- PHPUnit tool tests under tests
Limitations and checks
- Although the source asks users to choose stdio, http, or both, it only demonstrates StdioTransport; it provides no HTTP transport class, configuration, or implementation pattern.
- The source shows a src/Providers directory in the proposed structure but provides no provider-class template or standalone provider implementation pattern.
- The source demonstrates inline CompletionProvider attributes in a prompt class but does not demonstrate a separate completion-provider class.
- The source declares mcp/sdk ^0.1 and uses Mcp\Server, Mcp\Capability\Attribute classes, and Mcp\Server\Transport\StdioTransport, but it does not independently verify that the package or those APIs exist or are compatible.
- The source provides templates and examples rather than evidence that a generated project has been executed successfully.
- Confirm server.php constructs FilesystemAdapter with the mcp-discovery namespace, a 3600-second lifetime, and the project cache directory, wraps it in Psr16Cache, and passes that cache to setDiscovery.
- Confirm discovery scans src and excludes vendor, tests, and cache as shown in the server template.
- Confirm the generated server uses StdioTransport; do not describe HTTP transport as implemented unless separate evidence is supplied.
AI Search
Find projects, verify facts, compare options, or turn a complex need into an actionable plan
ProjectsSkillsFactsCompareRankingsSolutions
Try a searchA click only fills the search box; you stay in control
今日榜单
0