Repository navigation
v0.9.5
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 onerender-uitool for your catalog and your view as itsui://resource. Connect it toStdioServerTransportfor a local host.handleRenderUiRequest(options, request)serves it over Streamable HTTP with webRequestandResponse: stateless, one server per request, with CORS for MCP Inspector.- The tool's input schema is built from the catalog:
state,on,watch,visibleandrepeatare declared, each component's props are typed (dynamic values allowed, unknown props rejected) and each action's params are checked. Upstream'screateMcpAppusescatalog.zodSchema(), which stripsstate,onandwatchbefore the tool runs. - The description,
renderUiDescription(catalog), stays under the roughly 2 000 characters Claude shows the model, and explainssendMessageonly when your catalog defines it. - A spec with a missing child or root, or a
$templatethat reads a repeat item as${$item/field}, goes back to the model as a tool error it can fix. A valid one comes back asstructuredContentwith an output schema, as ChatGPT asks. - Options for
csp, the ChatGPTwidgetDomain, and the tool's name, title and description.specInputSchema,specProblemsandspecOutputSchemaare 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