Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/dalehurley/php-mcp-sdkWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/dalehurley/php-mcp-sdk/php-transport-implementation)<a href="https://agentmods.dev/rules/dalehurley/php-mcp-sdk/php-transport-implementation"><img src="https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/php-transport-implementation/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/dalehurley/php-mcp-sdk/php-transport-implementation"><img src="https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/php-transport-implementation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00010 | $0.02882 |
| Opus 5.5 | $0.00004 | $0.01153 |
| Sonnet 5.5 | $0.00002 | $0.00576 |
| Haiku 4.5 | $0.00001 | $0.00288 |
Grade A, and why
php-transport-implementation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 447 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PHP MCP Transport Implementation Guide
Transport Interface
All transports must implement the base Transport interface:
namespace MCP\Shared;
use React\Promise\PromiseInterface;
interface Transport {
/**
* Start the transport connection
*/
public function start(): PromiseInterface;
/**
* Send a message through the transport
*/
public function send(array $message): PromiseInterface;
/**
* Close the transport connection
*/
public function close(): PromiseInterface;
/**
* Set handler for incoming messages
*/
public function setMessageHandler(callable $handler): void;
/**
* Set handler for transport closure
*/
public function setCloseHandler(callable $handler): void;
/**
* Set handler for transport errors
*/
public function setErrorHandler(callable $handler): void;
}
STDIO Transport
Server STDIO Transport
namespace MCP\Server\Transport;
use MCP\Shared\Transport;
use React\EventLoop\LoopInterface;
use React\Stream\ReadableResourceStream;
use React\Stream\WritableResourceStream;
use React\Promise\Promise;
use React\Promise\PromiseInterface;
class StdioServerTransport implements Transport {
private ReadableResourceStream $stdin;
private WritableResourceStream $stdout;
private LoopInterface $loop;
private ?callable $messageHandler = null;
private string $buffer = '';
public function __construct(?LoopInterface $loop = null) {
$this->loop = $loop ?? Loop::get();
}
public function start(): PromiseInterface {
return new Promise(function ($resolve) {
// Set up streams
$this->stdin = new ReadableResourceStream(STDIN, $this->loop);
$this->stdout = new WritableResourceStream(STDOUT, $this->loop);
// Handle incoming data
$this->stdin->on('data', [$this, 'handleData']);
$this->stdin->on('close', [$this, 'handleClose']);
$this->stdin->on('error', [$this, 'handleError']);
$resolve();
});
}
private function handleData(string $chunk): void {
$this->buffer .= $chunk;
// Parse messages from buffer
while (($pos = strpos($this->buffer, "\n")) !== false) {
$line = substr($this->buffer, 0, $pos);
$this->buffer = substr($this->buffer, $pos + 1);
if (trim($line) === '') {
continue;
}
try {
$message = json_decode($line, true, 512, JSON_THROW_ON_ERROR);
if ($this->messageHandler) {
($this->messageHandler)($message);
}
} catch (\JsonException $e) {
$this->handleError(new \RuntimeException("Invalid JSON: " . $e->getMessage()));
}
}
}
public function send(array $message): PromiseInterface {
return new Promise(function ($resolve, $reject) use ($message) {
try {
$json = json_encode($message, JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES);
$this->stdout->write($json . "\n");
$resolve();
} catch (\JsonException $e) {
$reject(new \RuntimeException("Failed to encode message: " . $e->getMessage()));
}
});
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 447 lines · 10 tokens per session scan A b7a6a044cdfe
php-transport-implementation is a cursor rule published in the GitHub repository dalehurley/php-mcp-sdk (27 stars, last pushed 10mo ago), licensed MIT. It adds 10 tokens to every session and 2,882 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
atelier
Atelier UI/UX and Backend Architecture Quality Gate.
typescript-coding-rule
It allows a subset of JSDoc tags. Most tags must occupy their own line, with the tag at the beginning of the line.
typescript-standards
// Good: Typed error handling function loadConfig(): Config { try { // ... loading logic } catch (error) { if (error instanceof yaml.YAMLException) { throw new Error(Invalid YAML in configuration file: ${error.message}); } throw error; } }.
python-code-validator
Validate generated Python at every step, not once at the end.
114-java-secure-coding
Java Secure coding guidelines.
project
Project rules for a CloudBase AI Toolkit codebase, including its folders, naming practices, commits, and slash commands.