From 5943cbfe68103e8ae7207b7fb477df2e52ec4ef3 Mon Sep 17 00:00:00 2001 From: Pushpak Chhajed Date: Thu, 27 Nov 2025 20:37:51 +0530 Subject: [PATCH 1/2] Add Resource Annotations section to MCP documentation --- mcp.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mcp.md b/mcp.md index e443a03082..5b4cf6595d 100644 --- a/mcp.md +++ b/mcp.md @@ -27,6 +27,7 @@ - [Resource URI and MIME Type](#resource-uri-and-mime-type) - [Resource Request](#resource-request) - [Resource Dependency Injection](#resource-dependency-injection) + - [Resource Annotations](#resource-annotations) - [Conditional Resource Registration](#conditional-resource-registration) - [Resource Responses](#resource-responses) - [Metadata](#metadata) @@ -1030,6 +1031,39 @@ class WeatherGuidelinesResource extends Resource } ``` + +### Resource Annotations + +You may enhance your resources with [annotations](https://modelcontextprotocol.io/specification/2025-06-18/schema#resourceannotations) to provide additional metadata to AI clients. Annotations are added to resources via attributes: + +```php + ### Conditional Resource Registration From 7e58e5d1ef7316f86882156479407b617641cc41 Mon Sep 17 00:00:00 2001 From: Pushpak Chhajed Date: Thu, 27 Nov 2025 20:45:16 +0530 Subject: [PATCH 2/2] Fix Audience role casing in MCP documentation for consistency --- mcp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcp.md b/mcp.md index 5b4cf6595d..df4f1bbd43 100644 --- a/mcp.md +++ b/mcp.md @@ -1047,7 +1047,7 @@ use Laravel\Mcp\Server\Annotations\LastModified; use Laravel\Mcp\Server\Annotations\Priority; use Laravel\Mcp\Server\Resource; -#[Audience(Role::USER)] +#[Audience(Role::User)] #[Priority(0.9)] #[LastModified('2025-01-12T15:00:58Z')] class UserDashboardResource extends Resource @@ -1060,7 +1060,7 @@ Available annotations include: | Annotation | Type | Description | | ---------------- | -------------- | ----------------------------------------------------------------------------------------------- | -| `#[Audience]` | Role or array | Specifies the intended audience (`Role::USER`, `Role::ASSISTANT`, or both). | +| `#[Audience]` | Role or array | Specifies the intended audience (`Role::User`, `Role::Assistant`, or both). | | `#[Priority]` | float | A numerical score between 0.0 and 1.0 indicating resource importance. | | `#[LastModified]`| string | An ISO 8601 timestamp showing when the resource was last updated. |