
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.
概览
让助手编写 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 打包版本不包含它。
安装
在 SourceWeft 中
- 打开 控制台中的 Archlang Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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/mcpas 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:
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.
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.
The output contract, what an embedder still owns, and the known screen-reader limitations are in the language reference.
Resources
Install
Claude Code
Claude Desktop
Add to claude_desktop_config.json (Settings → Developer → Edit Config):
Cursor
Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):
VS Code
Add to .vscode/mcp.json:
License
MIT © Chan Meng
来源:packages/mcp/README.md,提交 da3ed37
工具
0版本历史
21- v0.2.40最新Nov 7, 2026
- v0.2.39Nov 6, 2026
- v0.2.38Nov 5, 2026
- v0.2.37Nov 4, 2026
- v0.2.36Nov 3, 2026
- v0.2.33Nov 1, 2026
- v0.2.32Oct 31, 2026
- v0.2.31Oct 31, 2026
- v0.2.30Oct 31, 2026
- v0.2.29Oct 29, 2026
- v0.2.26Oct 16, 2026
- v0.2.25Oct 14, 2026
- v0.2.24Oct 9, 2026
- v0.2.23Oct 9, 2026
- v0.2.22Oct 6, 2026
- v0.2.21Oct 5, 2026
- v0.2.20Oct 2, 2026
- v0.2.19Oct 2, 2026
- v0.2.18Sep 30, 2026
- v0.2.17Sep 30, 2026
- v0.2.16Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分