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-auth-implementation)<a href="https://agentmods.dev/rules/dalehurley/php-mcp-sdk/php-auth-implementation"><img src="https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/php-auth-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-auth-implementation"><img src="https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/php-auth-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.00011 | $0.02878 |
| Opus 5.5 | $0.00004 | $0.01151 |
| Sonnet 5.5 | $0.00002 | $0.00576 |
| Haiku 4.5 | $0.00001 | $0.00288 |
Grade A, and why
php-auth-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 — 435 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PHP MCP Authentication and Authorization Guide
Authentication Architecture
MCP supports OAuth 2.0 authentication with proper token validation and client management.
AuthInfo Interface
namespace MCP\Auth;
interface AuthInfo {
public function getToken(): string;
public function getClientId(): string;
public function getScopes(): array;
public function getExpiresAt(): ?int;
public function getResource(): ?string;
public function getExtra(): array;
}
class DefaultAuthInfo implements AuthInfo {
public function __construct(
private string $token,
private string $clientId,
private array $scopes,
private ?int $expiresAt = null,
private ?string $resource = null,
private array $extra = []
) {}
// Implement interface methods...
}
OAuth Provider Interface
namespace MCP\Server\Auth;
use React\Promise\PromiseInterface;
interface OAuthProvider {
/**
* Get authorization URL
*/
public function getAuthorizationUrl(array $params): string;
/**
* Exchange authorization code for tokens
*/
public function exchangeCode(string $code, array $params): PromiseInterface;
/**
* Refresh an access token
*/
public function refreshToken(string $refreshToken): PromiseInterface;
/**
* Verify an access token
*/
public function verifyAccessToken(string $token): PromiseInterface;
/**
* Revoke a token
*/
public function revokeToken(string $token, string $tokenType): PromiseInterface;
/**
* Get client information
*/
public function getClient(string $clientId): PromiseInterface;
}
Proxy OAuth Provider
For proxying OAuth requests to an external provider:
namespace MCP\Server\Auth\Providers;
use GuzzleHttp\Client;
use React\Promise\Promise;
use React\Promise\PromiseInterface;
class ProxyOAuthProvider implements OAuthProvider {
private Client $httpClient;
private array $endpoints;
private callable $verifyAccessToken;
private callable $getClient;
public function __construct(array $config) {
$this->httpClient = new Client();
$this->endpoints = $config['endpoints'];
$this->verifyAccessToken = $config['verifyAccessToken'];
$this->getClient = $config['getClient'];
}
public function exchangeCode(string $code, array $params): PromiseInterface {
return new Promise(function ($resolve, $reject) use ($code, $params) {
try {
$response = $this->httpClient->post($this->endpoints['tokenUrl'], [
'form_params' => [
'grant_type' => 'authorization_code',
'code' => $code,
'redirect_uri' => $params['redirect_uri'],
'client_id' => $params['client_id'],
'client_secret' => $params['client_secret'] ?? null,
'code_verifier' => $params['code_verifier'] ?? null,
]
]);
$data = json_decode($response->getBody()->getContents(), true);
$resolve($data);
} catch (\Exception $e) {
$reject($e);
}
});
}
public function verifyAccessToken(string $token): PromiseInterface {
return new Promise(function ($resolve, $reject) use ($token) {
try {
$authInfo = ($this->verifyAccessToken)($token);
$resolve($authInfo);
} catch (\Exception $e) {
$reject($e);
}
});
}
}
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 · 435 lines · 11 tokens per session scan A 64333f75b97d
php-auth-implementation is a cursor rule published in the GitHub repository dalehurley/php-mcp-sdk (27 stars, last pushed 11mo ago), licensed MIT. It adds 11 tokens to every session and 2,878 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.