kjdraw
Health Pass
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 13 GitHub stars
Code Warn
- process.env — Environment variable access in .github/workflows/release-provenance.yml
- network request — Outbound network request in apps/playground/agent-chat.js
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
The open-source CAD engine for AI agents. Structured drawings with stable object ids, transactional edits, and DXF/KJD output. TypeScript + Rust/WASM.
The open-source engineering drawing harness for AI agents.
Build engineering drawing workflows with high-level compilers, stable object identity, transactional editing, and one runtime across browsers, Node.js, CLI, and MCP.
Quick start · Try with AI · Live editor · Docs · 简体中文
What is KJDraw?
KJDraw is an open-source TypeScript CAD engine and agent runtime for building
engineering drawing workflows into your own product. It gives applications and AI
agents one consistent way to create, inspect, edit, validate, preview and deliver
structured drawings without reducing the result to a screenshot or an opaque blob.
Use KJDraw when you need to:
- give an AI agent bounded, high-level CAD tools instead of asking it to emit hundreds of coordinates;
- embed an editable CAD workbench in a browser, React or Vue application;
- inspect existing drawings through stable object IDs, layers, references and spatial queries;
- compile supported engineering intent into native entities with deterministic geometry;
- verify a result through diagnostics, Undo/Redo, KJD/DXF reopen and rendered SVG evidence;
- keep drawings and model credentials local to the user's environment.
KJDraw is not an image generator and it is not a collection of frozen templates. It
is the execution layer between engineering intent and a reviewable CAD deliverable.
Quick start
From an AI agent
KJDraw ships an MCP server, so any MCP-compatible client can call the same CAD
tools. The installer configures KJDraw once at the user level for Kimi Code, WorkBuddy
and ZCode; TraeCode opens its official one-time import confirmation.
// .mcp.json, or your client's MCP configuration
{
"mcpServers": {
"kjdraw": {
"command": "npx",
"args": ["-y", "@kanjieteam/kjdraw", "mcp"]
}
}
}
Or install the user-level connector once:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/KanJieTeam/kjdraw/main/scripts/install-ai.sh | sh
# Windows PowerShell
irm https://raw.githubusercontent.com/KanJieTeam/kjdraw/main/scripts/install-ai.ps1 | iex
Your model key stays with your AI client — KJDraw never receives it. Create requests
are materialized as independently verified KJD, DXF and SVG candidate files and never
overwrite the source; in-place and destructive changes still require host review.
Installation details and security model →
In your app
npm install @kanjieteam/kjdraw@next
import { KJDraw } from '@kanjieteam/kjdraw/react'
export default function DrawingPage() {
return <KJDraw document="sample" locale="en" style={{ height: 720 }} />
}
Also available as a framework-free editor (@kanjieteam/kjdraw/editor), a Vue 3
component, and a CLI. These examples require 1.0.0-rc.3 or newer; use next.
With no install at all
Open the live editor — no account or upload.
Explore mechanical, architectural, site and road samples; inspect layers; make an
edit; undo it; save and reopen. Samples demonstrate the product and are not construction
documents. See the workbench guide.
What one agent edit looks like
A model does not write hundreds of low-level entities. It names an intent; the engine
resolves the objects, applies one transaction, and returns evidence the host can review.
{
"tool": "cad_propose_move",
"args": {
"objectIds": ["<stable-object-id>"],
"delta": { "dx": 1200, "dy": 0 },
"units": "mm"
}
}
The host receives a pending proposal with the matched object identity, revision,
transaction boundary and validation evidence. It can approve, reject or keep the
proposal pending; accepted edits remain undoable and can be saved and reopened.
Build an agent workflow → ·
Agent integration guide → ·
Run it without a model or API key →
How KJDraw works
| Work at the intent level | Execute deterministically | Keep the drawing editable |
|---|---|---|
| A model supplies requirements, constraints, and changes through a small set of high-level tools. | KJDraw resolves supported geometry, object identity, layers, references, and transactions. | Every accepted result remains structured CAD with Undo/Redo, save, and reopen support. |
What you can build
| Workflow | Built-in foundation |
|---|---|
| Understand existing drawings | Paged reads, spatial and property queries, stable IDs, layers, references, topology, and change-impact inspection. |
| Generate supported drawing types | High-level compilers for manufacturing, architecture, site, road, data visualization, and geology workflows. |
| Continue editing through conversation | Precise selection, move, copy, rotate, scale, offset, stretch, lengthen, text/layer edits, and structural delete/reconnect/relayer operations. |
| Embed CAD in your product | JavaScript/TypeScript SDK, React and Vue components, packaged editor, CLI, and MCP tools powered by the same engine. |
Scope and compatibility
KJDraw reads and writes native KJD drawings, KJP projects, and a
documented DXF compatibility range.
Direct DWG support is not included.
Read, edit and save drawings from code or the CLI without an AI model — see the
file guide.
| KJDraw | ezdxf | LibreCAD | Excalidraw / tldraw | |
|---|---|---|---|---|
| Runs in the browser | ✅ | — | — | ✅ |
| Engineering entities (dimensions, blocks, hatches) | ✅ | ✅ | ✅ | — |
| Editor UI included | ✅ | — | ✅ | ✅ |
| Agent / MCP tools with stable object IDs | ✅ | — | — | — |
| DWG | — | — | partial | — |
Contributing
Our mission is to make KJDraw the default open-source CAD engine for the AI era.
Bring a drawing that exposes a bug, build an integration, or help improve the engine. Work that directly helps users includes geometry and file compatibility, editing tools, Agent examples, accessibility, performance and documentation.
Read Contributing for the development workflow and Governance for how decisions and maintenance work. For substantial changes, open an issue to discuss the design first.
git clone https://github.com/KanJieTeam/kjdraw.git
cd kjdraw
npm ci --ignore-scripts
npm run dev
Open http://localhost:4173. Before submitting changes, run npm run typecheck and npm test; UI changes also need npm run test:browser.
Documentation · API reference · Roadmap · Support · Release status · License
Star History
Built by KanJieTeam, open to contributors everywhere.
[email protected] · Apache-2.0
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found