MCP wrapper that auto-generates interactive UIs for tools using LLM
npm install mcp-gen-uiA proxy layer that wraps any "plain" MCP server (tools-only) and automatically generates interactive UI resources using an LLM at runtime.
Point the wrapper at any existing MCP server, and it automatically:
1. Discovers tools from the underlying server
2. Generates interactive UIs for each tool using an LLM
3. Caches generated UIs for fast subsequent access
4. Supports iterative refinement - say "make the table sortable" and the UI regenerates
The wrapper supports two MCP UI standards:
- MCP Apps (--standard mcp-apps, default) — Uses the @modelcontextprotocol/ext-apps App API. UIs are self-contained HTML that communicate with the host via the MCP Apps SDK.
- OpenAI Apps SDK (--standard openai) — Uses the window.openai API (Skybridge). UIs communicate with the host via the OpenAI Apps SDK, as used in ChatGPT.
Both standards produce self-contained HTML with inline JS/CSS. The wrapper generates UIs tailored to the selected standard's API surface.
The MCP ecosystem has hundreds of tool-only servers with no visual interface. Building UIs for each tool requires frontend development effort and blocks exploration of "what would this look like as an app?"
This wrapper creates a zero-friction path from "I have tools" to "I have interactive UIs."
```
┌─────────────────┐ ┌─────────────────────┐ ┌─────────────────┐
│ MCP Host │────▶│ Generative UI │────▶│ Underlying │
│ (Claude Desktop)│◀────│ Wrapper │◀────│ MCP Server │
└─────────────────┘ └─────────────────────┘ └─────────────────┘
│
▼
┌─────────────┐
│ LLM API │
│ (Anthropic, │
│ OpenAI) │
└─────────────┘
The wrapper:
- Exposes all upstream tools with _meta.ui.resourceUri pointing to generated UIsui://
- Serves resources with LLM-generated HTML_ui_refine
- Proxies tool calls transparently to the underlying server
- Accepts refinement requests via the tool
`bashWrap a stdio MCP server
mcp-gen-ui --upstream "uvx mcp-server-yfinance" --provider anthropic
Pipe Composition (mcpblox)
mcp-gen-ui can participate in mcpblox pipe chains. When stdin is a pipe, it reads the upstream URL from stdin. When stdout is a pipe, it writes its own URL to stdout for downstream consumers.
`bash
mcpblox transforms → mcp-gen-ui adds UIs
mcpblox --upstream "uvx yfmcp@latest" --prompt "rename tools" \
| mcp-gen-ui --provider anthropic --standard openaiMulti-stage pipeline
mcpblox --upstream "uvx yfmcp@latest" --prompt "rename tools" \
| mcpblox --prompt "create synthetic compare_stocks tool" \
| mcpblox --prompt "hide all except compare_stocks and get_price_history" \
| mcp-gen-ui --standard openai --provider anthropic --port 18888
`When piped, the server binds to an OS-assigned port (override with
--port). All logs go to stderr so stdout stays clean for the pipe protocol.Features
- Zero-config: Point at any MCP server, get UIs automatically
- Dual-standard: Supports both MCP Apps and OpenAI Apps SDK
- Pipe composition: Chain with mcpblox via Unix pipes for transform → UI pipelines
- On-demand generation: Generate on first request, cache for performance
- Iterative refinement: Natural language feedback to customize UIs
- Full interactivity: Generated UIs can call tools, update dynamically
- Graceful fallback: Minimal UI for tools without meaningful visual output
Design Documents
See
docs/ for design documents:
- PRODUCT_SPEC.md - Requirements and user stories
- PRODUCT_SPEC-design.md` - Technical architecture and implementation planApache 2.0