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 compiles compact GUI2
ArtifactSpec JSON into design-system-aware HTML artifacts.
The v0.3 pipeline is:
ArtifactSpec
-> studio model compiler
-> CompilerOutput { strategy, view_tree }
-> validated ViewTree + derived legacy RenderPlan metadata
-> DesignSystemPack resolver
-> deterministic HTML compiler
-> static HTML or ui:// resourceThe remote model sends compact semantic specs by default. The studio compiler chooses composition, while the server owns validation, design-system tokens, escaping, CSP, and deterministic runtime code.
Setup
uv sync
uv run pytest
uv run ruff check .
uv run python scripts/render_example.py examples/v0_3/implementation_plan.json /tmp/web-gui-plan.html
uv run python scripts/render_artifact_library_pages.pyWithout uv:
python -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"
pytest
ruff check .
python scripts/render_example.py examples/v0_3/implementation_plan.json /tmp/web-gui-plan.html
python scripts/render_artifact_library_pages.pyRelated MCP server: Scrapi MCP Server
Run The MCP Server
uv run web-gui-mcpThe server exposes:
render_artifactget_artifactpatch_artifactlist_artifactsexport_artifactget_artifact_schemacompile_view_treelint_view_treelist_design_systemsget_design_system_summaryget_local_model_statusrecommend_studio_modeldownload_studio_modelcancel_model_downloadlist_themespreview_themeretheme_artifactrerender_artifact
It serves:
ui://gui2/runtime/v0.3.cssui://gui2/runtime/v0.3.jsui://gui2/artifacts/{artifact_id}
Render An Artifact
render_artifact accepts compact semantic v0.3 specs:
{
"spec": {
"v": "0.3",
"artifact": "implementation_plan",
"title": "Queue Backpressure Plan",
"audience": "engineer",
"density": "compact",
"sections": [
{
"kind": "summary",
"items": [
{ "label": "Risk", "value": "Medium", "tone": "warning" }
]
},
{
"kind": "checklist",
"title": "Acceptance",
"items": [
{ "text": "Default response returns a ui:// resource" }
]
}
]
},
"quality": "studio",
"delivery": "mcp_app_resource"
}Default delivery returns compact metadata plus a ui://gui2/artifacts/{artifact_id}
resource URI. Use delivery = "static_html" or return_html_to_model = true only
when the caller explicitly needs full HTML in the tool response.
Studio Compiler
v0.3 is studio-only. The configured model provider receives the compact
ArtifactSpec plus a design-system summary and produces CompilerOutput:
compact strategy metadata plus the authoritative view_tree. The server
validates and lints the ViewTree, derives deprecated RenderPlan metadata only
for compatibility, then renders deterministic HTML. There is no deterministic
fallback in normal rendering: if the model provider is unavailable or validation
fails after one repair retry, the render fails closed.
Model providers:
stub: test provider that returns known valid CompilerOutput.openai: default provider; usesgpt-5.5with medium reasoning via the OpenAI API.ollama: optional local provider; posts to/api/generateand validates CompilerOutput JSON.auto: resolves to OpenAI unlessWEB_GUI_RENDERER_PROVIDERoverrides it.
OpenAI configuration:
export OPENAI_API_KEY=...The server also reads .env.local in the repo root. Do not commit that file.
Optional local fallback model:
ollama pull qwen2.5-coder:14brecommend_studio_model also lists larger quality targets for stronger hardware:
qwen3.6:27b and qwen3-coder-next:q4_K_M.
Design Systems
The bundled gui2.default pack includes:
light/dark modes
compact/normal/comfortable/presentation density layers
neutral_pro,dense_engineering,executive_brief, andeditorial_researchthemeseditorial_galleryfor reference-library pages with numbered sections and demo cardscomponent contracts for the built-in ViewTree nodes
recipes for plans, reviews, design-variant grids, research, dashboards, and editors
Figma import and Code Connect ingestion are intentionally out of scope for this pass. The design-system schemas keep provenance fields so those importers can be added later.
Connect To Codex
[mcp_servers.web_gui_mcp]
command = "uv"
args = ["run", "web-gui-mcp"]
cwd = "/Users/hzuo/src/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/gui-mcp"
startup_timeout_sec = 20
tool_timeout_sec = 60
enabled = trueSafety
All model-provided text is escaped before rendering.
ViewTree nodes are allowlisted and validated with Pydantic.
Props named like raw HTML, CSS, scripts,
srcdoc, or event handlers are rejected.Bind paths must resolve against the validated
ArtifactSpec.Semantic data nodes such as
timeline,checklist, andsummary_stripmust bind to compatible non-empty artifact data.JSON state embedded in
<script type="application/json">escapes<,>,&, U+2028, and U+2029.The renderer never executes model-generated JavaScript.
The only runtime script is deterministic server-owned code for copy/export and tabs.
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