DWG MCP Server
Provides read-only access to AutoCAD DWG files, enabling AI agents to inspect drawing contents, query objects by handles or filters, and retrieve properties, scopes, and references.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DWG MCP Serveropen floorplan.dwg and list all layers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DWG MCP Server
DWG and DXF file format access for AI via MCP.
Connect DWG and DXF files to Claude, ChatGPT, Codex, Cursor, and other MCP clients. DWG MCP Server provides structured access to DWG data so AI can understand and reason about drawings. Source files remain read-only; supported entity properties can be changed in memory for inspection and rendering.
Quick Start
Use DWG MCP Server from the MCP client of your choice. The npm package downloads the matching native build from GitHub Releases on first use, verifies its SHA-256 checksum, caches it, and runs it directly. Docker and a separate Python installation are not required.
If your MCP client, AI agent, or test harness does not support MCP roots, set
DWG_MCP_ALLOWED_ROOTS to the folders that should be accessible.
Codex
codex mcp add dwg-mcp \
--env DWG_MCP_ALLOWED_ROOTS="$HOME" \
-- npx -y @dmytro-prototypes/dwg-mcp-serverCodex does not currently provide MCP client roots to stdio MCP servers. Configure explicit allowed roots for the folders that contain your drawings.
Claude
claude mcp add --scope user --transport stdio dwg-mcp -- npx -y @dmytro-prototypes/dwg-mcp-serverClaude Code provides MCP roots, so no extra path variable is usually needed.
Cursor
{
"mcpServers": {
"dwg-mcp": {
"command": "npx",
"args": ["-y", "@dmytro-prototypes/dwg-mcp-server"]
}
}
}Related MCP server: AutoCAD MCP Server - Codex Edition
Exposed Tools
Tool | Purpose |
| List folders available for DWG access. |
| Open a DWG or DXF from an available folder and return a |
| Close an opened document and release its worker process. |
| List the globally supported DWG types known to the backend. |
| List only the types that are present in a specific opened DWG. |
| Describe a supported type, including readable and writable properties and its default projection. |
| Fetch specific objects by handle, preserving the requested order and reporting missing handles. |
| Query objects with filters, scopes, relation traversal, sorting, projection, and pagination. |
| Change properties marked writable on one entity in memory. Changes are discarded when the document closes. |
| List renderable model space, paper-space layouts, and layout viewports. |
| Render a complete view or selected drawing region as PNG or SVG. |
A typical flow is:
Discover available folders with
dwg.list_roots.Open a file from one of those folders with
dwg.open_file.Inspect supported or file-local types with
dwg.list_types,dwg.list_file_types, ordwg.describe_type.Fetch known handles with
dwg.get_objectsor search the drawing withdwg.query_objects.Optionally change properties reported as writable with
dwg.set_entity_properties.Discover and render drawing views with
dwg.list_render_viewsanddwg.render_view.Close the session with
dwg.close_file, discarding in-memory changes.
Architecture
Runtime model
In the packaged deployment, DWG MCP Server is a standalone native application built for the host operating system. The Python host exposes the MCP tools, validates file access, and manages document sessions.
Each dwg.open_file call starts a dedicated Rust dwg-worker process for that DWG and returns a host-side documentId.
All later file-scoped calls use that document id.
dwg.close_file terminates the worker for that session.
Worker and query model
The Rust worker speaks newline-delimited JSON over stdin and stdout. When it opens a DWG through LibreDWG, it first builds an in-memory indexed document. That upfront indexing step is central to the design: the server pays the cost once when the file is opened, then answers later requests against the index instead of rescanning the DWG each time.
The indexed model stores object handles, kinds, type names, generic types, summary and full properties, and derived block, layout, and space membership. It also stores supported type metadata such as aliases, default projections, and property definitions.
When you request full object records, responses also include that derived membership under extendedData, including container block, layout, and model or paper space when known.
dwg.get_objects is direct lookup by handle.
dwg.query_objects runs over indices for handle, type, generic type, kind, exact property values, block, layout, and space, then applies filters, scopes, relation traversal, sorting, projection, and pagination.
This is what makes queries over blocks, layers, layouts, references, and related objects practical on an opened drawing.
dwg.set_entity_properties validates writes against the type catalog, updates
the native LibreDWG document, rebuilds the index, and invalidates the cached
rendering scene. Block-reference insertion points use OCS coordinates, block
scaling rules are enforced, and attributed block references are rejected until
their owned attributes can be transformed safely. The tool does not save or
overwrite the source file.
The worker lazily compiles a separate rendering scene on the first render call.
It expands block references and generated dimension blocks, draws common 2D
geometry, text, MTEXT, hatch contours, and approximated point-list entities,
and composes paper-space layouts through their viewports. SVG is the canonical
render output; PNG is rasterized from the same SVG in memory. Render responses
include coverage diagnostics for generated-block fallbacks and unsupported
entity types. Automatic fit rejects extreme sparse extents, WIPEOUT boundaries
mask earlier geometry, and explicit regions allow bounded rendering of dense
views. See docs/rendering.md for the protocol and
rendering model.
Access and packaging
DWG and DXF files must be opened from roots listed by dwg.list_roots. The server first
asks the MCP client for roots. If the client, AI agent, or test harness does not
support MCP roots, configure explicit allowed roots:
python3 -m dwg_mcp_server --allowed-root "$HOME/Downloads"or:
DWG_MCP_ALLOWED_ROOTS="$HOME/Downloads;$HOME/Documents/dwg" \
python3 -m dwg_mcp_serverDWG_MCP_ALLOWED_ROOTS is an authorization fallback for clients without roots.
It should be a semicolon-separated list of absolute directories.
Official releases contain a standalone MCP host, the statically linked Rust worker, and the LibreDWG schema files needed at runtime.
Native platforms
GitHub Actions builds and tests these release artifacts on their native runners:
System | CPU | Rust target |
macOS | Apple Silicon |
|
Windows | Intel or AMD 64-bit |
|
Linux | Intel or AMD 64-bit |
|
Linux | ARM 64-bit |
|
x64, x86_64, and AMD64 name the same CPU architecture; the Windows and
Linux artifacts work on both Intel and AMD processors.
Build and Test From Source
Local source builds use the vendored third_party/libredwg submodule by default.
Prerequisites
Rust toolchain
Python 3.11 or newer
autotools for local LibreDWG builds on macOS or Linux (
autoreconf,aclocal,automake,autoconf,make)
Bootstrap
git submodule update --init --recursive
bash scripts/build-libredwg.shBuild and test
cargo test --workspace
bash scripts/run-e2e-tests.shRun the MCP host locally
The Python host looks for dwg-worker under target/release or target/debug.
If you want a release build explicitly:
cargo build -p dwg-worker --releaseThen run the MCP host:
PYTHONPATH=server/src python3 -m dwg_mcp_serverIf the worker binary lives somewhere else, set DWG_WORKER_BIN to that executable.
Publish a native release
Set the same version in
npm/package.json,server.json, and the Claude extension manifest when applicable.Configure npm trusted publishing for
.github/workflows/native-release.yml.Push the matching
v<version>tag.
The Native Release workflow builds and tests all four platforms, creates the
GitHub Release with checksum files, and then publishes the npm launcher. A
manual workflow run can build one selected platform or all four as downloadable
Actions artifacts without publishing.
Clean rebuild
Remove local Rust and Python build artifacts:
bash scripts/clean-build-artifacts.shTo also wipe the host LibreDWG build under third_party/libredwg:
bash scripts/clean-build-artifacts.sh --with-libredwgOfficial MCP Registry
Registry metadata lives in server.json under the GitHub-authenticated name
io.github.dimitrovakulenko/dwg-mcp-server.
Before publishing a new registry version:
Publish the matching npm package version from
npm/.Confirm
npm/package.jsoncontains the samemcpNameasserver.json.Run the manual
Publish MCP RegistryGitHub Actions workflow, or run:
mcp-publisher login github
mcp-publisher publishThe registry validates the published npm package, so server.json must point to
an npm version that already exists on the public npm registry.
License
This project is licensed under the GNU General Public License v3.0.
See LICENSE for the full license text.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Read-only MCP server exposing a user ORANO library to their own AI agent.
1Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that lets AI assistants read and visually analyze local documents — PDFs, Excel spreadsheets, CSV files, Word documents, PowerPoint presentations, and images.466MIT
- AlicenseAqualityAmaintenanceMCP server for full AutoCAD automation, AutoCAD LT automation, and headless DXF generation. It provides 8 consolidated tools for drawing, entity, layer, block, annotation, P&ID, view, and system operations via MCP stdio transport.61213MIT

cadlens-mcpofficial
AlicenseAqualityBmaintenanceAn MCP server that parses CAD files (.dwg, .dxf, .dwf, etc.) via the Cadlens API, enabling LLM clients to extract and reason over entity, layer, and metadata payloads.7581MIT- AlicenseAqualityCmaintenanceMCP server for AutoCAD LT automation and headless DXF generation, exposing tools for drawing, entities, layers, blocks, annotations, P&ID, and view operations via natural language.8MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dimitrovakulenko/dwg-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server