Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

mcp — Claude Code skill: MCP Apps and installation

This skill helps build MCP servers that render interactive json-render UIs in Claude, ChatGPT, Cursor, and VS Code.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add vercel-labs/json-render --skill mcp -a claude-code
Open on GitHub

What mcp does

The skill covers @json-render/mcp with the Model Context Protocol. createMcpApp() creates the server, registers a render-ui tool, and exposes a ui:// HTML resource. The tool description carries the catalog prompt so the model can produce valid UI specs.

The client is a React app running inside an iframe. useJsonRenderApp() receives the spec through postMessage, while JSONUIProvider and Renderer turn it into the interface. Vite and vite-plugin-singlefile bundle the client into one HTML file.

The server uses @json-render/mcp, @json-render/core, and @modelcontextprotocol/sdk. The iframe needs @json-render/react, @json-render/shadcn, react, and react-dom; the build uses vite, @vitejs/plugin-react, and vite-plugin-singlefile. This requires a Node.js React project.

What it helps with

  • build an MCP server with an interactive UI
  • give the model a catalog of valid UI specs
  • render an MCP App inside an iframe
  • bundle a React client into one HTML file

Example prompts for the agent

  • Build a Node.js MCP server with `createMcpApp()` and a `render-ui` tool for json-render.
  • Add a React iframe client with `useJsonRenderApp()` and handle its loading and error states.
  • Bundle `dist/index.html` with Vite and `vite-plugin-singlefile` for the MCP App.

How to install mcp

1Skills CLI (Vercel)

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

2Manually: put the files in place

~/.claude/skills/mcp/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/mcp/

From the same set20

The whole set →
react vercel-labs This skill turns json-render JSON specs into React component trees. Use it when building JSON-driven UIs or defining a component catalog for generated specs. Claude Code CX Codex Cursor +1 16,300installs core vercel-labs Defines the schema and component catalog for json-render and builds the system prompt that makes an AI emit JSON UI specs. Claude Code CX Codex Cursor +1 15,000installs codegen vercel-labs Utilities for generating code from json-render UI trees. Build custom code exporters for Next.js, Remix, and other frameworks, traverse specs, and serialize props. Claude Code CX Codex Cursor +1 8,900installs next vercel-labs Converts JSON specs into Next.js apps with routes, layouts, SSR, and metadata. Handy when building AI-generated multi-page apps with @json-render/next. Claude Code CX Codex Cursor +1 8,600installs devtools vercel-labs Debug panel for json-render apps: component tree, state editor, actions log, streaming patches, and element picker. Claude Code CX Codex Cursor +1 8,300installs directives vercel-labs Pre-built directives for json-render: formatting, math, string handling, i18n. Wire them into your catalog and renderer with one import. Claude Code CX Codex Cursor +1 8,000installs react-native vercel-labs This skill turns JSON specs into native React Native mobile UIs. Use it when screens need state bindings, conditional visibility, and actions. Claude Code CX Codex Cursor +1 3,200installs remotion-best-practices vercel-labs This skill gives coding agents Remotion guidance for React projects, from animation and audio to compositions and video parameters. Use it while building or editing Remotion code. Claude Code CX Codex Cursor +1 1,500installs

Similar

theme-factory nexu-io A skill with 10 preset themes for styling artifacts: slides, docs, reports, HTML landing pages. Use it when you need a professional look without manual design work. Claude Code CX Codex Cursor +1 2,800installs web-artifacts-builder nexu-io Builds HTML artifacts for claude.ai with React and Tailwind — Anthropic's reference workflow for embeddable interfaces. Claude Code CX Codex Cursor +1 2,800installs answer-me-with-html QingYunA This skill turns selected answers into one-page HTML explainers. Use it to show a flow, compare options, or lay out findings from an investigation. Claude Code CX Codex Cursor +1 5,200installs antislop miqdadbadjuber A rule-based filter for generic AI output in interfaces and code. Use it when an agent needs explicit checks for UI, copy, accessibility, or mobile layout. Claude Code CX Codex Cursor +1 7,300installs material-ui-styling mui Helps the agent pick the right Material UI styling layer: sx, styled(), theme components, or global CSS. Use it when edits pile up and you need to avoid extra wrapper nesting. Claude Code CX Codex Cursor +1 685installs reverse-skill-router zhaoxuya520 Routes reverse engineering, security analysis, CTF, and defensive testing tasks through the reverse-skill repository. Claude Code CX Codex Cursor +1 1,500installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. Claude Code 1,052,851installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. Claude Code 711,230installs

Questions about mcp

How do I install mcp in Claude Code?

Run npx skills add vercel-labs/json-render --skill mcp -a claude-code, then run npx skills add vercel-labs/json-render --skill mcp -a claude-code again. The skill file is at ~/.claude/skills/mcp/SKILL.md.

What does mcp do?

It connects json-render to MCP: the server registers render-ui, serves a UI resource, and the React iframe client renders the returned specification.

What is required to build an MCP App?

You need a React iframe client and a Vite build using vite-plugin-singlefile. The server uses @json-render/mcp, @json-render/core, and @modelcontextprotocol/sdk.

Source text

SKILL.md · Apache-2.0
---
name: mcp
description: MCP Apps integration for json-render. Use when building MCP servers that render interactive UIs in Claude, ChatGPT, Cursor, or VS Code, or when integrating json-render with the Model Context Protocol.
---

# @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)

```typescript
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)

```tsx
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`:

```typescript
// 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`)

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

### Claude Desktop

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

## Dependencies

```bash
# 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
```

© vercel-labs · Apache-2.0 · vercel-labs/json-render

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor