New to Claude Skills? Learn how to install them →

vercel-labs on GitHub

MCP Apps Integration

OfficialFree

Render interactive UIs with json-render in MCP environments.

Get this skill

Free · Opens the source repo

What MCP Apps Integration does

The MCP Apps integration for json-render allows developers to create and serve interactive user interfaces as MCP Apps within various environments, including Claude, ChatGPT, Cursor, and VS Code. This integration is particularly useful for those building applications that require dynamic UI rendering based on JSON specifications. By utilizing the Model Context Protocol (MCP), developers can ensure their applications are compatible with multiple AI-driven platforms, enhancing user interaction and experience.

To get started, developers can create an MCP server using the createMcpApp function from the @json-render/mcp package. This server registers a UI rendering tool and serves a self-contained HTML resource that can be displayed within an iframe. The integration supports a React-based client implementation, allowing developers to easily render and manage the UI state using hooks provided by the library. This makes it straightforward to build responsive applications that can adapt to user inputs and changes in the underlying data.

The architecture of the MCP integration is designed for flexibility and ease of use. Developers can define a catalog of components and actions, which the AI can reference to generate valid UI specifications. The integration leverages modern web technologies, including Vite for bundling, ensuring that the final product is efficient and performant. This makes it suitable for developers looking to create sophisticated applications that require real-time interaction and rendering.

Overall, this skill is ideal for developers looking to enhance their applications with interactive UIs that can be easily integrated into AI platforms. Whether you are building a chatbot interface or a complex data visualization tool, the MCP Apps integration provides the necessary tools to create engaging user experiences.

When to use it

Use this skill when developing applications that require interactive user interfaces rendered in MCP-compatible environments.

When not to use it

This skill may not be suitable for projects that do not require real-time UI rendering or are not intended for use with MCP platforms.

What you can build with it

Building a Chatbot Interface

Develop a responsive chatbot UI that renders dynamically based on user interactions and AI responses.

Creating Data Visualization Tools

Implement interactive data visualizations that adjust in real-time based on user input and data changes.

Integrating with AI Platforms

Seamlessly integrate your applications with Claude or ChatGPT to leverage AI capabilities in your UIs.

How to install MCP Apps Integration

View source

1. Install with the skills CLI

npx skills add vercel-labs/json-render/mcp --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by vercel-labs

@json-render/mcp

MCP Apps integration that serves json-render UIs as interactive MCP Apps inside Claude, ChatGPT, Cursor, VS Code, and other MCP-capable clients.

Quick Start

Server (Node.js)

import { createMcpApp } from "@json-render/mcp";
import { defineCatalog } from "@json-render/core";
import { schema } from "@json-render/react/schema";
import { shadcnComponentDefinitions } from "@json-render/shadcn/catalog";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import fs from "node:fs";

const catalog = defineCatalog(schema, {
  components: { ...shadcnComponentDefinitions },
  actions: {},
});

const server = createMcpApp({
  name: "My App",
  version: "1.0.0",
  catalog,
  html: fs.readFileSync("dist/index.html", "utf-8"),
});

await server.connect(new StdioServerTransport());

Client (React, inside iframe)

import { useJsonRenderApp } from "@json-render/mcp/app";
import { JSONUIProvider, Renderer } from "@json-render/react";

function McpAppView({ registry }) {
  const { spec, loading, error } = useJsonRenderApp();
  if (error) return <div>Error: {error.message}</div>;
  if (!spec) return <div>Waiting...</div>;
  return (
    <JSONUIProvider registry={registry} initialState={spec.state ?? {}}>
      <Renderer spec={spec} registry={registry} loading={loading} />
    </JSONUIProvider>
  );
}

Architecture

  1. createMcpApp() creates an McpServer that registers a render-ui tool and a ui:// HTML resource
  2. The tool description includes the catalog prompt so the LLM knows how to generate valid specs
  3. The HTML resource is a Vite-bundled single-file React app with json-render renderers
  4. Inside the iframe, useJsonRenderApp() connects to the host via postMessage and renders specs

Server API

  • createMcpApp(options) - main entry, creates a full MCP server
  • registerJsonRenderTool(server, options) - register a json-render tool on an existing server
  • registerJsonRenderResource(server, options) - register the UI resource

Client API (@json-render/mcp/app)

  • useJsonRenderApp(options?) - React hook, returns { spec, loading, connected, error, callServerTool }
  • buildAppHtml(options) - generate HTML from bundled JS/CSS

Building the iframe HTML

Bundle the React app into a single self-contained HTML file using Vite + vite-plugin-singlefile:

// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile";

export default defineConfig({
  plugins: [react(), viteSingleFile()],
  build: { outDir: "dist" },
});

Client Configuration

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "my-app": {
      "command": "npx",
      "args": ["tsx", "server.ts", "--stdio"]
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "my-app": {
      "command": "npx",
      "args": ["tsx", "/path/to/server.ts", "--stdio"]
    }
  }
}

Dependencies

# Server
npm install @json-render/mcp @json-render/core @modelcontextprotocol/sdk

# Client (iframe)
npm install @json-render/react @json-render/shadcn react react-dom

# Build tools
npm install -D vite @vitejs/plugin-react vite-plugin-singlefile

Frequently asked questions about MCP Apps Integration

Similar skills