From fe7460058a8f7d568c055512d55fc4703fffc9aa Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Sun, 17 May 2026 14:46:52 +0200 Subject: [PATCH] Document v0.6.0 changes in CHANGELOG and docs Wrap-up for the v0.6.0 release: capture features/BC breaks merged since v0.5.0 that were missing from documentation. - CHANGELOG: add the `title` field on `Resource`/`ResourceTemplate` (#301), a feature plus three positional-argument BC breaks. - mcp-elements.md: add the missing `title` parameter to the McpTool, McpResource, McpResourceTemplate and McpPrompt attribute reference sections; fix a missing closing paren in an `#[McpPrompt]` example. - server-builder.md: add `title?` to the `addPrompt()` row of the method reference table (stale since v0.5.0). - client.md: bump the protocol-version example to `V2025_11_25` to match the new default. Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 6 +++++- README.md | 2 ++ docs/client.md | 2 +- docs/index.md | 2 ++ docs/mcp-elements.md | 10 +++++++--- docs/server-builder.md | 6 +++--- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf056e73..8db034bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to `mcp/sdk` will be documented in this file. * Add `extensions` to `ServerCapabilities` and `ClientCapabilities` and `Builder::enableExtension()` * Allow overriding the default name pattern for Discovery * Add configurable session garbage collection (`gcProbability`/`gcDivisor`) +* Add optional `title` field to `ResourceDefinition` and `ResourceTemplate` for MCP spec compliance * Add `ChainLoader` to compose multiple `LoaderInterface` implementations via explicit ordering. * Add `RegistryInterface::unregisterTool()`, `unregisterResource()`, `unregisterResourceTemplate()`, `unregisterPrompt()` — idempotent removals. * Add `RegistryInterface::hasTool()`, `hasResource()`, `hasResourceTemplate()`, `hasPrompt()` — by-name existence checks. @@ -26,7 +27,10 @@ All notable changes to `mcp/sdk` will be documented in this file. * [BC Break] `Builder::addResource()` signature changed — `$title` parameter added between `$name` and `$description`. Callers using positional arguments must switch to named arguments. * [BC Break] `Builder::addResourceTemplate()` signature changed — `$title` parameter added between `$name` and `$description`. Callers using positional arguments must switch to named arguments. * Add `CorsMiddleware`, `DnsRebindingProtectionMiddleware`, and `ProtocolVersionMiddleware` for `StreamableHttpTransport`, composed automatically as the default stack via `StreamableHttpTransport::defaultMiddleware()` -* **[BC BREAK]** `StreamableHttpTransport` constructor: `$corsHeaders` parameter removed; CORS is now configured via `CorsMiddleware`. The `$middleware` parameter is nullable — `null` (or omitted) installs the default stack; `[]` disables all defaults. Default `Access-Control-Allow-Origin` is no longer set (was `*`). +* [BC BREAK] `StreamableHttpTransport` constructor: `$corsHeaders` parameter removed; CORS is now configured via `CorsMiddleware`. The `$middleware` parameter is nullable — `null` (or omitted) installs the default stack; `[]` disables all defaults. Default `Access-Control-Allow-Origin` is no longer set (was `*`). +* [BC Break] `ResourceDefinition::__construct()` signature changed — `$title` parameter added between `$name` and `$description`. Callers using positional arguments must switch to named arguments. +* [BC Break] `ResourceTemplate::__construct()` signature changed — `$title` parameter added between `$name` and `$description`. Callers using positional arguments must switch to named arguments. +* [BC Break] `McpResource` and `McpResourceTemplate` attribute signatures changed — `$title` parameter added between `$name` and `$description`. Callers using positional arguments must switch to named arguments. 0.5.0 ----- diff --git a/README.md b/README.md index 8b3bccfd..3f1a377e 100644 --- a/README.md +++ b/README.md @@ -273,6 +273,8 @@ $client->connect($transport); - **[Transports](docs/transports.md)** — STDIO and HTTP transport setup and usage - **[MCP Elements](docs/mcp-elements.md)** — Creating tools, resources, prompts, and templates - **[Server-Client Communication](docs/server-client-communication.md)** — Sampling, logging, progress, and notifications +- **[Protocol Extensions](docs/extensions.md)** — Opt-in protocol extensions announced during capability negotiation, including MCP Apps (HTML UI resources) +- **[Authorization](docs/authorization.md)** — OAuth and authorization setup for HTTP transport - **[Events](docs/events.md)** — Hooking into server lifecycle with events ### Learning & Examples diff --git a/docs/client.md b/docs/client.md index 304fad77..680d8234 100644 --- a/docs/client.md +++ b/docs/client.md @@ -83,7 +83,7 @@ Specify the MCP protocol version (defaults to latest): use Mcp\Schema\Enum\ProtocolVersion; $client = Client::builder() - ->setProtocolVersion(ProtocolVersion::V2025_06_18) + ->setProtocolVersion(ProtocolVersion::V2025_11_25) ->build(); ``` diff --git a/docs/index.md b/docs/index.md index 9ace7bdd..91162290 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,4 +6,6 @@ - [Transports](transports.md) — STDIO and HTTP transport implementations with guidance on choosing between them. - [Server-Client Communication](server-client-communication.md) — Methods for servers to communicate back to clients: sampling, logging, progress, and notifications. - [Protocol Extensions](extensions.md) — Opt-in protocol extensions announced during capability negotiation, including MCP Apps (HTML UI resources). +- [Authorization](authorization.md) — OAuth and authorization setup for the HTTP transport. +- [Events](events.md) — Hooking into the server lifecycle with PSR-14 events. - [Examples](examples.md) — Example projects demonstrating attribute-based discovery, dependency injection, HTTP transport, and more. diff --git a/docs/mcp-elements.md b/docs/mcp-elements.md index 2e4a1516..0f8c9eb2 100644 --- a/docs/mcp-elements.md +++ b/docs/mcp-elements.md @@ -74,6 +74,7 @@ class Calculator ### Parameters - **`name`** (optional): Tool identifier. Defaults to method name if not provided. +- **`title`** (optional): Human-readable display title shown in client UI. Distinct from `name`. - **`description`** (optional): Tool description. Defaults to docblock summary if not provided, otherwise uses method name. - **`annotations`** (optional): `ToolAnnotations` object for additional metadata. - **`icons`** (optional): Array of `Icon` objects for visual representation. @@ -219,7 +220,8 @@ class ConfigProvider ### Parameters - **`uri`** (required): Unique resource identifier. Must comply with [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). -- **`name`** (optional): Human-readable name. Defaults to method name if not provided. +- **`name`** (optional): Short resource identifier. Defaults to method name if not provided. +- **`title`** (optional): Human-readable display title shown in client UI. Distinct from `name`. - **`description`** (optional): Resource description. Defaults to docblock summary if not provided. - **`mimeType`** (optional): MIME type of the resource content. - **`size`** (optional): Size in bytes if known. @@ -367,7 +369,8 @@ class UserProvider ### Parameters - **`uriTemplate`** (required): URI template with `{variables}` using RFC 6570 syntax. Must comply with RFC 3986. -- **`name`** (optional): Human-readable name. Defaults to method name if not provided. +- **`name`** (optional): Short resource template identifier. Defaults to method name if not provided. +- **`title`** (optional): Human-readable display title shown in client UI. Distinct from `name`. - **`description`** (optional): Template description. Defaults to docblock summary if not provided. - **`mimeType`** (optional): MIME type of the resource content. - **`annotations`** (optional): Additional metadata. @@ -393,7 +396,7 @@ class PromptGenerator /** * Generates a code review request prompt. */ - #[McpPrompt(name: 'code_review'] + #[McpPrompt(name: 'code_review')] public function reviewCode(string $language, string $code, string $focus = 'general'): array { return [ @@ -407,6 +410,7 @@ class PromptGenerator ### Parameters - **`name`** (optional): Prompt identifier. Defaults to method name if not provided. +- **`title`** (optional): Human-readable display title shown in client UI. Distinct from `name`. - **`description`** (optional): Prompt description. Defaults to docblock summary if not provided. - **`icons`** (optional): Array of `Icon` objects for visual representation. - **`meta`** (optional): Arbitrary key-value pairs for custom metadata. diff --git a/docs/server-builder.md b/docs/server-builder.md index 9b7dfa8d..9836bee7 100644 --- a/docs/server-builder.md +++ b/docs/server-builder.md @@ -671,8 +671,8 @@ $server = Server::builder() | `addNotificationHandler()` | handler | Prepend a single custom notification handler | | `addNotificationHandlers()` | handlers | Prepend multiple custom notification handlers | | `addTool()` | handler, name?, title?, description?, annotations?, inputSchema?, ... | Register tool | -| `addResource()` | handler, uri, name?, description?, mimeType?, size?, annotations? | Register resource | -| `addResourceTemplate()` | handler, uriTemplate, name?, description?, mimeType?, annotations? | Register resource template | -| `addPrompt()` | handler, name?, description? | Register prompt | +| `addResource()` | handler, uri, name?, title?, description?, mimeType?, size?, annotations?, icons?, meta? | Register resource | +| `addResourceTemplate()` | handler, uriTemplate, name?, title?, description?, mimeType?, annotations?, meta? | Register resource template | +| `addPrompt()` | handler, name?, title?, description?, icons?, meta? | Register prompt | | `add()` | definition, handler | Register an element from a schema VO + handler pair | | `build()` | - | Create the server instance |