Skip to content

v0.9.5

Choose a tag to compare

@github-actions github-actions released this 10 Oct 19:05
· 69 commits to main since this release

Serve your own json-render catalog as an MCP App, with the new ngx-json-render/mcp/server entry point.

An MCP App is a tool whose result Claude, ChatGPT, VS Code or Cursor renders inline in the chat. ngx-json-render/mcp already gave the Angular view; this release adds the server half, which until now lived only in the repository's example. It needs no Angular, so it runs in plain Node or on an edge function.

What's new

  • createRenderUiServer({ catalog, html, name, version }) returns an MCP server with one render-ui tool for your catalog and your view as its ui:// resource. Connect it to StdioServerTransport for a local host.
  • handleRenderUiRequest(options, request) serves it over Streamable HTTP with web Request and Response: stateless, one server per request, with CORS for MCP Inspector.
  • The tool's input schema is built from the catalog: state, on, watch, visible and repeat are declared, each component's props are typed (dynamic values allowed, unknown props rejected) and each action's params are checked. Upstream's createMcpApp uses catalog.zodSchema(), which strips state, on and watch before the tool runs.
  • The description, renderUiDescription(catalog), stays under the roughly 2 000 characters Claude shows the model, and explains sendMessage only when your catalog defines it.
  • A spec with a missing child or root, or a $template that reads a repeat item as ${$item/field}, goes back to the model as a tool error it can fix. A valid one comes back as structuredContent with an output schema, as ChatGPT asks.
  • Options for csp, the ChatGPT widgetDomain, and the tool's name, title and description. specInputSchema, specProblems and specOutputSchema are exported for servers of your own.

The README section The server has the setup. The hosted example at https://ngx-json-render.vercel.app/mcp now runs on this entry point; its tool definition is unchanged.

Upgrading

npm i ngx-json-render@0.9.5, plus the optional peers @modelcontextprotocol/ext-apps and @modelcontextprotocol/sdk if you use the server. Nothing changes for existing code. The Material catalog's ^0.8.0 || ^0.9.0 peer covers this release, so no catalog update is needed.

Full Changelog: v0.9.4...v0.9.5