Battenmark
Enables AI agents and software to create, edit, inspect, validate, and export CAD geometry through MCP using backend-neutral typed operations, with FreeCAD/OpenCascade as the authoritative B-rep backend and JSCAD preview.
README
Battenmark
Open, backend-neutral CAD infrastructure for AI agents and software.
Battenmark provides a typed, backend-neutral interface for creating, editing,
inspecting, validating and exporting authoritative CAD geometry across
interchangeable CAD backends. Callers request create_hole — never
PartDesign::Hole. No transport owns the model; one canonical service does.
ChatGPT / Claude / Gemini / Grok / Codex / local models / IDE agents / custom apps
│
MCP / HTTP / Python / CLI
│
▼
Battenmark Core
│
typed CAD operations / CAD IR
│
Backend Registry
│
┌─────────────────────┼──────────────────────┐
▼ ▼ ▼
FreeCAD JSCAD future adapters
authoritative B-rep preview build123d/CadQuery/etc.
- FreeCAD / OpenCascade — authoritative B-rep kernel (headless JSON-lines worker)
- JSCAD — in-process preview/envelope backend (not the source of truth)
Quickstart
Prerequisites: Node.js ≥ 20 and npm. FreeCAD is optional for the core service and required only for the authoritative B-rep backend.
npm install
npx tsc --noEmit # type check
npm test # fast kernel-free suites (parametric, selectors, registry)
FreeCAD backend
sh scripts/bootstrap-macos.sh # macOS: discovers /Applications/FreeCAD.app
sh scripts/install-freecad.sh # Linux: installs headless 1.0.2 AppImage (no FUSE)
npm run test:freecad # proves the real worker end-to-end
Discovery order: $AGENTCAD_FREECAD_CMD → macOS FreeCAD.app bundles →
Homebrew → extracted Linux AppImage → PATH. See docs/MACOS.md
and docs/LINUX.md.
Transports
| Transport | Entry point |
|---|---|
| MCP stdio | npx agentcad-mcp |
| HTTP | npx agentcad serve --port 8787 then /api/v1/... (Bearer token via AGENTCAD_API_TOKEN) |
| CLI | npx agentcad --help |
| Python | python/agentcad — see examples |
Python client example:
from agentcad import AgentCad
c = AgentCad(base_url="http://127.0.0.1:8787", token="secret-token")
pid = c.project_create("demo")["project_id"]
c.create_box(pid, 80, 50, 12)
print(c.rebuild(pid)["data"]["volume_mm3"]) # 48000
Golden smoke model
The canonical release smoke test is an 80 × 50 × 12 mm box = 48,000 mm³,
verified through JSCAD, FreeCAD, HTTP, CLI, MCP and the Python client
(test:transport-parity). Do not change this fixture casually.
Capabilities
- Backend-neutral typed CAD operations with explicit schema (
agentcad_schema_version: 2) - FreeCAD/OpenCascade authoritative B-rep; JSCAD preview
- Scalar parameter expressions and dependency evaluation
- Semantic face/edge selectors (
top_perimeter, …) that re-resolve after edits - Persistent geometry references (
gref) with explicit lost/ambiguous errors - Through / blind / counterbore / countersink holes
- Fillets and chamfers · linear and rectangular patterns
- STEP / FCStd / STL interchange · four-view PNG previews
- Dynamic backend registry with per-backend capability discovery
- One serialized FreeCAD worker with kill/restart recovery
- Assemblies: component definitions, persistent instances, grounded frames, face mates, axis/concentric alignment, distance & angle constraints (see docs/ASSEMBLIES.md)
Platform status
| Platform | Status |
|---|---|
| macOS Apple Silicon | Tier 1 — hardware verified (arm64, macOS 26.6.2, FreeCAD 1.1.3) |
| Linux x86_64 | headless / development validated (FreeCAD 1.0.2 AppImage) |
| macOS Intel | unverified |
| Windows | unsupported / unverified |
Known limitations
This is pre-1.0 alpha software; APIs may change.
- No assemblies, mates or assembly constraints yet
- No circular patterns
- Threads are cosmetic metadata, not helical solids
- Imported STEP is geometry import — not automatic parametric reconstruction
- Native FCStd documents keep historical PartDesign feature shapes; Battenmark measures the final Body Tip (summing historical solids double-counts)
- One serialized FreeCAD worker (no pooling)
- Preview rendering is JSCAD, not OCC hidden-line
- Complete topological naming is not solved; persistent
grefmitigates it
Full list: docs/LIMITATIONS.md.
Documentation
| Topic | Doc |
|---|---|
| Architecture & foundation | docs/ARCHITECTURE.md · docs/FOUNDATION.md |
| Operation contract & schema | docs/CONTRACT.md · docs/VERSIONING.md |
| Backends & kernels | docs/BACKENDS.md · docs/FREECAD.md · docs/JSCAD.md · docs/KERNEL.md |
| Transports | docs/MCP.md · docs/HTTP.md · docs/CLI.md · docs/PYTHON.md · docs/CLIENTS.md |
| Service & persistence | docs/SERVICE.md · docs/AUTH.md |
| Import / export & preview | docs/IMPORT.md · docs/PREVIEW.md |
| Platforms & validation | docs/MACOS.md · docs/LINUX.md · docs/RELEASE.md |
Compatibility identifiers
Public branding is Battenmark. Historical engineering identifiers remain on
purpose and are a compatibility surface, not a second brand:
AgentCadService, agentcad_schema_version, AGENTCAD_* environment
variables, the agentcad / agentcad-mcp binaries. The internal service
version 0.5.6 intentionally differs from the release tag; see
docs/VERSIONING.md.
Contributing & security
See CONTRIBUTING.md and SECURITY.md. Code of Conduct: CODE_OF_CONDUCT.md.
License
Apache-2.0 for this repository. FreeCAD/OpenCascade are invoked as a separate LGPL process (the worker scripts run inside FreeCADCmd). See LICENSE, NOTICE and THIRD_PARTY_NOTICES.md.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。