Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e04b4bb
fix: carry _meta through resource contents and embedded resources
galatanovidiu Jul 27, 2026
e63e4ce
fix: normalize _meta on component descriptors and content blocks
galatanovidiu Jul 27, 2026
bda6726
Potential fix for pull request finding
galatanovidiu Jul 28, 2026
07db0c6
fix: validate tool result annotations before emitting them
galatanovidiu Jul 28, 2026
32021f8
fix: normalize annotation and size values before building DTOs
galatanovidiu Jul 28, 2026
d7fb9cc
fix: normalize prompt message content blocks before building DTOs
galatanovidiu Jul 28, 2026
9ab7c24
fix: assign flat-form `_meta` to the embedded resource contents
galatanovidiu Jul 28, 2026
49e5ae5
fix: degrade prompt message content the schema refuses
galatanovidiu Jul 28, 2026
c2231e4
test: cover the scalar fallback for a content block with no type
galatanovidiu Jul 28, 2026
45947ee
docs: state which annotation vocabulary a tool result takes
galatanovidiu Jul 28, 2026
63b4270
fix: carry annotations and `_meta` on an image tool result
galatanovidiu Jul 28, 2026
074a999
docs: state when a prompt builder's `_meta` is emitted
galatanovidiu Jul 28, 2026
38d26c0
fix: recognize blob-only items as resource contents
galatanovidiu Jul 28, 2026
6ae4562
fix: log a `_meta` the handlers cannot emit
galatanovidiu Jul 28, 2026
e97daad
docs: state the trust contract for resource metadata
galatanovidiu Jul 28, 2026
c2070a0
docs: describe the content block metadata arguments
galatanovidiu Jul 28, 2026
961f470
test: follow the data provider naming convention
galatanovidiu Jul 28, 2026
c7f9ba6
fix: emit a mimeType as declared
galatanovidiu Jul 28, 2026
0cb81ec
docs: state where annotations go per component type
galatanovidiu Jul 28, 2026
cdc61a5
docs: separate embedded resources from the MCP Apps route
galatanovidiu Jul 28, 2026
c438ba8
fix: warn when an image result omits its bytes
galatanovidiu Jul 28, 2026
0f3efd7
docs: add examples for MCP App tools, binary resources and prompt blocks
galatanovidiu Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Documentation for the WordPress MCP Adapter - transform WordPress abilities into

- **[Default Server](guides/default-server.md)** - Understanding the built-in MCP server and core abilities
- **[Creating Abilities](guides/creating-abilities.md)** - Build tools, resources, and prompts with annotations
- **[Tools with a UI (MCP Apps)](guides/creating-abilities.md#building-a-tool-with-a-ui-mcp-apps)** - Render an interactive interface from a tool
- **[Transport Permissions](guides/transport-permissions.md)** - Custom authentication and access control
- **[Custom Transports](guides/custom-transports.md)** - Specialized communication protocols
- **[Error Handling](guides/error-handling.md)** - Custom error logging and monitoring
Expand Down
60 changes: 29 additions & 31 deletions docs/getting-started/basic-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ add_action( 'wp_abilities_api_init', function() {
'meta' => [
'public' => true, // Expose to clients, including MCP
'annotations' => [
'priority' => 2.0,
'readOnlyHint' => false,
'destructiveHint' => false
'readonly' => false, // Abilities API name; emitted as readOnlyHint
'destructive' => false // Abilities API name; emitted as destructiveHint
]
]
]);
Expand All @@ -124,7 +123,7 @@ echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"my-plugin-

## Example 2: Resource - Site Configuration

Resources provide access to data. They require a `uri` in the ability meta:
Resources provide access to data. They require a `uri` under `meta.mcp`:

```php
<?php
Expand All @@ -149,15 +148,13 @@ add_action( 'wp_abilities_api_init', function() {
},
'meta' => [
'public' => true, // Expose to clients, including MCP
'uri' => 'wordpress://site/config', // Required for resources
'annotations' => [
'readOnlyHint' => true,
'idempotentHint' => true,
'audience' => ['user', 'assistant'],
'priority' => 0.8
],
'mcp' => [
'type' => 'resource' // Mark as resource for auto-discovery
'type' => 'resource', // Mark as resource for auto-discovery
'uri' => 'wordpress://site/config', // Required for resources
'annotations' => [
'audience' => ['user', 'assistant'],
'priority' => 0.8
]
]
]
]);
Expand Down Expand Up @@ -213,24 +210,20 @@ add_action( 'wp_abilities_api_init', function() {
},
'meta' => [
'public' => true, // Expose to clients, including MCP
'arguments' => [
[
'name' => 'code',
'description' => 'Code to review',
'required' => true
],
[
'name' => 'focus',
'description' => 'Areas to focus on during review',
'required' => false
]
],
'annotations' => [
'readOnlyHint' => true,
'idempotentHint' => true
],
'mcp' => [
'type' => 'prompt' // Mark as prompt for auto-discovery
'type' => 'prompt', // Mark as prompt for auto-discovery
'arguments' => [
[
'name' => 'code',
'description' => 'Code to review',
'required' => true
],
[
'name' => 'focus',
'description' => 'Areas to focus on during review',
'required' => false
]
]
]
]
]);
Expand Down Expand Up @@ -259,11 +252,16 @@ The MCP Adapter automatically creates a default server that exposes all register

### Component Types
- **Tools**: Execute actions (like `tools/call`)
- **Resources**: Provide data access (like `resources/read`) - require `meta.uri`
- **Resources**: Provide data access (like `resources/read`) - require `meta.mcp.uri`
- **Prompts**: Generate messages (like `prompts/get`) - return `messages` array

### Annotations
All MCP components may include metadata in `meta.annotations`, which hint at how clients should treat them.
Annotations hint at how clients should treat a component, and each type reads them from a different place:

- **Tools**: `meta.annotations` — write the Abilities API names `readonly`, `destructive`, `idempotent`, which the adapter maps to `readOnlyHint`, `destructiveHint`, `idempotentHint`. `openWorldHint` and `title` have no Abilities API equivalent, so write those under their MCP names.
- **Resources**: `meta.mcp.annotations` — `audience`, `priority`, `lastModified`
- **Prompts**: no descriptor annotations; annotate the message content blocks instead

For full details on annotations, their semantics, and usage guidelines, see the Annotations section of the MCP schema spec: https://modelcontextprotocol.io/specification/2025-06-18/schema#annotations

### Testing
Expand Down
Loading
Loading