Skip to content

Allow custom annotation fields to pass through McpAnnotationMapper #134

@galatanovidiu

Description

@galatanovidiu

Problem

McpAnnotationMapper::map() uses a strict whitelist of known MCP annotation fields (readOnlyHint, destructiveHint, idempotentHint, openWorldHint, audience, priority, title, lastModified). Any annotation key not in this list is silently discarded during the mapping from WordPress Abilities API to MCP tools.

This prevents consumers from attaching domain-specific metadata to tool annotations.

Compliant MCP clients will ignore fields they don't recognize, so passing through additional fields is protocol-safe.

Proposed Change

After mapping known MCP annotation fields, preserve any remaining keys from the source annotations array. Unknown fields should be included as-is in the mapped output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions