Files
autocad-mcp-pro/.env.example
T
Umut CANandClaude Opus 5 70afd57831 feat(server): settings pack — 22 environment tools behind TOOL_PACKS, lean grows to 55, three groups, golden set +10
Task 24 (merge sanity) on main after the five track E groups merged.

- TOOL_PACK_NAMES = ("core", "pid", "settings"); PACK_TOOL_NAMES["settings"]
  is exactly the 22 SECTION 20 tools. Styles and page setup stay in core.
- LEAN_TOOL_NAMES += page_setup_apply, batch_plot (53 -> 55).
- _GROUP_TAG_PRIORITY / _GROUP_TAG_LABELS: "style" moved up next to "pid",
  "pagesetup" -> page_setup and "environment" -> environment added; the 28
  SECTION 19/20 decorators gain their section tag, so _tool_groups() reports
  styles 10 / page_setup 6 / environment 22 (23 groups, 204 tools) and
  pack == group == section for the settings pack.
- SECTION headers, backends/base.py composition, contracts/__init__.py
  exports and the layer_states feature entry were already correct after the
  merge (read and confirmed, nothing edited).
- Pack text: config.py, .env.example, README config row; README <sub> line
  204 tools in 23 groups; release snapshot 3259 collected tests (measured).
- docs/tool-inventory.json regenerated; registry snapshot re-derived.
- tests: test_tool_packs.py replaced (11 tests), test_capability_contract.py
  +3 (composition, the agreed capability flags, layer_states honesty),
  golden set +10 tuning cases (81 = 66 tuning + 15 holdout); all ten route
  in the top 3 without alias edits.

Deviation from the plan text: TRACK_E_KEYS carries five keys, not six. The
plan's "mleaderstyle" (ezdxf True / com False) contradicts spec §8.1, which
retracted that key because the ActiveX route exists (§4.2); measured on the
tree: capability_keys() == {boundary_trace, chspace, interactive_prompt,
live_application, preferences, revcloud, wipeout}, and
ComBackend.mleaderstyle_create is a native implementation
(backends/com_backend.py:6752, is_capability_default -> False). The test now
also asserts the key is absent.

No new ActiveX call was written in this task, so no live probe was needed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
2026-09-22 11:35:00 +03:00

99 lines
4.3 KiB
Bash

# AutoCAD MCP Pro — Environment Variables
# Rendering (view_screenshot / drawing_export_pdf) is an install-time choice,
# not an env var — the core install cannot render at all. ezdxf's drawing
# add-on imports Pillow unconditionally, so every render path needs it:
# pip install "autocad-mcp-pro[pdf]" ezdxf backend, matplotlib renderer
# (also pulls Pillow in transitively)
# pip install "autocad-mcp-pro[com]" live AutoCAD Win32 window capture
# pip install "autocad-mcp-pro[full]" both
# With only [com] the ezdxf backend still cannot render (no matplotlib).
# Backend selection: auto | com | ezdxf
AUTOCAD_MCP_BACKEND=auto
# COM ProgID the live backend attaches to. Escape hatch for AutoCAD-compatible
# applications that expose the same ActiveX object model.
#
# CAD_PROGID only changes which COM application the backend attaches to — every
# tool beyond the connection itself is developed and tested against AutoCAD
# alone, and AutoCAD-clone compatibility is unverified, so treat a non-default
# ProgID as experimental. An unrecognised ProgID fails loudly rather than
# falling back to AutoCAD, because the fallback would launch the very
# application you said you were not using.
#
# Candidates below are UNVERIFIED — none was tested against a running seat.
# List what is actually registered on your machine with:
# Get-ChildItem Registry::HKEY_CLASSES_ROOT |
# Where-Object { $_.PSChildName -like '*.Application*' } |
# Select-Object -Expand PSChildName
# CAD_PROGID=BricscadApp.AcadApplication # UNVERIFIED
# CAD_PROGID=ZWCAD.Application # UNVERIFIED
# CAD_PROGID=GstarCAD.Application # UNVERIFIED
CAD_PROGID=AutoCAD.Application
# Comma-separated list of allowed directories for file operations.
# Leave empty to allow all paths (not recommended for production).
# Example: ALLOWED_PATHS=C:\Drawings,D:\Projects\CAD
ALLOWED_PATHS=
# Maximum undo stack size (number of snapshots to keep). The code's default is
# 5; this file used to say 50, which was a documentation-only disagreement.
MAX_UNDO_STACK=5
# Logging level: DEBUG | INFO | WARNING | ERROR
LOG_LEVEL=INFO
# Enable dangerous AutoCAD commands (ERASE ALL, QUIT, etc.)
# Set to true only if you trust all MCP clients
DANGEROUS_COMMANDS_ENABLED=false
# Exposed tool profile: full (default) | lean
# lean is a curated ~47-tool drafting/inspection set for clients with tight
# tool caps. The "core" profile was removed in v1.5.0 — the discovery layer
# below solves the crowded-surface problem it existed for. TOOL_PROFILE=core
# still boots, falling back to full with a warning.
TOOL_PROFILE=full
# Tool packs: all (default) | comma list of core,pid,settings — advertise only the
# vertical packs this client uses. core is always on.
TOOL_PACKS=all
# Tool discovery: off (default) | search
# "search" replaces the advertised catalog with search_tools + call_tool, so a
# client sees two tools instead of ~126 and searches by AutoCAD command name
# ("QSELECT") or plain English ("round off this corner").
DISCOVERY_MODE=off
# Per-call backend timeouts in seconds; 0 disables the check.
# A hung call would otherwise hold the backend lock forever.
COM_CALL_TIMEOUT=60
EZDXF_CALL_TIMEOUT=120
# Undo/redo history for the headless backend, in steps. 0 disables it.
# Not free: ezdxf has no journal, so each step is a full DXF snapshot.
# Measured 37x slower entity creation with it on (0.18 -> 6.65 ms/call),
# and a snapshot of a 5000-entity drawing costs 130 ms / 658 KB. For a
# single checkpoint use transaction_begin/rollback instead.
# The live COM backend uses AutoCAD's own undo and ignores this.
EZDXF_UNDO_DEPTH=0
# Opt-in 3D solids (COM backend only; ezdxf reports them as unsupported)
ENABLE_3D=false
# --- Limits and remote access -------------------------------------------------
# These four are read by config.py but were missing from this file, which made
# it look like the complete list. Two of them are the remote-HTTP controls.
# Reject DXF input larger than this many bytes. 0 disables the check.
MAX_DXF_BYTES=52428800
# Upper bound on list/selection response sizes.
MAX_LIST_LIMIT=5000
# Permit a non-loopback HTTP bind. Requires MCP_AUTH_TOKEN as well.
ALLOW_REMOTE_HTTP=false
# Bearer token required for remote HTTP. No default; remote binds refuse without it.
MCP_AUTH_TOKEN=