Compile, describe, lint, validate, repair and fix ArchLang floor plans (.arch to SVG) over stdio.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
[!IMPORTANT]
π€ Read this with your AI agent β don't read it by hand.
This repo is written agent-first. Point Claude Code, GitHub Copilot, Cursor, or any agent at it: "Read the README and AGENTS.md, then help me run / extend this." Structure +
AGENTS.mdare optimized for agent comprehension.
Text in, a precise architectural drawing out. Deterministic, zero-dependency, and built so an AI agent can verify its own plan without ever looking at an image.
βΆ Live Playground Β· π Docs Β· β¨ CLI reference Β· π¦ npm Β· π§© VS Code
Here is a whole program, and below it the actual drawing it compiles to β not a mock-up. Walls join and hatch themselves, the door draws its own swing arc, the window draws its glazing, and the furniture is placed by anchor, never by hand-computed coordinates.
β arch compile attached.arch β that program, rendered. Nothing above places a wall corner,
a door leaf or a sofa by hand.
βΆ Click the drawing β it opens the live playground with this exact plan already loaded. Change a number and watch it redraw; the compiler runs in your browser, nothing is sent to a server.
Why a link and not a live embed? ArchLang does ship an embeddable viewer β but GitHub's markdown sanitizer strips
<iframe>(it comes back as escaped text, exactly like<script>), so no README on GitHub can host one. The embed works everywhere GitHub isn't: see Embed a plan anywhere. Source:examples/attached.arch.
ArchLang is a small declarative language for floor plans. You declare a plan β walls, rooms, doors, windows, furniture β and the compiler renders a clean, professional SVG (also DXF, PDF, PNG, and a zero-dependency ASCII plan).
Coordinates are integer millimetres, so output is deterministic: the same source always produces byte-identical bytes, and changing one number changes exactly one thing. "Make the bedroom 1 m wider" is a one-number diff β not a re-roll of a raster image that silently redraws the kitchen too.
The compiler is pure TypeScript with zero runtime dependencies and is isomorphic β the same code runs in Node and in the browser, which is why the playground is fully client-side.
ArchLang is the floor-plan engine behind ArchCanvas, an AI design agent β but it stands alone and is useful in any app or script.
Most "AI floor plan" tools generate a picture. A picture cannot be checked, diffed, or reasoned about β and neither the model nor you can tell whether the bathroom is actually reachable.
ArchLang generates a program, and then lets you interrogate it as facts:
| Raster image generation | ArchLang | |
|---|---|---|
| Output | pixels | a .arch program β SVG / DXF / PDF / PNG / TXT |
| Edit "widen the bedroom" | re-roll the whole image | change one number |
| Same input twice | different image | byte-identical output |
| "Is the bath reachable?" | look at it and guess | arch describe --json β access graph |
| "Does it match the brief?" | eyeball it | arch validate --intent β exit code |
| Wrong syntax | β | errors returned as data, each carrying its own fix |
That last row is the whole design: compile() never throws. It returns diagnostics with byte
spans and a machine-applicable fix, which is what makes a tight self-correction loop possible.
An agent can author a plan, correct itself, and confirm the plan matches the brief without rendering an image at all β which is what makes ArchLang cheap to drive from a text-only model.
Cold start in one command. arch context prints the entire agent context β language spec,
workflow skill, CLI reference and every diagnostic code β as one system-prompt-ready document (the
same llms-full.txt the docs site serves).
Every command takes --json (result on stdout, messages on stderr) with deterministic exit codes
(0 ok Β· 2 user-source error Β· 1 IO Β· 3 usage) β and a typo earns that 3: arch lint --jsn exits 3 with did you mean --json? rather than quietly reading --jsn as a filename, and
arch comple suggests compile.
One manifest, no drift. The per-command help (arch <cmd> --help), the flag parser, and the
generated CLI reference are all rendered from the same
manifest β which is why they cannot advertise a flag a command doesn't take. arch manifest --json
is that manifest as data, and arch <cmd> --help is the cheap way to read one row of it.
Reads are bounded, so a big plan can't flood a context window: describe --select/--room,
lint|validate --code/--severity, context --section. Filtering what you read never changes
what gates β the exit code always weighs every diagnostic. And because arch fix rewrites your
source, it prints the unified diff first and takes --backup.
See SKILL.md.
| Artifact | Use |
|---|---|
/plan.schema.json | Emit structured JSON, compile it with arch compile --from-json |
/archlang.gbnf | Constrain a local model to parseable output |
/intent.schema.json | Write the brief down as a contract; gate on it with validate --intent |
/llms-full.txt | The whole context bundle (arch context) |
MCP server (optional). @chanmeng666/archlang-mcp is a stdio Model Context
Protocol shim over the library, listed on the official registry as io.github.ChanMeng666/archlang-mcp:
Prefer the CLI when your agent has a shell β a CLI costs nothing in the context window until it is called, whereas an MCP tool schema sits there permanently. The server exists so MCP-native hosts can discover ArchLang. The core stays zero-dependency; the SDK lives only in that package (ADR 0012).
In CI: .github/actions/arch-render renders every ```arch
fence in your Markdown to images in one step.
PochΓ©-hatched walls (by material), door swing arcs, window glazing, computed room areas,
dimension lines, layers, line weights, a north arrow, a scale bar and a title block. Real fixture
symbols for WC, basin, shower, bathtub, sink, counter, fridge and stove β plus dims auto to
synthesize dimension strings for you.
arch lint encodes tacit professional knowledge: a bathroom reachable only through a bedroom, a
wet room that isn't fully walled in, a door whose swing hits furniture or another door, a windowless
bedroom, an unenterable room, a too-narrow door, a bath/kitchen with no fixtures, and a room whose use
was merely inferred from an indirect label (W_ALIAS_MATCH β with a fix that pins the explicit
uses). All tunable via the ruleset.
arch describe runs a clearance-eroded nav grid: per-room walk distance, the narrowest pinch on
the way in, and how circuitous the route is β with advisory lint for a too-tight
(W_PATH_TOO_NARROW) or roundabout (W_CIRCUITOUS_PATH) walk, and an opt-in
arch compile --overlay circulation that draws the routes on top of the plan.
Facts and advice β never an invisible auto-arranger (ADR 0005).
arch repair is the one explicit corrector: it pushes furniture out of walls, doorways and swing
arcs, and emits a change log you review.
compile() never throws on bad source β it returns diagnostics with byte spans, a catalogued
E_*/W_* code, and a fix. Where the edit is mechanical, the diagnostic also carries applicable
fixes that arch fix applies for you. --error-svg even turns a plan that won't compile into a
self-describing error card an agent can look at.
Values, arithmetic, arrays, for/if/while and pure functions β plus relational placement
(right-of / below / β¦) and room strips, resolved by deterministic topological arithmetic, not
an optimizer. All of it expands at compile time: no runtime, no clock, no I/O. Optional metric unit
suffixes (4m / 40cm / 20mm) fold exactly to millimetres at lex time.
SVG, DXF and a TXT ASCII plan with zero dependencies; PDF (vector, selectable text)
and PNG (deterministic raster) via optional, lazily-loaded add-ons the default install never
pulls. arch compile --accessible stamps the SVG with <title>/<desc> + role="img".
A full LSP (hover, completion, go-to-definition, rename, signature help), an arch fmt
formatter, an arch explain <CODE> catalog, a self-documenting CLI (arch <cmd> --help, rendered
from the manifest, worked examples included), and a
VS Code extension.
Or install it:
As a library (zero dependencies, runs in Node and the browser):
Also exported, all pure: describe() (facts), lint() (soundness), validateIntent() +
projectSubscores() (does it match the brief?), repair(), applyFixes(), suggestTopology(),
renderAscii(), toDxf(), and the LSP core (completion, hover, β¦).
Every one of these is a real, compiled example from examples/ β click through to the
source.
|
studio The flagship: fitted kitchen & bath, enclosed bath off a central hall. Lint-clean. |
two-bed A larger plan: central corridor, multiple rooms and openings. |
attached No hand-computed coordinates: strips, on-wall openings, anchors. |
Also in examples/: parametric (a for loop that generates units), themed (a custom
theme + brick hatch), relational (right-of / below), and accessible (accTitle/accDescr).
The docs gallery renders all of them live and
editable in the browser.
ArchLang is a compiler pipeline. Source text becomes a backend-neutral Scene IR, and every backend is a pure serializer of that scene β which is why adding a format never touches the language.
The dotted branch is the point: describe, lint and the intent check read the same resolved
plan the renderer does β so what an agent verifies is exactly what gets drawn, and it costs no
pixels to check.
compile() is pure, synchronous and deterministic β no I/O, no Date.now(), no Math.random().
The only place Node APIs are allowed is the CLI; everything else gets its environment through a
World seam. See AGENTS.md and the ADRs.
| Package / surface | What it is |
|---|---|
@chanmeng666/archlang | The core: compiler, CLI, analysis. Zero runtime deps, isomorphic. |
@chanmeng666/archlang-mcp | Optional stdio MCP server (the SDK is quarantined here). |
| VS Code extension | Syntax + live diagnostics, hover, completion, rename. |
| Playground | Client-side editor: preview, describe, lint, intent scoring, apply-fix, embed. |
| Docs site | Guide, reference, CLI reference, ADRs, live examples. |
| π€ Dataset | Synthetic, self-verifying repair trajectories + authoring pairs. CC0. |
| GitHub Action | Render ```arch fences in any repo's Markdown. |
A live, editable plan in any blog, wiki or docs page β one <iframe>, no build step, nothing
sent to a server (the source rides in the compressed #z= hash, so the page is self-contained):
The playground's Embed button generates the snippet. Optional params: editable=1 (show a
compact editor that re-renders as you type) and theme=blueprint|dark|mono|presentation.
Not on GitHub, though. GitHub's markdown sanitizer strips
<iframe>β it renders as escaped text, the same way<script>does β so a README (here or anywhere on github.com) cannot host a live embed, no matter how it's written. The honest substitutes GitHub does allow are what this README uses: a static SVG the compiler really produced, linked to a playground permalink that opens the same plan live. On the docs site, where the sanitizer doesn't apply, every plan is live and editable in place.
```arch fence on a docs page is itself an editable plan.arch spec.spec β compile β fix β describe β validate loop.Contributions are welcome! Please read the Contributing Guide and our Code of Conduct. Use the issue and pull-request templates when you open one.
Released under the MIT license.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/archlang-mcp)<a href="https://allmcps.com/mcp/archlang-mcp"><img src="https://allmcps.com/api/badge/archlang-mcp?style=directory" alt="Archlang Mcp on AllMCPs" /></a>