# DWG MCP Server [Health: Active]

**Category:** 📐 Architecture & Design  
**Repository:** https://github.com/dimitrovakulenko/dwg-mcp-server  
**GitHub Stars:** 21  
**npm Downloads (last month):** 587  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/dwg-mcp-server

## Description
Read-only MCP server for inspecting AutoCAD DWG files

## Tools
Capabilities this server exposes over MCP:

- **dwg.list_roots** — List roots that can be used with dwg.open_file. Uses MCP client roots when the client provides them, otherwise uses server-configured allowed roots.
- **dwg.open_file** — Open a DWG or DXF from a listed root and return documentId. Call dwg.list_roots first, then provide one returned rootUri and a relativePath under that root.
- **dwg.close_file** — Close a previously opened document and release worker resources.
- **dwg.list_types** — List globally supported DWG types (not file-specific). Supports regex filtering and cursor pagination.
- **dwg.list_file_types** — List types present in an opened DWG. Use this after open_file to discover valid typeName values.
- **dwg.describe_type** — Describe a supported DWG type, including aliases, properties, and default select fields.
- **dwg.get_objects** — Fetch objects by handle from an opened DWG. Preserves input order and reports missing handles.
- **dwg.query_objects** — Query objects in an opened DWG using filters, scope, relations, sorting, and pagination.
- **dwg.set_entity_properties** — Set properties marked writable by dwg.describe_type on one existing entity. The change affects only the opened in-memory document and is discarded on close; this tool does not write the source file.
- **dwg.list_render_views** — List model space, paper-space layouts, and layout viewports that can be rendered.
- **dwg.render_view** — Render model space, a paper-space layout, or one layout viewport as PNG or SVG.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "dwg-mcp-server": {
    "command": "npx",
    "args": ["-y","@dmytro-prototypes/dwg-mcp-server"],
    "env": {
      "DWG_MCP_ALLOWED_ROOTS": "",
      "DWG_WORKER_BIN": ""
    }
  }
}
```

**Requires environment variables:** `DWG_MCP_ALLOWED_ROOTS`, `DWG_WORKER_BIN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What DWG MCP Server does

DWG MCP Server MCP server provides MCP access to local DWG and DXF drawings. It lets an agent discover permitted folders, open a drawing, inspect its supported entity types, retrieve objects by handle, run structured queries, and render model space or paper-space views. The source file remains unchanged throughout normal use.

The server also exposes limited in-memory mutation for properties that the type metadata marks as writable. These changes apply only to the open document and are discarded when the document closes; the server does not save or overwrite the original drawing.

This fits the Architecture & Design category and is intended for agents that need drawing inspection, object discovery, relationship-aware queries, or visual output from CAD files.

## How it works

A typical session begins with `dwg.list_roots`. The server uses roots supplied by the MCP client when available, or configured allowed directories as a fallback. The agent then calls `dwg.open_file` with a returned root URI and a path relative to that root. The response contains a `documentId`, which is required for later file-specific operations.

Opening a file starts a dedicated Rust worker and builds an in-memory index through LibreDWG. The index records handles, types, properties, and derived membership such as blocks, layouts, and model or paper space. `dwg.get_objects` performs direct handle lookup, while `dwg.query_objects` applies supported filters, scopes, relations, sorting, projections, and pagination against the index.

Rendering is compiled lazily on the first render request. The server can produce SVG or PNG output for model space, paper-space layouts, and layout viewports. Render results include diagnostics for unsupported entity types and generated-block fallbacks. After inspection, `dwg.close_file` releases the worker and discards in-memory changes.

## Setup and configuration

Packaged releases provide a standalone native application. The npm package downloads the matching native build on first use, checks its SHA-256 checksum, caches it, and runs it directly. Docker and a separate Python installation are not required for this packaged path.

Native installer commands are provided for macOS Apple Silicon and Windows x64. MCP clients can also start the package with `npx -y @dmytro-prototypes/dwg-mcp-server`. Claude Code, Cursor, and Codex examples are included in the project documentation.

Clients that do not provide MCP roots can use `DWG_MCP_ALLOWED_ROOTS`, configured as a semicolon-separated list of absolute directories. When building from source, the project requires Rust, Python 3.11 or newer, and additional autotools on macOS or Linux. `DWG_WORKER_BIN` can point the Python host to a worker executable in a nonstandard location.

## Tools and capabilities

The DWG MCP Server MCP server exposes these capabilities:

- List accessible roots and globally supported drawing types.
- List types found in a particular opened file.
- Describe aliases, properties, and default fields for a type.
- Fetch objects by handle while preserving request order and reporting missing handles.
- Query by type, generic type, kind, handle, property values, block, layout, or space, with pagination and relation traversal.
- Change writable properties on one entity in memory.
- Discover renderable views and render them as PNG or SVG.

## Limitations and notes

The DWG MCP Server MCP server does not write changes back to DWG or DXF files. In-memory property updates are validated against the type catalog and disappear when the document closes. Some writes have additional constraints, including coordinate and block-scaling rules; attributed block-reference updates are rejected when safe attribute transformation is unavailable.

Rendering covers common 2D geometry, text, MTEXT, hatch contours, approximated point-list entities, block references, generated dimension blocks, and paper-space viewports, but output can include coverage diagnostics for unsupported content. Automatic fitting rejects extreme sparse extents, while explicit regions can bound dense views.

Access is limited to files under client-provided or configured roots. Each opened document uses a worker process and should be closed when no longer needed. Official native artifacts target macOS Apple Silicon, Windows x64, and Linux on x64 or ARM64.

_Full upstream README: https://allmcps.com/mcp/dwg-mcp-server/readme_

