loading…
Search for a command to run...
loading…
A Python MCP server that allows your agent to outsource HTML generation and rendering, storing artifacts in memory and supporting both full HTML and resource UR
A Python MCP server that allows your agent to outsource HTML generation and rendering, storing artifacts in memory and supporting both full HTML and resource URIs.
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:
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.
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.html
Without 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.html
The Chromium smoke tests target local Google Chrome/Chromium through Playwright.
uv run web-gui-mcp
The server exposes:
search_artifact_patternsget_artifact_schemarender_artifactpatch_artifactlint_artifactexport_artifactlist_artifactsIt also serves:
ui://web-gui/runtime/v0.1.cssui://web-gui/runtime/v0.1.jsui://web-gui/artifacts/{artifact_id}v0.1 patterns remain supported:
implementation_plancode_review_explainerdesign_variant_gridresearch_reportcustom_editorv0.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_tunerUse v = "0.2" when an artifact needs richer local behavior:
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.
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 = true
Without 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 = true
For Claude Code and Cursor configuration snippets, see README.agent.md.
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.
html_preview is escaped text by default.srcdoc documents.<script type="application/json"> escapes <, >, &,
U+2028, and U+2029 to prevent </script> breakout.Run in your terminal:
claude mcp add web-gui-mcp -- npx