Annotation Interface McpAppTool


Attaches MCP Apps metadata to an McpTool handler method.

The annotation processor requires @McpTool on the same method and generates the equivalent McpAppToolMetadata registration. Visibility and resource association do not grant authorization or prove that an invocation originated from an authorized UI. Applications must authorize every invocation.

Author:
Mark Allen
  • Element Details

    • protocolVersions

      Exact revisions on which this tool advertises its Apps association. This must be a nonempty subset of the owning tool's revisions.
      Returns:
      Apps association revisions
    • resourceUri

      Associates an exact UI resource registered in the same endpoint. The processor applies the same URI validation as programmatic Apps metadata; endpoint construction validates the resource's eligibility.
      Returns:
      concrete normalized absolute ASCII ui:// URI, or an empty string for no association
      Default:
      ""
    • visibility

      The tool's effective audiences, defaulting to both model and app. Explicitly supplying an empty array means neither audience; duplicate values are collapsed into the generated metadata's set.
      Returns:
      non-null audiences, stored in enum declaration order
      Default:
      {MODEL, APP}