Skip to main content
Glama

Floor plans as code.

ArchLang is an open-source (MIT) DSL for floor plans that compiles .arch source to SVG/DXF/PDF with linting and geometric validation — diffable, reproducible, and LLM-writable.

Try it

Just looking? Open the playground — no install.

Your coding agent: paste this prompt.

1. Run: npx -y skills add ChanMeng666/archlang --yes
2. Run: npx -y @chanmeng666/archlang spec   (read it before writing anything)
3. Write my floor plan as plan.arch from this brief: <describe rooms, areas, adjacencies>
4. Run: npx -y @chanmeng666/archlang compile plan.arch -o plan.svg --json
   then describe plan.arch --json, validate plan.arch --strict --json (same prefix); fix, recompile
5. Run: npx -y @chanmeng666/archlang finish plan.arch, then compile again to export.
Starting from a photo or PDF? Read https://archlang.uk/from-an-image. To change one room without moving the others, use `impact --lock` (https://archlang.uk/edit-one-room).

Or add the MCP server: claude mcp add --transport http archlang https://mcp.archlang.uk/mcp (locally, claude mcp add archlang -- npx -y @chanmeng666/archlang-mcp). The skills are listed on skills.sh.

Related MCP server: Skopia

What you get

Each drawing is compiled from a file in examples/. Click a plan to open its source in the playground, then change a number and watch it redraw; click a 3D preview to open it on the 3D view.

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 → · Try it in 3D →

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

More plans from examples/:

Why text

  • Exact. Areas and reachability are computed, not estimated; the same text gives the same drawing, byte for byte.

  • Change one line, see what moved. Edit a number and just what depends on it moves; impact --lock proves the rest didn't.

  • It checks itself. An unreachable room or an opening off its wall comes back as a message with a code and a fix your AI can apply; checks other than reachability and area are advisory. The checks → · Error codes →

What writing it as a language gives you. Rooms, walls, doors and windows have names, so the compiler can measure each room and check how the rooms connect; some mistakes come back as a message with a code that points at the exact place in the text, often with a fix (other checks are advisory); the same text gives the same bytes every time, and impact shows which parts of the drawing a change moved. More →

Limits: plan drawings in the core; no BIM or IFC, not permit drawings; it does not read images; clearances are advisory. The 3D preview's limits, as the line under the plan pairs above says: "3D preview: walls, openings, floors, stairs and furniture in flat colours; no pitched roofs yet, and no sections, elevations or BIM."

Starting from a photo? archlang.uk/from-an-image · Change one room? archlang.uk/edit-one-room

For your agent

This page is all a person needs. Everything else is written for agents: clone the repo and point yours at AGENTS.md, or give it the whole language in one call:

npx -y @chanmeng666/archlang context

MCP clients: archlang.uk/mcp · Agents: archlang.uk/agents · Full overview · Language reference

Local MCP server: Install in VS Code · Install in VS Code Insiders. Hosted MCP server: Install in VS Code · Install in VS Code Insiders. Install in Cursor: the links on archlang.uk/mcp.

https://github.com/user-attachments/assets/879a4b71-415e-4848-a4af-db9c879d6a71

Watch the full film on YouTube (3:16)

What's new →

Release notes (installed: node_modules/@chanmeng666/archlang/CHANGELOG.md) · Contributing · MIT

ArchCanvas is a hosted app built on ArchLang. Maintained by Chan Meng, a single maintainer; written with AI coding agents and checked in CI. Governance.

Available Tools

11 tools
compileCompile a floor plan to a drawingA
Read-onlyIdempotent
Inspect

Compile ArchLang .arch source (or a Plan-JSON object) to an SVG floor plan, or with format to a plain-text ASCII plan ("txt"), Plan JSON ("json") or an image ("png"). Format "json" returns the plan as an object, with schema naming its JSON Schema; passed back as plan_json it compiles to the same drawing, unless the plan uses a part of the language Plan JSON does not carry (sheet tables, styles, circular rooms, roofs, storeys, place, accessibility metadata). Returns the output plus diagnostics; a diagnostic usually carries a byte span with line/col and an E_/W_ code, and often a fix, sometimes one the fix tool can apply. Errors come back as data, never as exceptions: read diagnostics and correct the source. A multi-storey plan (level <n> { … }) returns the lowest storey in output and every storey in pages[] ({ level, name, output }); pass level to render just one. format "png" returns the usual result as text, then the drawing (the lowest storey, or level) as image content, as wide as width says; it needs the optional renderer @resvg/resvg-js, and without it the call returns ok:false with an error saying how to install it.

Inputs: level, width, format, source, +3 more.

completeCompletions at a source offsetA
Read-onlyIdempotent
Inspect

List the completion items in scope at a source byte offset: keywords, element names, ids and enum values, the same items an editor's language server offers. For structured or assisted authoring.

Inputs: at (required), source (required).

describeDescribe a plan (facts, no render)A
Read-onlyIdempotent
Inspect

Report a plan's facts without rendering, so you can check it against the brief without looking at an image. Returns rooms (area, bbox, adjacency, use, and the exact shape: floor_polygon for a room polygon, floor_circle for a room circle, whose area is exactly πR²), doors (what each connects), windows, circulation (walk distance, bottleneck width, detour), zones, storeys (levels[i] carries the same facts per floor) with the shafts that join them and which storeys stay reachable (vertical), the drawing extent (bbox, bbox_outer), freedom (which positions are hand-authored and which are derived), and totals.

Inputs: source (required).

finishFinish the drawingA
Read-onlyIdempotent
Inspect

Complete a plan for export by adding what it lacks; run it once lint is clean. Two stages. furnish puts furniture, by room use, in each rectangular room that holds none, on every storey (a furnished room is never touched, and one that lacks a piece its use requires is named in unresolved with the missing pieces, not filled; placement is against wall / in <room> anchor, never absolute). sheet adds the sheet statements the plan lacks (paper, scale, dims auto, title, schedule rooms, legend), choosing the finest standard scale on the smallest sheet that holds the drawing. It fills only what is missing and deletes nothing; only runs one stage; reissue:true may replace paper/scale (only those) when the drawing does not fit them. Returns { ok, changed, changes, unresolved, source }; a plan that does not compile comes back untouched with ok:false, and every room left empty (its use has no furniture row or is unknown, or furnishing it would raise a new diagnostic) and every sheet statement left out is named in unresolved with the reason; a note with scope set (outside-table) asks nothing of you unless that room should hold furniture.

Inputs: source (required), only, reissue.

fixApply machine-applicable diagnostic fixesA
Read-onlyIdempotent
Inspect

Apply the machine-applicable fixes attached to a plan's compile diagnostics and return the edited source. It corrects source-level faults (an opening off its wall becomes the attachment form, an out-of-range position is clamped, …); furniture geometry is repair's job. It runs at most 4 passes and rolls back a pass that raises the error count. unsafe:true also applies maybe-incorrect fixes. Returns { ok, passes, applied, skipped, source }.

Inputs: source (required), unsafe.

lintLint architectural soundnessA
Read-onlyIdempotent
Inspect

List advisory architectural-soundness warnings (W_* codes) as data: unreachable room, windowless bedroom, too-narrow door, blocked doorway, furniture through a wall, circuitous path, and more. profile selects a ruleset ("residential-basic", "accessibility-advisory", …).

Inputs: source (required), profile.

repairRepair furniture placementA
Read-onlyIdempotent
Inspect

Correct furniture placement and return the corrected .arch source with a change log. It pushes furniture out of walls, doorways and door swings, separates overlapping pieces, moves fixtures that sit in the wrong room, and snaps floating pieces to walls. A piece it may not rewrite is listed in unresolved with the reason. It never adds doors or windows (that is a design choice); use suggest for those.

Inputs: source (required).

scoreScore a plan against a brief (intent meter)A
Read-onlyIdempotent
Inspect

Measure how much of a brief's intent JSON a plan satisfies, without gating. Returns { ok, satisfied, total, score, subscores, violations }, where score is satisfied/total in [0,1] (an empty intent scores 1); call it across edits to watch a plan approach the brief. The intent's shape is the archlang://intent-schema resource. A malformed intent returns { ok:false, intentErrors } as data, never an exception.

Inputs: brief (required), source (required).

suggestSuggest topology fixes (advisory)A
Read-onlyIdempotent
Inspect

Suggest the doors and windows a plan's room graph needs, as data; nothing is applied. For a room with no path back, a building with no entrance, a bath reachable only through a bedroom, or a windowless bedroom, it returns ready-to-paste door/window statements with a rationale, for you to choose among and insert. Each names its wall by an authored id or a unique wall category, else by absolute at (x, y) coordinates. Door candidates avoid furniture in the door's approach; window candidates do not consider furniture.

Inputs: source (required).

validateValidate (parse + resolve + lint)A
Read-onlyIdempotent
Inspect

Check a plan in one pass without returning a drawing (parse, resolve and lint): the gate a plan passes before it ships. strict:true makes advisory warnings fail too. Optional graph checks the plan's interior-door adjacency against an intended room graph ({ room: [neighbours] }); a mismatch fails. Optional intent (a brief's expectations, shaped as the archlang://intent-schema resource describes) is checked against the plan: a missed gating assertion (room count, existence, area, total area, windows) fails, while adjacency and reachability are advisory and only score. A malformed intent returns { ok:false, intentErrors } as data, never an exception. Returns { ok, diagnostics, graph?, intent? }.

Inputs: source (required), graph, intent, strict.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, but a few pairs require careful reading: fix vs repair both edit source, lint vs validate both report diagnostics, and score vs validate both check intent. The descriptions explicitly delineate these boundaries, so misselection is unlikely but not impossible.

    Naming Consistency5/5

    All tool names are single lowercase imperative verbs with no mixed conventions or underscores. The pattern is predictable throughout the set.

    Tool Count5/5

    Eleven tools is well within the appropriate range for a language tooling server covering authoring, validation, repair, finishing, and sharing. Each tool appears to earn its place without obvious redundancy.

    Completeness4/5

    The surface covers the full lifecycle: completion, compile, validate, lint, fix, repair, suggest, finish, describe, score, and link. Minor gaps like a dedicated format/explain tool are not critical, as compile and diagnostics cover those needs.

    Maintenance

    ActivityActive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables an AI assistant to conversationally control Autodesk AutoCAD, drawing, inspecting, and editing plans, and includes a cross-platform DXF engine that runs without AutoCAD on macOS and Linux. It exposes tools for rendering views as images, batching geometry, blocks, and structures, measuring and checking plans, and undoing whole batches.
      12
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Floor plans, elevations and sections for agents. Draw a room in real millimetres, place doors, windows and tables, validate with typed errors, render deterministic SVG. Free key, no approval.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to automate 2D architectural drafting and CAD file management, including DXF/DWG parsing, SVG/PNG/PDF rendering, wall extrusion to 3D STL meshes, room and beam analysis, block/script library access, and persistent depot storage via a REST API and MCP tools.
      18
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to drive a live AutoCAD session over stdio with transactional, serialized writes: inspecting and saving documents, managing layers, creating and editing line/circle/arc/polyline/rectangle/text entities, querying selections, setting checkpoints, and exporting DXF. Every request is validated against strict schemas with document revision checks and save-reopen geometry readback, and a headless backend is available when no AutoCAD instance is running.
      MIT