Archlang Mcp

io.github.ChanMeng666由 GitHub 帳號 ChanMeng666 發布v0.2.40更新於 Nov 7, 2026

ArchLang: compile, describe, lint, validate, score, repair, fix, finish, suggest, complete, link.

已驗證STDIO僅桌面開發者工具媒體與設計

概覽

AI 產生的概覽

讓助理撰寫 ArchLang 平面圖原始碼,並編譯成 SVG、PNG、ASCII 或 JSON,同時檢查、評分、修復並補齊圖面。

可以做什麼
  • 把平面圖原始碼或 Plan JSON 編譯成 SVG、PNG、ASCII 或 Plan JSON,並回傳診斷與各樓層頁面
  • 以語意事實描述房間、面積、相鄰關係、門、動線與樓層
  • 對圖面執行 lint 與 validate,支援嚴格模式、室內門相鄰圖檢查與任務書意圖門檻
  • 依任務書為圖面評分,修復家具與牆體衝突,或套用可自動修復的診斷
  • 補齊圖面:為房間配置家具,並補上圖紙、比例、尺寸、標題、明細表與圖例
  • 提供門窗建議語句、依位元組位移提供補齊項目,並產生 playground 與嵌入連結
適用情境
當希望由支援 MCP 的宿主在沒有命令列的情況下起草、檢查並完善以 ArchLang 程式碼撰寫的建築平面圖時使用。已有 shell 的代理更適合改用 archlang 命令列工具,它在未被呼叫前不佔用上下文。
執行需求
透過 npx 從 npm 套件 @chanmeng666/archlang-mcp 以 stdio 在本機執行,需要 Node.js 以及下載該套件的網路存取。未宣告帳號、API 金鑰或環境變數。PNG 輸出依賴選用的 @resvg/resvg-js,.mcpb 打包版本不含它。
安裝前請注意
工具本身不寫入檔案,但 repair、fix 與 finish 會回傳改寫後的原始碼,需自行儲存;回傳的雜湊值供命令列工具的原始碼過期檢查使用。門窗建議僅為參考資料,不會自動套用。accessible 選項只加入標題與描述,並未提供完整的鍵盤與螢幕閱讀器元素控制。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@chanmeng666/archlang-mcp

A Model Context Protocol server for ArchLang — author, inspect, and repair architectural floor plans written as code, from any MCP-speaking host.

It is a thin stdio shim over the @chanmeng666/archlang library (no subprocess, no re-implementation): each tool wraps one pure, exported function. The core stays zero-dependency — the MCP SDK lives only in this package.

Try it

Floor plans as code. Your AI writes ArchLang; the compiler draws a precise, dimensioned plan and tells it what's wrong.

  • ChatGPT, no install: ArchLang app in ChatGPT, then ask, for example: "Draw a two-bedroom flat of about 75 m² as an ArchLang plan, and check it."
  • claude.ai, no install: add https://mcp.archlang.uk/mcp as a custom connector (the steps)
  • Coding agent: claude mcp add --transport http archlang https://mcp.archlang.uk/mcp; locally, claude mcp add archlang -- npx -y @chanmeng666/archlang-mcp; skills, npx -y skills add ChanMeng666/archlang --yes (skills.sh)
  • VS Code: Marketplace or Open VSX
  • Playground, in the browser: https://playground.archlang.uk

Same source, plan and 3D preview. The 3D preview is extruded from the same .arch file by the separate archlang-3d package, and checked against the plan: every 3D element comes from the plan's elements, and every solid is closed. What the 3D preview shows →

3D preview: walls, openings, floors, stairs and furniture in flat colours; no pitched roofs yet, and no sections, elevations or BIM.

If your agent has a shell

ArchLang's primary agent interface is the agent-native archlang CLI, not this server. A CLI costs nothing in an agent's context window until it is called, whereas an MCP tool schema sits in the window permanently. If your agent already has a shell, prefer:

bash
npx -y @chanmeng666/archlang context     # the whole language + workflow + CLI + errors, one callnpx -y @chanmeng666/archlang compile plan.arch -o out.svg --json

After npm i -g @chanmeng666/archlang the same calls are archlang context and archlang compile …. The package also installs an arch alias, but on Linux, macOS and Git Bash coreutils ships its own arch, so a bare arch there runs the wrong program.

This MCP server exists so MCP-native hosts can discover ArchLang through the registry and drive it without a shell. It is listed on the official MCP registry as io.github.ChanMeng666/archlang-mcp. It is the discoverability channel, not a replacement. See ADR 0012 (which amends ADR 0009's distribution-over-protocol stance).

Server instructions

At initialize the server sends a short instructions string, which hosts that support it add to the model's context: read the archlang://spec resource first, then write .arch → compile (and fix) → describe → validate with strict:true → finish before export. It is SKILL.md's loop, condensed, and a test holds the commands it names to the CLI manifest and to that loop's order.

Tools

Every tool takes ArchLang source (a plan "…" { … } string) and returns structured JSON. compile also accepts plan_json (the Plan-JSON / RPLAN shape). Every result of a call that passed source ends with source_hash, the SHA-256 (hex) of that input's UTF-8 bytes; repair, fix and finish, which return a rewritten source, add output_hash, the SHA-256 of exactly that returned text. The tools write no files. The hashes are for the CLI's --expected-hash, which refuses to rewrite a file whose bytes no longer hash to the value given (E_STALE_SOURCE): write the returned source to the file, then pass its output_hash. For a file that is valid UTF-8 and holds the text unchanged (a BOM and CRLF line ends included) the MCP hash and the CLI's agree.

ToolWhat it does
compileRender source (or plan_json) to SVG, or to zero-dep ASCII (format:"txt"), Plan JSON as an object (format:"json", the shape plan_json takes) or a PNG image (format:"png", at archlang preview's width unless width overrides it, within a clamped range; needs the optional @resvg/resvg-js, which the .mcpb bundle leaves out). accessible, overlay:"circulation" opt-ins. Returns output + diagnostics. A multi-storey plan returns every storey in pages[]; level renders one.
describeSemantic facts (rooms, areas, adjacency, doors, circulation, zones, storeys, the exact floor_polygon/floor_circle shape, and a freedom report of which positions are hand-authored vs resolver-derived) — verify intent without an image.
lintAdvisory W_* soundness warnings (may include the fix-carrying W_ALIAS_MATCH for a room use inferred from an indirect label alias); profile selects a ruleset.
validateParse + resolve + lint, the ship gate. strict fails on warnings; graph checks interior-door adjacency against an intended room graph; intent gates on a brief's contract (per archlang://intent-schema).
scoreThe continuous intent METER: how much of a brief a plan satisfies (satisfied/total/score/subscores). Measures, never gates.
repairExplicit corrector: furniture out of walls/doorways/swings → new .arch source + change log. Never adds doors/windows.
finishComplete the drawing: furnish the rooms that hold no furniture, then add the missing paper, scale, dims auto, title, schedule rooms and legend → new .arch source + change log. Fills only what is missing; only runs one stage (furnish or sheet); reissue may replace paper/scale.
fixApply the machine-applicable fixes on a plan's diagnostics (syntactic corrector; bounded fixpoint). unsafe widens to maybe-incorrect.
suggestAdvisory door/window statements (each referencing its wall by a stable ref — an authored id or a unique category — or absolute coordinates, never a re-bindable positional id) to resolve unreachable rooms / windowless bedrooms — data, never applied.
completeLSP completion items in scope at a source byte offset.
linkTwo URLs that show the plan in a browser with nothing to install: playground (the hosted editor, rendered) and embed (the plan alone, for an iframe), plus bytes, the compressed plan's size, and ok (with an errors count when the plan does not compile; it still links and the page shows the diagnostics). The plan rides in the URL fragment. Needs a core that exports ./link; an older one gets ok:false and the version it needs.

What compile's accessible does here — and what it does not

accessible: true gives the SVG its <title>/<desc> pair and role="img" on the root, which is the whole of the option as this shim exposes it. The v1.36 element controls are not reachable through MCP. They need annotate alongside accessible, and this tool passes annotate only for format:"txt"; it also takes accessible as a boolean, so the { idPrefix } form that keeps several plans on one HTML page from sharing arch-title/arch-desc cannot be requested either.

A host that needs a keyboard- and screen-reader-operable drawing — data-arch-primary, role="button", aria-label on each element — has to call the library. The CLI cannot produce it either: annotate has no flag, so archlang compile --accessible stops at the <title>/<desc> pair too.

ts
import { compile } from "@chanmeng666/archlang";compile(src, { annotate: true, accessible: { idPrefix: "plan-7" } });

The output contract, what an embedder still owns, and the known screen-reader limitations are in the language reference.

Resources

URIContent
archlang://specThe whole language in one page (spec.llm.md).
archlang://contextFull agent context: spec + workflow + CLI reference + error catalog (llms-full.txt).
archlang://schemaJSON Schema (2020-12) for the Plan-JSON compile input.
archlang://grammarGBNF constrained-decoding grammar for guaranteed-parseable generation.
archlang://intent-schemaJSON Schema (2020-12) for a brief's Intent — the shape validate's intent and score's brief take.

Install

Claude Code

bash
claude mcp add archlang -- npx -y @chanmeng666/archlang-mcp

Claude Desktop

Add to claude_desktop_config.json (Settings → Developer → Edit Config):

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

Cursor

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

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

VS Code

Add to .vscode/mcp.json:

json
{  "servers": {    "archlang": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@chanmeng666/archlang-mcp"]    }  }}

License

MIT © Chan Meng

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

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

21
  1. v0.2.40最新Nov 7, 2026
  2. v0.2.39Nov 6, 2026
  3. v0.2.38Nov 5, 2026
  4. v0.2.37Nov 4, 2026
  5. v0.2.36Nov 3, 2026
  6. v0.2.33Nov 1, 2026
  7. v0.2.32Oct 31, 2026
  8. v0.2.31Oct 31, 2026
  9. v0.2.30Oct 31, 2026
  10. v0.2.29Oct 29, 2026
  11. v0.2.26Oct 16, 2026
  12. v0.2.25Oct 14, 2026
  13. v0.2.24Oct 9, 2026
  14. v0.2.23Oct 9, 2026
  15. v0.2.22Oct 6, 2026
  16. v0.2.21Oct 5, 2026
  17. v0.2.20Oct 2, 2026
  18. v0.2.19Oct 2, 2026
  19. v0.2.18Sep 30, 2026
  20. v0.2.17Sep 30, 2026
  21. v0.2.16Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分