web-gui-mcp
This server lets AI agents generate, render, manage, and analyze rich HTML artifacts from structured semantic specs, delivering them as full HTML or ui:// resource URIs.
Core Tools
Render artifacts – Convert a declarative JSON spec into HTML. Supports
v0.1(safe static output) andv0.2(richer, Chrome-first interactive layouts), with three delivery modes:static_html,mcp_app, orresource_only(ui://URI).Patch artifacts – Apply JSON Patch operations (
add,replace,remove) to update a stored artifact incrementally.Lint artifacts – Validate a spec or HTML against schema, accessibility, mobile, security, token cost, and size checks.
Export artifacts – Export a stored artifact as
html,markdown,json, orprompt.List artifacts – Retrieve paginated metadata (ID, title, pattern, revision, creation time) for all stored artifacts.
Search artifact patterns – Discover available patterns by query text or use case (e.g.,
planning,code_review,diagrams,decks).Get artifact schema – Fetch the JSON schema, minimal example, and usage guidance for a specific pattern (e.g.,
slide_deck,triage_board,feature_explainer).
Artifact Patterns (25 total)
v0.1 static:
implementation_plan,code_review_explainer,design_variant_grid,research_report,custom_editorv0.2 interactive:
approach_comparison,slide_deck,feature_explainer,triage_board,module_map,clickable_flow,diagram_sheet,incident_report,prompt_tuner, and more.
v0.2 Interactive Behaviors include tabs, filters, collapsibles, sliders, keyboard slide navigation, drag/reorder boards, dependency-aware toggles, live prompt previews, and sandboxed iframe prototypes.
Safety: All model-provided text is HTML-escaped, no arbitrary model-generated JavaScript is executed, and sandboxed iframes block network and same-origin access.
Supports generating and serving CSS stylesheets for artifact rendering, including runtime CSS via resource URIs.
Provides rendering and testing capabilities using Google Chrome/Chromium via Playwright, enabling sandboxed previews and deterministic local interactions.
Enables artifact rendering with JavaScript runtime for interactive features such as tabs, sliders, and keyboard navigation, while preventing execution of arbitrary model-generated scripts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@web-gui-mcpRender a feature explainer artifact for rate limiting."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
web-gui-mcp
web-gui-mcp is a Python MCP server that allows your agent to outsource the html generation and rendering. It stores artifacts in memory and can
return either full HTML or an MCP App-style ui:// resource URI. Inspired by https://thariqs.github.io/html-effectiveness/ but with cost in mind.
Agent/LLM entrypoints:
README.agent.md: setup, Claude Code, Cursor, and agent usage guidance.llms.txt: concise machine-readable orientation.
The renderer supports the original safe static v0.1 contract and an additive
Chrome-first v0.2 contract with richer Studio Sheet layouts, sandboxed prototypes,
and deterministic local interactions.
Setup
uv sync
uv run pytest
uv run pytest tests/test_chromium_smoke.py
uv run python scripts/render_example.py examples/implementation_plan.json /tmp/web-gui-plan.htmlWithout uv:
python -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"
pytest
pytest tests/test_chromium_smoke.py
python scripts/render_example.py examples/implementation_plan.json /tmp/web-gui-plan.htmlThe Chromium smoke tests target local Google Chrome/Chromium through Playwright.
Related MCP server: mcp-toolkit
Run The MCP Server
uv run web-gui-mcpThe server exposes:
search_artifact_patternsget_artifact_schemarender_artifactpatch_artifactlint_artifactexport_artifactlist_artifacts
It also serves:
ui://web-gui/runtime/v0.1.cssui://web-gui/runtime/v0.1.jsui://web-gui/artifacts/{artifact_id}
Pattern Families
v0.1 patterns remain supported:
implementation_plancode_review_explainerdesign_variant_gridresearch_reportcustom_editor
v0.2 adds Chrome-first artifact families:
approach_comparisonvisual_direction_boardimplementation_handoffpr_review_workspacepr_author_writeupmodule_mapdesign_system_referencecomponent_variant_matrixanimation_tunerclickable_flowdiagram_sheetannotated_flowchartslide_deckfeature_explainerconcept_explainerstatus_reportincident_reporttriage_boardfeature_flag_editorprompt_tuner
v0.2 Interactions
Use v = "0.2" when an artifact needs richer local behavior:
tabs, filters, collapsibles, copy/export buttons
sliders and replay controls
keyboard slide navigation
clickable diagram inspectors
drag/reorder boards
dependency-aware toggles
live prompt-template previews
Prototype and editor surfaces use sandboxed iframe srcdoc documents with
sandbox="allow-scripts". The sandbox does not allow same-origin access or network
requests. Model output remains declarative and escaped; only the known renderer
runtime executes.
Connect To Codex
Add a local MCP server entry to your Codex config, using this repository as cwd:
[mcp_servers.web_gui_mcp]
command = "uv"
args = ["run", "web-gui-mcp"]
cwd = "/Users/hzuo/src/web-gui-mcp"
startup_timeout_sec = 20
tool_timeout_sec = 60
enabled = trueWithout uv:
[mcp_servers.web_gui_mcp]
command = "python"
args = ["-m", "web_gui_mcp.server"]
cwd = "/Users/hzuo/src/web-gui-mcp"
startup_timeout_sec = 20
tool_timeout_sec = 60
enabled = trueConnect To Claude Code Or Cursor
For Claude Code and Cursor configuration snippets, see README.agent.md.
Render An Artifact
render_artifact accepts a compact semantic spec:
{
"spec": {
"v": "0.2",
"artifact": "feature_explainer",
"title": "Rate Limiting Explainer",
"sections": [
{
"kind": "tabs",
"title": "How it works",
"tabs": [
{ "id": "tldr", "label": "TL;DR", "body": "Requests are keyed by account and route." },
{ "id": "path", "label": "Path", "body": "Middleware increments usage and emits headers." }
]
}
]
},
"delivery": "static_html"
}Use delivery = "mcp_app" or delivery = "resource_only" when you want a stored
ui://web-gui/artifacts/{artifact_id} URI instead of returning full HTML through the
tool response.
Safety
All model-provided text is HTML-escaped.
html_previewis escaped text by default.v0.2 prototype/editor sections use sandboxed iframe
srcdocdocuments.Generated interactions use deterministic runtime code; model-generated JavaScript is not allowed.
JSON state embedded in
<script type="application/json">escapes<,>,&, U+2028, and U+2029 to prevent</script>breakout.The renderer does not execute or copy arbitrary model-generated JavaScript.
CSS, HTML structure, and optional local runtime behavior are deterministic.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thehzuo/gui-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server