A standalone, independently deployable Model Context Protocol server that exposes OpenGenerativeUI's design system, skills, and document renderer to any MCP-compatible client.
- Design System Tool —
assemble_documentwraps HTML fragments with OpenGenerativeUI's complete CSS design system and bridge JavaScript - Skill Resources — Browse and read skill instruction documents via
skills://listandskills://{name} - Prompt Templates — Pre-composed prompts for common visualization tasks:
create_widget,create_svg_diagram,create_visualization - Standalone — No dependencies on other packages; can be deployed independently
- Configurable — Environment variables for port, CORS origins, skills directory, and logging
- Node.js >= 18
- pnpm or npm
# Navigate to the MCP package
cd apps/mcp
# Install dependencies
pnpm install
# Start the development server
pnpm dev
# → MCP server running on http://localhost:3100/mcp
# Health check
curl http://localhost:3100/health
# → {"status":"ok"}pnpm build
pnpm startCreate a .env file in the package root (copy from .env.example):
# Server port (default: 3100)
MCP_PORT=3100
# CORS origins, comma-separated (default: * for development)
ALLOWED_ORIGINS=*
# Skills directory path (default: ./skills)
SKILLS_DIR=./skills
# Log level (default: info)
LOG_LEVEL=infoClaude Desktop uses stdio transport. Build first, then add to your claude_desktop_config.json:
pnpm build{
"mcpServers": {
"open-generative-ui": {
"command": "node",
"args": ["dist/stdio.js"],
"cwd": "/absolute/path/to/apps/mcp"
}
}
}For development, you can use tsx directly:
{
"mcpServers": {
"open-generative-ui": {
"command": "npx",
"args": ["tsx", "src/stdio.ts"],
"cwd": "/absolute/path/to/apps/mcp"
}
}
}Add to .mcp.json:
{
"openGenerativeUI": {
"url": "http://localhost:3100/mcp"
}
}Then start the HTTP server with pnpm dev.
- stdio: Run
node dist/stdio.js(orpnpm start:stdio) - HTTP: Connect to
http://localhost:3100/mcp(start withpnpm devorpnpm start)
Wraps an HTML fragment with the complete OpenGenerativeUI design system.
Input:
{
title: string; // Short title, e.g., "Binary Search Visualization"
description: string; // One-sentence explanation
html: string; // Self-contained HTML fragment (inline <style> and <script> OK)
}Output:
{
content: [{
type: "text",
text: string // Complete HTML document, ready to render in iframe
}]
}Example:
const result = await client.callTool("assemble_document", {
title: "Interactive Algorithm Visualizer",
description: "Step-by-step visualization of the quicksort algorithm",
html: `
<div id="viz">
<p>Click to start visualization</p>
<script>
// Your visualization code here
</script>
</div>
`
});
// result.content[0].text is a complete HTML document
// Render in: <iframe sandbox="allow-scripts allow-same-origin" srcdoc={result.content[0].text} />Returns a JSON array of available skill names.
Example:
curl -X POST http://localhost:3100/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "resources/read",
"params": { "uri": "skills://list" }
}'Retrieve the full text content of a specific skill.
Available skills:
master-agent-playbook— When and how to create interactive HTML widgetssvg-diagram-skill— SVG diagram templates and patternsagent-skills-vol2— Advanced visualizations, dashboards, simulations
Example:
curl -X POST http://localhost:3100/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "resources/read",
"params": { "uri": "skills://master-agent-playbook" }
}'Instructions for creating interactive HTML widgets.
Instructions for creating inline SVG diagrams with canonical templates.
Advanced visualization instructions: dashboards, simulations, UI mockups.
# Build image
docker build -t open-generative-ui-mcp .
# Run container
docker run -p 3100:3100 open-generative-ui-mcp
# With custom port and CORS
docker run \
-p 3100:3100 \
-e MCP_PORT=3100 \
-e ALLOWED_ORIGINS="http://localhost:3000,https://myapp.com" \
open-generative-ui-mcp# Install globally or locally
npm install -g open-generative-ui-mcp
# Run
MCP_PORT=3100 ALLOWED_ORIGINS="*" open-generative-ui-mcp
# Or with node
node dist/index.jsThe server is a standard Node.js application and can be deployed to:
- Heroku:
Procfile: web: node dist/index.js - Railway: Connect the repo, select Node.js, set
startscript - Vercel: Use serverless function (requires adapter)
- AWS Lambda: Package with Node.js runtime
- Google Cloud Run: Use Dockerfile
apps/mcp/
├── package.json # Standalone package definition
├── tsconfig.json # TypeScript config
├── .env.example # Configuration template
├── Dockerfile # Container definition
├── skills/ # Skill instruction files (copied from source)
└── src/
├── index.ts # HTTP server entry point (Hono)
├── stdio.ts # stdio transport entry point (Claude Desktop)
├── server.ts # MCP server construction (shared)
├── skills.ts # Skill file loader
└── renderer.ts # Design system CSS + assembleDocument
Add new skill files to skills/ directory as .txt files. They'll automatically be available as resources and can be used in prompts.
Edit src/renderer.ts to update:
THEME_CSS— Theme colors and variablesSVG_CLASSES_CSS— Pre-built SVG helper classesFORM_STYLES_CSS— Form element stylingBRIDGE_JS— Communication bridge between iframe and parent
MIT
For issues, feature requests, or questions, visit the OpenGenerativeUI repository.
This is a standalone deployment package. To contribute improvements:
- Fork the main OpenGenerativeUI repository
- Make changes to
apps/mcp/(or the source files it's forked from) - Submit a pull request
When updating skills or the design system in the main repo, the MCP package should be updated accordingly.