Skip to main content
Glama
warehouse-cad-agent

warehouse-cad-agent

Warehouse CAD for Codex

This repository is one Windows-first distribution for a Codex plugin and its deterministic warehouse CAD engine.

free Chinese <-> Codex (understand, ask, decide)
                   -> CadProgram
                   -> warehouse_cad_program (the only MCP tool)
                   -> deterministic engine
                   -> managed CAD work copy

Codex is the only natural-language Agent. The plugin does not contain another chatbot, language parser, model runtime, or rule-based Chinese command interpreter. Users talk to Codex; Codex preserves the exact turns, asks for missing facts, previews an inspectable CadProgram, and calls the one tool. The engine validates and executes that program. It never guesses missing dimensions, height, equipment identity, or source evidence.

v0.3.0rc1 verification boundary

This release candidate separates two claims that must not be confused:

  • Verified without AutoCAD: one irregular synthetic Chinese request reaches a real Codex CLI, becomes a provenance-bound program, passes deterministic equipment-fact validation, and enters the registered equipment.create_2d CAD-facing plan boundary. Incomplete and blank inputs fail closed. The check runs from two independent clean checkouts and installed-wheel runtimes.

  • Deferred until AutoCAD is available: CAD execute, an actual DWG change, editable 2D, height-driven 3D, source/final overlay, save, fresh reopen, and customer-drawing coverage.

The accepted plan explicitly reports mutates_cad=true and cad_call_made=false. It proves the integration and product calling form only; it is not drawing evidence. See the RC release notes and the no-AutoCAD input template.

Related MCP server: cad-agent-foundation

Requirements

  • Windows and CPython 3.11 x86-64.

  • Codex CLI or Codex in the ChatGPT desktop app.

  • Git and a clean checkout at an immutable commit.

  • ODA File Converter for DWG/DXF conversion.

  • AutoCAD Core Console for operations that create or verify native DWG entities.

  • A Chinese font such as Microsoft YaHei or SimSun for Chinese CAD text.

The repository pins public Python dependencies and hashes in requirements.lock. Editable installs are deliberately unsupported for the product runtime.

Install from a clone

From the repository root in PowerShell:

.\scripts\bootstrap.ps1
codex plugin marketplace add .
codex plugin add warehouse-cad-agent@warehouse-cad-agent
codex plugin list

The first command builds both local wheels, creates an isolated runtime, installs hash-locked dependencies, and writes a marker bound to the Git commit, tracked-source fingerprint, Python version, dependency lock, and both wheel hashes. The launcher fails closed if any binding changes; it never falls back to a system package, editable source tree, or an older plugin cache.

For an isolated runtime location:

.\scripts\bootstrap.ps1 -RuntimeRoot C:\path\to\empty-runtime-root

Restart Codex after installing or updating the plugin so a new thread discovers the Skill and MCP server. Local marketplace and plugin commands follow the official Codex plugin packaging guide. Project-scoped or personal MCP configuration is described in the official Codex MCP guide.

Use

Open Codex in the clone and invoke $warehouse-cad-agent. Give the source drawing and speak normally in Chinese. For example:

先把这张图里的物流设备都去掉,建筑和通道这些结构保留。右边空着那块帮我画一台输送机,大概从这个角点往东,长六米宽一米二;高度我等会儿再给你。

Codex must ask when “这个角点”, direction, unit, device identity, or any other required fact is not resolvable. In v0.3.0rc1, the no-AutoCAD release gate stops at an accepted, unexecuted equipment.create_2d plan; it does not produce visible CAD. After an AutoCAD-dependent final-artifact gate is available and passes, the intended next stages are editable 2D in a managed work copy, a same-window comparison, and only then a later height turn such as “就刚才那台,高度两米四,做成立体的”. Devices without a supplied height must remain 2D.

The user is never asked to handwrite JSON. CadProgram is an internal, inspectable boundary generated by Codex. Each adopted value is bound to the exact user turn, SHA-256, and character span.

Read-only diagnosis

After bootstrap, use warehouse-cad-agent doctor inside the runtime reported by the bootstrap receipt. Doctor checks package identity, Codex availability, ODA, AutoCAD Core Console, Chinese fonts, and runtime writability without editing CAD.

Evidence boundary

A successful handshake, a valid program, a JSON receipt, a wheel, or a screenshot alone is not proof that the requested CAD changed. A final capability claim requires the source-bound program chain, actual saved CAD, fresh reopen/readback, zero-pollution failure checks, and—when correspondence to a source view is claimed—a same-camera source/final/overlay using the actual final CAD.

Customer drawings, their coordinates and text, natural-language replay inputs, oracles, screenshots, and generated results must stay outside the public repository.

Development checks

Development tooling is separate from the product runtime:

py -3.11 -m pip install pytest ruff
py -3.11 -m ruff check .
py -3.11 -m pytest packages\cad-to-layout-engine\tests plugins\warehouse-cad-agent\tests

See architecture, product boundary, the Chinese quickstart, and the isolated Codex reproduction guide.

Available Tools

5 tools
warehouse_cad_editA
Destructive

Apply a bounded, traceable edit to the active managed AutoCAD work copy. Deletion is limited to provably agent-owned entities; source-backed text updates require provenance.

Inputs: action (required), params.

warehouse_cad_exportB

Export the managed work copy or build a native 3DSOLID DWG. All paths remain under the authorized root; native solids require source-verified footprint, height, and elevation.

Inputs: action (required), params, project_file.

warehouse_cad_queryB
Read-only

List, inspect, highlight, measure, or compare entities in the active managed AutoCAD work copy. Geometry measurements remain calculations, not verified business facts.

Inputs: action (required), params.

warehouse_cad_sessionC

Connect to writable full AutoCAD and manage exactly one automatically-created work copy. Never opens the customer source as a write target; TrueView is rejected. Shutdown can quit only a document-free AutoCAD instance launched by this Agent.

Inputs: action (required), params, project_file.

warehouse_projectC

Validate, audit, rebuild, verify, package, or control one declared warehouse CAD project. Long jobs are single-worker and return job_id. Audit output is not an independent acceptance denominator by itself.

Inputs: action (required), job_id, params, project_file.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct level: project management, session management, querying, editing, and exporting. No two tools overlap in purpose, making selection unambiguous.

    Naming Consistency4/5

    All tools share the 'warehouse_' prefix, and four of five follow the 'warehouse_cad_' pattern. The sole exception, 'warehouse_project', still fits the broad naming scheme but lacks the 'cad_' segment, a minor inconsistency.

    Tool Count5/5

    With only 5 tools, the set is tightly focused and each tool covers a major capability area. This is an ideal scope for a CAD agent, avoiding bloat while remaining useful.

    Completeness4/5

    The tools cover the full workflow from project validation/rebuild, session control, query, edit, to export. Minor gaps exist (e.g., no explicit import or undo), but the core lifecycle is well supported.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to interact with CAD software through semantic spatial topology and architectural ontology, supporting drawing, block/layer/entity management, and safe preview-apply transaction workflows for AutoCAD, ZWCAD, GstarCAD, and BricsCAD.
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to inspect and operate a live AutoCAD drawing through bounded native 2D geometry, text, hatch, dimension, and callout operations, with drawing binding, original-request reconciliation, and write/save verification.
      Apache 2.0
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables users to create and manage workspace-scoped CAD contracts, build and validate STEP-backed geometry, generate technical drawings and proof renders, audit models, and sample motion through bounded MCP tools.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to create, inspect, and modify DXF and native DWG drawings through 101 cad_* tools, including layers, blocks, DWG title frames, layout viewports, page setups, and PDF plotting. DXF workflows run without AutoCAD, while DWG, print-resource, and field-linked operations require a locally running AutoCAD instance on Windows.
      MIT