web-gui-mcp
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.
README
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.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.
Run The MCP Server
uv run web-gui-mcp
The 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 = 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
Connect 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。