A2UICore.Catalog.MCP (A2UICore v0.1.1)

Copy Markdown View Source

The A2UI MCP catalog, ready to evaluate: the catalog through which a surface calls Model Context Protocol tools.

  • v0.9 (https://a2ui.org/specification/v0_9/catalogs/mcp/mcp_catalog.json) declares the functions callMcpTool, jmespath, split, regexCapture, regexReplace and updateDataModel, and no components.
  • v1.0 (https://a2ui.org/specification/v1_0/catalogs/mcp/catalog.json) declares callMcpTool (with targetDataPath) and the McpApp component, which renders an MCP App in a sandbox.

The catalog documents are the vendored published ones (A2UICore.Schema.Source.catalog/2); the functions get their implementations from A2UICore.Functions.MCP. A renderer serves the catalog next to the basic one: in v1.0 a call or a component names it by catalogId; in v0.9 a surface has one catalog, so the MCP functions join the basic catalog's in a catalog of the host's own (see A2UICore.Catalog.copy_with/2).

Summary

Functions

The MCP catalog for version ("v0.9", "v0.9.1" or "v1.0"), with its functions implemented.

The catalog ID of the MCP catalog for version.

The MCP catalog for version as published: function and component schemas, no implementations.

Attaches the MCP functions' implementations and the system functions of version to a catalog that declares them (the MCP catalog, or one that copies its functions). Functions the catalog does not declare are ignored.

Functions

catalog(version, options \\ [])

(since 0.1.0)
@spec catalog(String.t(), keyword()) :: A2UICore.Catalog.t()

The MCP catalog for version ("v0.9", "v0.9.1" or "v1.0"), with its functions implemented.

Options: :client — the MCP client callMcpTool uses (see A2UICore.Functions.MCP.implementations/2).

catalog_id(version)

(since 0.1.0)
@spec catalog_id(String.t()) :: String.t()

The catalog ID of the MCP catalog for version.

iex> A2UICore.Catalog.MCP.catalog_id("v1.0")
"https://a2ui.org/specification/v1_0/catalogs/mcp/catalog.json"

declared(version)

(since 0.1.0)
@spec declared(String.t()) :: A2UICore.Catalog.t()

The MCP catalog for version as published: function and component schemas, no implementations.

implement(catalog, version, options \\ [])

(since 0.1.0)
@spec implement(A2UICore.Catalog.t(), String.t(), keyword()) :: A2UICore.Catalog.t()

Attaches the MCP functions' implementations and the system functions of version to a catalog that declares them (the MCP catalog, or one that copies its functions). Functions the catalog does not declare are ignored.

Options: as for catalog/2.