mcp — скилл для Claude Code: MCP Apps и установка
Скилл помогает собирать MCP-серверы с интерактивными json-render UI для Claude, ChatGPT, Cursor и VS Code.
npx skills add vercel-labs/json-render --skill mcp -a claude-codeЧто делает mcp
Скилл описывает интеграцию @json-render/mcp с Model Context Protocol. Сервер через createMcpApp() регистрирует инструмент render-ui и HTML-ресурс ui://, а описание инструмента передаёт модели каталог допустимых UI-спеков.
Клиент работает как React-приложение внутри iframe. Хук useJsonRenderApp() получает спецификацию через postMessage, после чего Renderer выводит интерфейс через JSONUIProvider. HTML собирается в один файл с помощью Vite и vite-plugin-singlefile.
Для сервера нужны @json-render/mcp, @json-render/core и @modelcontextprotocol/sdk; для iframe — @json-render/react, @json-render/shadcn, react и react-dom. Сборка требует vite, @vitejs/plugin-react и vite-plugin-singlefile, поэтому без Node.js-проекта с React этот сценарий не запустить.
Какие задачи решает
- создать MCP-сервер с интерактивным UI
- передать модели каталог допустимых UI-спеков
- отрендерить MCP App внутри iframe
- собрать React-интерфейс в один HTML-файл
Примеры запросов агенту
- Собери MCP-сервер на Node.js с `createMcpApp()` и инструментом `render-ui` для json-render.
- Добавь React-клиент внутри iframe через `useJsonRenderApp()` и покажи состояние загрузки и ошибки.
- Настрой сборку `dist/index.html` через Vite и `vite-plugin-singlefile` для MCP App.
Как установить mcp
1Через Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill mcp -a claude-code2Вручную: положить файлы
~/.claude/skills/mcp/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/mcp/
1Через Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill mcp -a codex2Вручную: положить файлы
.agents/skills/mcp/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill mcp -a cursor2Вручную: положить файлы
.cursor/skills/mcp/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install vercel-labs/json-render mcp2Вручную: положить файлы
.github/skills/mcp/SKILL.md1Через Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill mcp -a gemini-cli2Командой платформы
gemini skills install https://github.com/vercel-labs/json-render --path skills/mcpВручную: положить файлы
.devin/skills/mcp/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill mcp -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Из того же набора20
Весь набор →Похожие
Вопросы о mcp
Как установить mcp в Claude Code?
Выполните npx skills add vercel-labs/json-render --skill mcp -a claude-code, затем повторите npx skills add vercel-labs/json-render --skill mcp -a claude-code. Файл скилла находится в ~/.claude/skills/mcp/SKILL.md.
Что делает mcp?
Скилл помогает подключить json-render к MCP: сервер регистрирует render-ui, отдаёт UI-ресурс, а React-клиент внутри iframe отображает полученную спецификацию.
Что нужно для сборки MCP App?
Нужны React-клиент и Vite-сборка с vite-plugin-singlefile. Для серверной части используются @json-render/mcp, @json-render/core и @modelcontextprotocol/sdk.
Исходный текст
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