Polyxd

com.polyxd由 polyxd.com 發布官方發布者v0.4.6更新於 Oct 24, 2026

Write Polyxd UI documents, check them, and show them as real screens in any design-system pack.

已驗證Streamable HTTP可網頁執行開發者工具媒體與設計

概覽

AI 產生的概覽

讓助理撰寫 Polyxd UI 文件、依規格驗證與核查,並以所選設計系統套件把文件顯示為可互動畫面。

可以做什麼
  • 取得 Polyxd 規格說明,以及元件清單與單一元件的完整定義
  • 驗證 UI 文件,回傳每個問題的 JSON Pointer、所在元件與修改提示
  • 執行核查器的檢查,可選擇搭配 Design Direction 與能力登錄表
  • 把有效文件以所選設計系統套件與明暗模式顯示為可互動畫面
  • 列出設計系統套件,並搜尋內建的 Polyxd 文件
適用情境
適合希望助理產生 Polyxd UI 文件,並讓使用者在對話中直接檢視與操作產生畫面的情境。也適合在交付前依規格與核查規則檢查文件。
執行需求
可使用託管遠端端點,無需帳號或登入;也可透過 npx 以 stdio 在本機執行 npm 套件,需要 Node.js。可互動畫面需要支援 MCP Apps 的宿主,其他宿主只會取得文字摘要。
安裝前請注意
所有工具皆為唯讀,本機套件不會把資料送到任何地方;但託管伺服器在設定分析金鑰後會匿名統計初始化與工具呼叫次數。在顯示的畫面中按下操作時,綁定到該操作的值(包括使用者輸入的內容)會以使用者訊息回傳給模型。託管端點依 IP 位址限流。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Polyxd,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.polyxd%2Fmcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "polyxd": {
      "type": "http",
      "url": "https://mcp.polyxd.com/mcp"
    }
  }
}

README

@polyxd/mcp

An MCP server for Polyxd. The host's model is the generator: the server gives it the spec as instructions, checks the UI documents it writes, and shows them to the user as an MCP App, drawn by the Polyxd renderer in any design-system pack.

sh
npx -y @polyxd/mcp        # stdio

Or connect by URL to the hosted server, which needs no account and no sign-in:

https://mcp.polyxd.com/mcp

Connect by URL

  • Claude (claude.ai, and Claude Desktop through your account): Customize > Connectors > Add custom connector, paste the URL, No sign-in.
  • Claude Code: claude mcp add --transport http polyxd https://mcp.polyxd.com/mcp
  • ChatGPT: turn on developer mode (Settings > Security and login), then add it at chatgpt.com/plugins with the URL and no authentication.
  • Cursor: { "mcpServers": { "polyxd": { "url": "https://mcp.polyxd.com/mcp" } } } in ~/.cursor/mcp.json.
  • VS Code: { "servers": { "polyxd": { "type": "http", "url": "https://mcp.polyxd.com/mcp" } } } in .vscode/mcp.json.

Add it to a host over stdio

Claude Desktop (claude_desktop_config.json) and most other MCP clients:

json
{  "mcpServers": {    "polyxd": { "command": "npx", "args": ["-y", "@polyxd/mcp"] }  }}

Claude Code:

sh
claude mcp add polyxd -- npx -y @polyxd/mcp

From a clone of this repository: npm install && npm run build -w @polyxd/mcp, then use node <repo>/packages/mcp/dist/bin.js as the command.

Tools

ToolWhat it doesstructuredContent
polyxd_guideThe spec as instructions: how to use these tools, then the generator prompt the demos use (document shape, rules for generated screens, bindings, actions, every component and its props, the patterns).{ specVersion, guide }, the guide being the same text as the content
polyxd_validateValidates a document. Every issue comes with its JSON Pointer, the component it is in, and a hint saying what to change.{ valid, errors, warnings, issues[{ severity, pointer, component?, message, hint? }] }
polyxd_verifyThe verifier's document checks (staticAudit from @polyxd/verifier/static, so installing the server installs no Playwright), optionally against a Design Direction (an object, or calm-finance / playful-personal) and a capability registry. A compact report.{ errors, warnings, findings[{ severity, check, message, hint? }], direction?, rules }
polyxd_showValidates, then returns the document for display. pack picks the design-system pack (default material3), mode picks light or dark (default: the host's theme). Shows nothing when there are errors.{ shown: true, document, pack, packName, mode?, specVersion }, or { shown: false, issues } with isError
polyxd_packsThe packs: published design systems and original templates.{ default, packs[{ name, displayName, template, package, description }] }
polyxd_componentsThe components with a one-line summary each, or one component's full definition by name.{ components[{ name, category, summary, shell }] }, or { component } with the full definition
polyxd_docsSearches the polyxd.com docs bundled into this version: the sections that best match query, one whole page, or the list of pages.{ sections[{ page, title, heading, url, text }] }, { page } or { pages[] }

Every tool is read-only. data can be passed to polyxd_validate, polyxd_verify and polyxd_show separately from the document; it replaces the document's own data.

Every tool declares an outputSchema (JSON Schema 2020-12, in src/output-schemas.ts, each property described for the model), and every successful result carries structuredContent that conforms to it; the SDK checks each one before it is sent. Error results (isError: true) are not held to the schema: polyxd_show's not-shown result still conforms, the others carry text only.

Resources

  • ui://polyxd/surface.html (text/html;profile=mcp-app): the MCP App.
  • polyxd://examples/<name>.json: the spec's example documents.
  • polyxd://directions/<name>.json: the spec's example Design Directions.

The MCP App

polyxd_show declares _meta.ui.resourceUri: "ui://polyxd/surface.html", per the MCP Apps extension (SEP-1865, 2026-01-26), and ChatGPT's alias openai/outputTemplate. A host that supports MCP Apps reads that resource and renders it in a sandboxed iframe. The page is self-contained: the @polyxd/web renderer, the renderer's stylesheet and every pack's theme, inlined, with no external origins, so the host's default Content Security Policy is enough.

The resource's _meta says so for each host (appResourceMeta()):

  • ui.csp: { connectDomains: [], resourceDomains: [] }. The page loads nothing.
  • ui.prefersBorder: true.
  • ChatGPT's own keys: openai/widgetCSP (the same empty lists), openai/widgetPrefersBorder, openai/widgetDescription, and openai/widgetDomain: "https://mcp.polyxd.com", the origin ChatGPT gives the app's sandbox.
  • No ui.domain. Claude wants a hash of the connector URL there and ChatGPT wants an origin, and Claude refuses to render an app whose ui.domain is not its own format. The page needs no stable origin, so it sets none, and ChatGPT reads openai/widgetDomain instead.

The page speaks the MCP Apps protocol over postMessage: ui/initialize, then ui/notifications/initialized. It renders the document from the ui/notifications/tool-result notification's structuredContent, in the chosen pack, light or dark from the host's theme unless mode was given. It reports its height with ui/notifications/size-changed.

When the user presses an action, the page sends ui/message with a user message naming the action, the button's label and the action's context (the values bound into it, including what the user typed):

[Polyxd] In the "New task" screen I pressed "Add task" (action task.save).Context: {"title":"Buy milk","due":"2026-10-01"}

The model receives that as the user's next message and acts on it. Closing the screen (ui.dismiss) arrives the same way. A host without MCP Apps support gets polyxd_show's text summary instead.

The prompt

The generator prompt comes from @polyxd/runtime, which builds it from the spec. src/packs.generated.ts lists the packs, and src/spec-files.generated.ts imports the spec's component definitions and examples as JSON modules, so the server reads no files. npm run sync -w @polyxd/mcp rewrites both, and the tests fail if either is out of date.

Over HTTP

@polyxd/mcp/http serves the same server over MCP's Streamable HTTP transport, as a web-standard (Request) => Promise<Response> handler. It uses nothing from Node, so it runs in a Cloudflare Worker, Deno or Bun.

ts
import { createHttpHandler, rateLimiter } from "@polyxd/mcp/http";import viewHtml from "@polyxd/mcp/view.html"; // bundled as text
const mcp = createHttpHandler({ viewHtml: () => viewHtml, rateLimit: rateLimiter({ limit: 600, windowMs: 60_000 }) });export default { fetch: (request: Request) => (new URL(request.url).pathname === "/mcp" ? mcp(request) : new Response(null, { status: 404 })) };

The transport is the SDK's createMcpHandler, stateless: a fresh server per request, no sessions. For 2025-era clients GET and DELETE answer 405, as the spec asks of a server with no standalone stream and no sessions. Clients on the 2026-07-28 protocol, which send the version with every request, work too. Around it:

  • Body limit: maxBodyBytes, default 1 MiB, answered 413. It is checked on Content-Length first and again as the body is read.
  • Timeout: timeoutMs, default 15 seconds, for the whole answer. Late answers get a JSON-RPC error: a 504, or on an SSE stream an error for the request's id.
  • Rate limit: rateLimit(request) returns false for 429 with Retry-After. rateLimiter() is a fixed window in memory, keyed on CF-Connecting-IP. It counts per process or per Worker isolate, so it is best effort.
  • CORS: any origin, since the server holds no credentials and no one's data. Preflights allow the headers they ask for, and responses expose Mcp-Session-Id and Mcp-Protocol-Version.
  • Logs: one line per request with the method, path, status and duration. Nothing else: not a body, a header, a query string, an address or an error message.

The hosted server

https://mcp.polyxd.com/mcp is apps/mcp, a Cloudflare Worker: /mcp is the handler above, /health answers JSON, and / redirects to the docs. The view is bundled into the Worker as text (about 2.4 MB in all, 385 KB gzipped). Its rate limit is Cloudflare's rate limiting binding, 600 requests a minute per IP address. That binding counts per Cloudflare location, so it guards against floods rather than enforcing an exact quota. Claude and ChatGPT call from their own servers, which is why the limit is generous. Cloudflare's invocation logs, traces and Issues are off in wrangler.jsonc, so the Worker's own lines are all that is kept. With a POSTHOG_KEY secret set, the hosted Worker also counts initializes and tool calls anonymously (apps/mcp/src/analytics.ts): names and counts only, never a document, its data or an address. This package, and npx @polyxd/mcp, send nothing anywhere.

sh
npm run dev -w @polyxd/mcp-remote                        # wrangler dev on http://127.0.0.1:8787/mcpnode apps/mcp/scripts/smoke.ts http://127.0.0.1:8787/mcp  # every tool, in both protocol eras, over real HTTPnpm run deploy -w @polyxd/mcp-remote                     # builds @polyxd/mcp, then wrangler deploy

Deploying creates the mcp.polyxd.com custom domain on the polyxd.com zone. workers.dev and preview URLs are off.

MCP Registry

server.json describes the hosted server for the MCP Registry as com.polyxd/mcp. A name under com.polyxd needs proof that you control polyxd.com:

sh
openssl genpkey -algorithm Ed25519 -out key.pemecho "polyxd.com. IN TXT \"v=MCPv1; k=ed25519; p=$(openssl pkey -in key.pem -pubout -outform DER | tail -c 32 | base64)\""mcp-publisher login dns --domain polyxd.com --private-key "$(openssl pkey -in key.pem -noout -text | grep -A3 'priv:' | tail -n +2 | tr -d ' :\n')"mcp-publisher publish      # from packages/mcp

This needs OpenSSL 3 (macOS's LibreSSL has no Ed25519). Keep key.pem private and out of the repository. The TXT record goes on the apex, polyxd.com. HTTP proof works instead: serve the same v=MCPv1; k=ed25519; p=... line at https://polyxd.com/.well-known/mcp-registry-auth and use mcp-publisher login http. It has to be polyxd.com, not mcp.polyxd.com, whose proof would only cover names under com.polyxd.mcp.

The release workflow publishes server.json to the registry on each version tag, once npm has the version, signing in with the private key in the MCP_REGISTRY_KEY Actions secret (the hex string the --private-key command above prints). Without the secret, or when the registry already has the version, the step is skipped with a notice.

server.json lists both the hosted server (remotes) and the npm package (packages), so hosts can offer either. The registry checks the package's mcpName in package.json. Keep both version fields in server.json in step with package.json; a test checks it.

Build and test

sh
npm run build -w @polyxd/mcp     # tsc, then scripts/build-view.ts writes dist/view.htmlnpm test -w @polyxd/mcpnpm test -w @polyxd/mcp-remote   # the Worker's routes

The tests connect a client to the server in memory and call every tool on every spec example and on broken documents; start the built bin and speak JSON-RPC to it over stdio; serve it over Streamable HTTP to the SDK client in both protocol eras, and send the raw requests a client library never would (bad JSON, oversize bodies, too many requests, preflights, slow answers); bundle the HTTP entry for a Worker and check it needs nothing from Node; and load the MCP App in headless Chromium with the test playing the host, from the handshake to an action arriving as ui/message. The browser tests skip when Playwright has no Chromium (npx playwright install chromium).

來源:packages/mcp/README.md,提交 9c1a564

工具

7

polyxd_guide

Polyxd guide

Returns the instructions for writing a Polyxd UI document: the document shape, the rules for generated screens, bindings, actions, every component with its props, and the patterns. Call this once before writing your first document.

無需輸入參數。

polyxd_validate

Validate a Polyxd document

Checks a Polyxd UI document against the spec: the schema, ids and references, bindings against the data, actions, and the rules for generated screens. Returns every issue with its JSON Pointer, the component it is in, and a hint saying what to change. Call it after writing or changing a document, and fix every error before showing it.

輸入參數datadocument必填

polyxd_verify

Verify a Polyxd document

Runs the Polyxd verifier's document checks: the spec validator, the pattern the surface declares, readable and distinct labels, one primary action per view, at most six inputs per view, entity-first flows, confirmations, and, when you pass one, a Design Direction's rules and voice. Returns a compact report. Example directions by name: calm-finance, playful-personal.

輸入參數datadocument必填registrydirection

polyxd_show

Show a Polyxd screen

Validates a Polyxd UI document and shows it to the user as an interactive screen, drawn by the Polyxd renderer in the design-system pack you choose (default material3). Shows nothing if the document has errors; fix them first with polyxd_validate. When the user presses an action in the screen, you receive a chat message from the user naming the action and its context; that only tells you their choice, and nothing has been submitted or paid. Packs: material3, antd, bootstrap, carbon, chakra, fluent, govuk, mantine, polaris, primer, radix, shadcn, spectrum, brutalist, civic, editorial, finance, glass, health, mono, neon, pastel, sketch, terminal, wireframe.

輸入參數datamodepackdocument必填

polyxd_packs

List Polyxd packs

Lists the design-system packs polyxd_show can draw a screen in: published design systems (Material 3, Carbon, GOV.UK and others) and original templates. The same document looks native in each.

無需輸入參數。

polyxd_components

List Polyxd components

Lists the semantic components a Polyxd document can use, with a one-line summary each. Pass "name" for one component's full definition: every prop and its type, which are required, when to use it and when not to, and how it renders.

輸入參數name

polyxd_docs

Search the Polyxd docs

Searches the polyxd.com docs, as of this server's version: installing and using the React and Web Components renderers, the spec, the verifier and its CLI, the runtime, the generation server, design systems and packs, Design Directions, analytics events, Studio, the MCP server and the roadmap. Pass "query" for the sections that best match, "page" for one whole page, or nothing for the list of pages. Cite the URLs it returns. For writing a document, use polyxd_guide.

輸入參數pagequery

版本歷史

5
  1. v0.4.6最新Oct 9, 2026
  2. v0.4.4Oct 8, 2026
  3. v0.4.3Oct 8, 2026
  4. v0.4.1Sep 29, 2026
  5. v0.4.0Sep 28, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分