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 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:// resource
The 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.
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.py
Without 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.py
uv run web-gui-mcp
The 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_artifactIt serves:
ui://gui2/runtime/v0.3.cssui://gui2/runtime/v0.3.jsui://gui2/artifacts/{artifact_id}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.
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; uses gpt-5.5 with medium reasoning via the OpenAI API.ollama: optional local provider; posts to /api/generate and validates CompilerOutput JSON.auto: resolves to OpenAI unless WEB_GUI_RENDERER_PROVIDER overrides 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:14b
recommend_studio_model also lists larger quality targets for stronger hardware:
qwen3.6:27b and qwen3-coder-next:q4_K_M.
The bundled gui2.default pack includes:
neutral_pro, dense_engineering, executive_brief, and editorial_research themeseditorial_gallery for reference-library pages with numbered sections and demo cardsFigma 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.
[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 = true
Without 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 = true
srcdoc, or event handlers are rejected.ArtifactSpec.timeline, checklist, and summary_strip must
bind to compatible non-empty artifact data.<script type="application/json"> escapes <, >, &,
U+2028, and U+2029.Run in your terminal:
claude mcp add web-gui-mcp -- npx Yes, Web Gui MCP is free — one-click install via Unyly at no cost.
No, Web Gui runs without API keys or environment variables.
Self-hosted: the server runs locally on your machine via the install command above.
Open Web Gui on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
CSA PROJECT - FZCO © 2026 IFZA Business Park, DDP, Premises Number 31174 - 001
Security
Low riskAutomated heuristic from public metadata — not a security guarantee.