Download the PHP package vielhuber/simplemcp without Composer
On this page you can find all versions of the php package vielhuber/simplemcp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vielhuber/simplemcp
More information about vielhuber/simplemcp
Files in vielhuber/simplemcp
Package simplemcp
Short Description Simple php mcp server with auto-discovery and totp auth.
License MIT
Informations about the package simplemcp
🐘 simplemcp 🐘
simplemcp is a simple php mcp server. it auto-discovers tool classes via reflection, loads them from a directory you point it at, and authenticates requests via a static bearer token or rotating totp codes (rfc 6238).
installation
configuration
authentication
static mode
totp mode
MCP_TOKEN is a base32-encoded shared secret (rfc 6238). the bearer is a fresh 6-digit totp code (30-second window, ±1 step tolerance). the server implements the algorithm natively, no extra library needed. on the client (python/fastmcp):
usage
configure the constructor at the bottom of mcp-server.php:
adding tools
note: simplemcp uses the same
#[McpTool]and#[Schema]attribute syntax asphp-mcp/server. existing tool classes can be migrated by replacinguse PhpMcp\Server\Attributes\McpTool;withuse vielhuber\simplemcp\Attributes\McpTool;(and the same forSchema).note: throw
\RuntimeException(or any\Throwable) to signal errors. simplemcp catches these automatically and returns them as a structured mcp error response withisError: trueand the exception message astext. this is the recommended pattern for invalid input or missing resources — do not returnnullorfalse. generated object schemas reject unknown tool arguments by default. setadditionalProperties: trueexplicitly on a method-level#[Schema]only for backwards compatibility when unknown fields may be ignored.
mcp server
http mode (recommended for remote servers)
stdio mode (local, via php cli, no auth needed)