php-mcp-sdk-main

php-mcp-sdk-main is a cursor rule for Cursor from dalehurley/php-mcp-sdk. It costs 1,150 tokens per session, scanned A, original, MIT.

Architecture guidance for the PHP implementation of the Model Context Protocol, a standard for connecting AI applications with tools and data. It explains how the PHP SDK mirrors the TypeScript SDK while using PHP conventions.

In plain words
What is it for?
Use it when organizing or implementing features in the PHP MCP SDK, including typed PHP code, asynchronous operations, PSR standards, and server transports.
Why use it?
It helps developers understand the SDK’s server, client, transport, type, and project-structure choices before extending it.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/dalehurley/php-mcp-sdk/php-mcp-sdk-main
Clone the repo
git clone --depth 1 https://github.com/dalehurley/php-mcp-sdk

Made for: Cursor.

Wrote 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.

agentmods badge for php-mcp-sdk-main

README.md
[![agentmods](https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/php-mcp-sdk-main.svg)](https://agentmods.dev/rules/dalehurley/php-mcp-sdk/php-mcp-sdk-main)
Your own site
<a href="https://agentmods.dev/rules/dalehurley/php-mcp-sdk/php-mcp-sdk-main"><img src="https://agentmods.dev/badge/rules/dalehurley/php-mcp-sdk/php-mcp-sdk-main.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,150 This file is loaded in full into every session.
When invoked 1,150 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.01150 $0.01150
Opus 5 $0.00575 $0.00575
Sonnet 5 $0.00230 $0.00230
Haiku 4.5 $0.00115 $0.00115

Measured 4d ago against content hash 61869c9c5360, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

php-mcp-sdk-main 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 4d 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.

.cursor/rules/php-mcp-sdk-main.mdc · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PHP MCP SDK Architecture Guide

This is the PHP implementation of the Model Context Protocol (MCP) SDK, following the patterns established by the TypeScript SDK.

Core Architecture Principles

  1. Follow TypeScript SDK Patterns: The PHP SDK should mirror the TypeScript SDK's architecture while using PHP idioms
  2. Type Safety: Use PHP 8+ type declarations, union types, and attributes extensively
  3. Async Support: Utilize ReactPHP or similar for async operations where the TypeScript SDK uses Promises
  4. PSR Standards: Follow PSR-4 for autoloading, PSR-12 for coding standards, PSR-7 for HTTP messages

Project Structure

php-mcp-sdk/
├── src/
│   ├── Server/                  # Server implementations
│   │   ├── McpServer.php       # High-level server API
│   │   ├── Server.php          # Low-level server implementation
│   │   ├── Auth/               # Authentication providers
│   │   │   ├── Provider.php
│   │   │   └── Providers/
│   │   └── Transport/          # Server transport implementations
│   │       ├── StdioServerTransport.php
│   │       ├── StreamableHttpServerTransport.php
│   │       └── SseServerTransport.php (deprecated)
│   ├── Client/                  # Client implementations
│   │   ├── Client.php          # MCP client
│   │   └── Transport/          # Client transport implementations
│   │       ├── StdioClientTransport.php
│   │       ├── StreamableHttpClientTransport.php
│   │       └── SseClientTransport.php (deprecated)
│   ├── Shared/                  # Shared components
│   │   ├── Protocol.php        # Protocol base class
│   │   ├── Transport.php       # Transport interface
│   │   ├── UriTemplate.php     # URI template handling
│   │   └── AuthUtils.php       # Authentication utilities
│   ├── Types/                   # Type definitions
│   │   ├── Types.php           # Core type definitions
│   │   ├── Schemas.php         # Validation schemas
│   │   └── Exceptions.php      # MCP exceptions
│   └── Utils/                   # Utility classes
│       ├── JsonSchema.php      # JSON Schema validation
│       └── Completable.php     # Completion support
├── tests/                       # Test files mirroring src structure
├── examples/                    # Example implementations
│   ├── server/
│   └── client/
├── composer.json
└── README.md

Read the full file on GitHub · 149 lines

Changes

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.

  1. 4d ago First seen · 149 lines · 1,150 tokens per session scan A 61869c9c5360

Subscribe to this mod's changes

php-mcp-sdk-main is a cursor rule published in the GitHub repository dalehurley/php-mcp-sdk (27 stars, last pushed 9mo ago), licensed MIT. It adds 1,150 tokens to every session, about $0.0057 per session on Opus 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.