Skip to content

dwg-mcp v2.5.1

Choose a tag to compare

@lekhoa221 lekhoa221 released this 23 Nov 06:47
· 40 commits to master since this release
549a3f0

This release was prepared as 2.2.0 and ships as 2.5.1, the shared release number of the four bimwright gateways (rvt-mcp, dwg-mcp, nwd-mcp, ipt-mcp). The number does not mark breaking changes; the entries below list what changed since 2.1.2.

  • Update the gateway MCP SDK to 1.4.2.

  • Update the isolated AutoCAD scripting runtime to Roslyn 4.13.0.

  • Update Newtonsoft.Json to 13.0.4 and keep plugin JSON serialization compatible with older host-loaded versions.

  • Move the gateway to .NET 10 LTS. Setup includes the gateway runtime. The framework-dependent NuGet tool requires .NET 10.

  • Update the gateway SQLite provider and native engine used by ToolBaker and drawing history.

  • Add BIMWRIGHT_KEEP_ALL_LOGS (1, true, yes or on) for the gateway and the AutoCAD plugin. When set, no log, call record, journal or report is deleted automatically: retention pruning, diagnostic and legacy debug.log compaction and report retention are skipped, and the diagnostic log rolls to a timestamped archive instead of replacing its single backup. Rotation still happens. It never turns on a recorder or changes what is recorded. Startup writes one diagnostic line when it is on. Unset, retention is unchanged.

  • Bound the generated view captures in %LOCALAPPDATA%\Bimwright\dwg-mcp\captures\ like rvt-mcp: after each capture written by dwg_capture_view_image, dwg_inspect_view_region or dwg_restore_view, generated dwg-capture-… images older than 30 days are deleted, then the oldest until the rest fits 200 MB. The capture just written, files you named, subfolders and other files are never deleted, and BIMWRIGHT_KEEP_ALL_LOGS keeps every capture.

  • Fix the Setup installer keeping plug-ins from an earlier release in the bundle. A year already in Bimwright.Dwg.bundle but not selected in this run is now replaced from the package, or removed with a warning when the package does not ship it, so every plug-in matches the installed server. -WhatIf previews the replace/remove actions and Verified: covers every year left in the bundle.

  • The gateway now sends the MCP client name from initialize with each request to the AutoCAD plugin (client_name, left out when the client sends no name). The plugin uses it only for the toast title; an older plugin ignores it.

Drawing edits and scripting

  • Add opt-in atomic=true to dwg_batch_execute. Supported drawing commands run in one outer AutoCAD transaction. A failed step, including a reported per-entity error, rolls back earlier changes and skips later steps. The gateway checks atomic_batch_version before dispatch. The default remains atomic=false.
  • Add dwg_attach_image (issue #6). Link a local PNG, JPG, TIFF or BMP with an exact insertion point and width, optional height, rotation, layer and send-to-back. The image, definition, layer and draw order are written in one transaction. An existing definition is reused when its saved or resolved image path matches. Mapped network drives are refused.
  • Add result_contract=task_v1 to dwg_send_code. Scripts return McpTaskResult.Pass(value) or McpTaskResult.Fail(code, message, details). The result includes _task.status (passed, failed or not_reported). The gateway checks script_task_contract_version before dispatch. Calls without task_v1 keep their legacy behavior.
  • Add optional usage_context=project|test|unknown to dwg_send_code. The gateway records it only when call logging is enabled. Compiler diagnostics now include an excerpt (issue #4) of up to two lines on either side of the error, a column marker and a 200-character cap per line.
  • dwg_send_code text results follow the family response limits, as in rvt-mcp: warning at 64 KiB, strong warning at 256 KiB, and above 1 MiB the result is saved to a local output_artifact with a compact receipt. Before, they used the 80 MiB budget kept for inline images, so a script could return up to the plug-in's 10 MiB cutoff inline. Explicitly configured response thresholds still apply. Its receipt, and the plug-in's receipt for a result above 10 MiB, now carry mutation_applied: null; the gateway receipt also lists the stored result's key names in schema.
  • dwg_send_code leaves out a loaded DLL whose metadata Roslyn cannot read and lists it in skipped_references (rvt-mcp #38). Before, one such add-in failed every compile with CS0009.
  • Fix dwg_save_drawing with confirm=true and no output_path failing with eFilerError on a drawing opened from disk. The active file is now saved in place through a temporary file, and AutoCAD keeps its .bak backup.
  • Return ACAD_BUSY or QUEUE_FULL when host admission rejects a request before it starts.
  • An older plugin is refused before anything is sent: atomic=true returns ATOMIC_BATCH_UNSUPPORTED and result_contract=task_v1 returns SCRIPT_TASK_CONTRACT_UNSUPPORTED. An atomic batch with a command outside the supported drawing reads and edits returns ATOMIC_UNSUPPORTED_COMMANDS before any step runs. Under task_v1, a script that does not return McpTaskResult.Pass or McpTaskResult.Fail gets TASK_RESULT_REQUIRED.

Reports, workflows and localization

  • Add dwg_report_task_result and the MCPREPORTS window. Entity links can activate another drawing that is already open. Reports support clickable dwg: entity links for selection and zoom. The AutoCAD toast can open the report. Successful write responses can include a _report reminder when reporting is enabled in the tool catalog.
  • Expose the MCP prompts dwg_translate_text and dwg_review_large_drawing. Translation requires review before writeback. Large-drawing review uses WCS bounds and band clustering. Read-only sessions omit writeback and image capture.
  • Check for stable releases in the background at most once per 24 hours and show an optional notice in AutoCAD. Settings can disable the notice. The notice links to release information.
  • Add opt-in SQLite history for supported committed drawing edits. dwg_record_change records the goal and reason, dwg_get_change_records queries saved records, and dwg_survey_change_impact inspects supplied handles for context. Reports accept optional call_ids and dwg_get_report_history reads saved provenance even with AutoCAD closed.
  • Add English, Vietnamese and Simplified Chinese catalogs for the plugin UI. English is the default. Language changes in Settings take effect after restarting AutoCAD.
  • dwg_report_task_result saves each report as a local file under %LOCALAPPDATA%\Bimwright\dwg-mcp\reports and never changes a drawing. Links that do not resolve come back in links.unresolved. Sending the same task_id again from the same gateway session replaces the report. Reports older than reportRetentionDays in settings.json (1 to 3650, default 30) are deleted when AutoCAD starts.
  • Drawing history capture is off by default. Set BIMWRIGHT_DWG_ENABLE_CHANGE_HISTORY=true on the gateway to turn it on; --read-only never captures, and dwg_record_change returns HISTORY_DISABLED while it is off. Each drawing's history is stored in %LOCALAPPDATA%\Bimwright\dwg-mcp\history\<drawing_key>.db.
  • The release check is on by default and contacts api.github.com. Turning off Check for new dwg-mcp releases in Settings (releaseNotificationsEnabled in settings.json) stops the lookup as well as the notice.

Toast

Update the gateway and plugins together to see the agent name; an older gateway leaves it out.

  • The card title names the agent of the latest call from its MCP client name: dwg-mcp 2027 · Claude (Claude, Codex, Cline, Cursor, Windsurf, Antigravity, Gemini, Copilot, VS Code; any other client shows its own name, cleaned and capped at 20 characters). The gateway sends the name with each call (client_name); it is display text only.
  • The AutoCAD process ID (· PID 12345) fades in when you point at the card and fades out when you leave, with or without branding. It no longer shows all the time.
  • Pause for today: a button at the foot of the expanded card, and a switch in MCPSETTINGS → Toast, hide every card (errors included) in every AutoCAD on this computer until local midnight. Pressed on the card, the card stays open and the button turns into Resume, so a mis-click is undone at once. The choice is saved as the local date in toastSnoozedDate. Turn the switch off, or run MCPTOAST, to show cards again now; turning toasts on from MCPTOAST or Settings also ends the pause. While paused (or disabled), dwg_report_task_result returns toast: "disabled" (otherwise "shown").

Large drawings and open documents

  • dwg_list_blocks reports direct and nested references and unused definitions (issue #4). dwg_get_drawing_profile can page unused block definitions and collect opt-in DBText/MText counts, a height histogram and bounded samples. Profile pages preserve coverage and continuation under the response budget.
  • dwg_list_layers(include_counts=true) adds opt-in entity counts (issue #4). Type filters normalize AcDb aliases, and zero-match count and select-by-type results can suggest types present in the requested space. Use dwg_query_entities for selection by WCS bounding box.
  • Add dwg_list_open_documents and standalone dwg_activate_document (issue #4). Verify the new drawing with dwg_switch_target before writing.
  • Add read-only dwg_cluster_bands (issue #4) for X/Y band clustering with gap, WCS bounding-box, space and type filters, optional plain-text samples and cursor pagination. Entities without usable extents are counted separately.
  • The catalog exposes 54 tools by default and 78 with --toolsets all. Read-only mode exposes 23 by default and 29 with all toolsets.

Distribution

Setup includes the self-contained Windows x64 gateway and AutoCAD 2022–2027 plugins. NuGet contains the gateway only and requires .NET 10. The Claude Desktop MCPB requires the exact Setup gateway SHA-256 (29db69ac813ca67c74b7c93bb23216d814eeeb1afbea0631aec4cf0cbaac74b9), including executable overrides. All three packages have SHA-256 sidecars.

Validation

  • CI run 45126043406 on master (549a3f0): public-tree, server, toast-wpf, installer-powershell, installer-pwsh, and plugin-acad22–plugin-acad27 all passed.
  • Live tool benchmark on AutoCAD 2025 (build 17a0532): 78/78 tools, 166/166 calls passed (docs/benchmarks/2026-11-23-autocad-2025.md).
  • MCPB catalog capture and validation on 2.5.1+549a3f0715b3f1b98b54bfeee00b38283fde7e77: 78 tools, schema SDK 1.27.1 PASS, mcpb validate PASS.

Source commit: 549a3f0715b3f1b98b54bfeee00b38283fde7e77.