AutoCAD MCP server
Allows an AI assistant to draw in a running AutoCAD instance, providing tools for creating and editing 2D geometry, dimensions, hatches, layers, and managing drawings.
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., "@AutoCAD MCP serverDraw a circle with radius 5 at the center of the drawing and show me what it looks like."
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.
AutoCAD MCP server
Lets an AI assistant draw in the AutoCAD running on this machine. A small Python server exposes AutoCAD's drawing commands as MCP tools over HTTP; a tunnel makes that reachable by cloud assistants like ChatGPT and Manus.
Built and verified on 2026-07-30 against AutoCAD 2027 (R26.0), Python 3.13.
How it fits together
ChatGPT / Manus --HTTPS--> ngrok --> 127.0.0.1:8770 --> AutoCAD 2027
server.py (via COM)The server talks to AutoCAD through COM, which means AutoCAD has to be running on this machine with a drawing open, and the server has to run as the same Windows user.
Related MCP server: AutoCAD MCP Server
Relationship to the Codex AutoCAD project
There is a second, much larger AutoCAD MCP system on this Desktop under
AUTOCAD Codex (C#/.NET, native AutoCAD plug-in, OAuth, per-change approvals).
It listens on 8765. This project is deliberately simpler and listens on
8770 so the two can coexist. Only one ngrok agent can run at a time on the
free plan, so only one of them can be tunnelled at any moment.
Pick this one when you want an AI to just draw without approving every change. Pick Codex when you want the safety controls.
Setup
pip install -r requirements.txtBoth dependencies were already installed on this machine; the file pins the versions this was verified against.
Running it
Open AutoCAD and make sure a drawing is open.
Start the server:
powershell -ExecutionPolicy Bypass -File .\run.ps1It prints its URL, which contains a long random path segment — that path is
the password, so the whole URL is a secret. It is generated once and saved to
.secret, so restarting the server does not invalidate URLs you already gave to
ChatGPT or Manus.
Connect the VPN, then open the tunnel in a second window:
powershell -ExecutionPolicy Bypass -File .\start_ngrok.ps1It prints the full public URL to paste into your AI client.
The VPN is not optional. ngrok refuses agent connections from Iranian IP addresses (
ERR_NGROK_9040), and the tunnel dies whenever the VPN drops.
Connecting an AI client
ChatGPT (needs Plus or Pro, web only): Settings → Apps & Connectors →
Advanced settings → turn on Developer mode. Back in Apps & Connectors, add a
custom connector with the URL from start_ngrok.ps1 and authentication set to
No authentication — ChatGPT connectors cannot send a custom header, which is
exactly why the secret lives in the URL. In a chat, enable it from the + menu.
Manus: Settings → Connectors → Add connectors → Custom MCP → Direct
configuration. Same URL. If you set ACAD_MCP_AUTH_TOKEN, add the header
Authorization: Bearer <token> as well.
Claude Code on this machine needs no tunnel at all — point it straight at the local URL:
{ "mcpServers": { "autocad": { "type": "http", "url": "http://127.0.0.1:8770/<secret>/mcp" } } }What the AI can do
24 tools. Coordinates are drawing units, angles are degrees, everything is 2D at Z=0. Drawing tools return an entity handle, which the query, hatch and erase tools take.
Area | Tools |
Draw |
|
Batch |
|
Dimensions |
|
Layers |
|
Inspect |
|
Edit |
|
Files |
|
Lifecycle |
|
Command line |
|
The tool set is deliberately small. Every tool's schema is loaded into the model's
context on every single request, so a tool that is rarely the right answer makes the
model measurably worse at choosing between the ones that are. Ellipses, point markers,
paragraph text and standalone zoom were removed for that reason — draw_batch still
accepts mtext and point operations, capture_view zooms to fit on its own, and
anything genuinely exotic is one send_command away.
Seeing the drawing
capture_view is what turns this from a one-way pipe into a loop. It plots the
current view through AutoCAD's PublishToWeb PNG.pc3 raster plotter, downscales the
result with Pillow, and returns it as an actual image in the tool response — so the
model looks at the drawing rather than guessing from coordinates.
A typical view costs about 5 KB at 1100 px, which is cheap enough to call after every
drawing step. The plot rotation is pinned to zero deliberately; left alone AutoCAD
rotates the view to fit the paper and the model then reasons about a sideways drawing.
The tool also restores the layout's previous plotter config, so export_pdf keeps
working afterwards.
draw_batch matters more than it looks: every tool call is a network round trip
to a cloud AI, so drawing a floor plan one line at a time is painfully slow.
One batch call draws the lot.
Configuration
All optional, all environment variables.
Variable | Default | Purpose |
|
| Listen port. 8765 is Codex, 8766 is Windows-reserved here. |
|
| Leave it. Binding wider exposes AutoCAD to your LAN. |
|
| The only folder the server may write to. Kept out of OneDrive because sync locks files AutoCAD has just written. |
| (unset) | If set, any request that does send an |
| from | Override the secret URL segment. |
| (off) |
|
|
| Seconds before a stuck AutoCAD call gives up. |
Security
The honest summary: anyone who has the URL can draw in your AutoCAD and write files into the output folder.
The secret path is the real gate, because ChatGPT connectors support only OAuth or no authentication and cannot send a token header.
The server listens on loopback only, so the tunnel is the sole way in.
File writes are confined to
ACAD_MCP_SAVE_DIR; path traversal is stripped.send_commandis off by default. Turning it on lets a remote AI run arbitrary AutoLISP, which is equivalent to running code on this machine. Leave it off unless you have a specific reason.Every tool call is logged to
logs/toolcalls.jsonlwith its arguments.If the URL leaks, delete
.secret, restart, and re-paste the new URL.
Unrelated but worth doing: the ngrok authtoken sits in plaintext in
C:\Users\zainm\mcp_setup\ngrok.yml. Rotate it at dashboard.ngrok.com.
Testing without any AI
python test_draw.pyDraws a rectangle, circle, arc, text, dimension and hatch straight through the COM bridge — no MCP, no network. If this fails, nothing else will work, and the failure message tells you why.
Troubleshooting
"AutoCAD stayed busy for 10 seconds and refused the request" — AutoCAD is showing a dialog or waiting at the command line. Switch to it, press Escape, close the dialog. The server retries automatically for about 10 seconds first.
"AutoCAD is not running" — open it, with a drawing.
ngrok reports no tunnel — VPN down, or another ngrok agent is already running (the Codex project's one). The free plan allows a single session.
export_pdf says the file is not on disk — background plotting was still
running. Check the output folder a moment later.
Port bind fails with WinError 10013 — that port is in a Windows-reserved
range. netsh interface ipv4 show excludedportrange protocol=tcp lists them;
pick another and set ACAD_MCP_PORT.
Layout
File | What it is |
| FastMCP app, secret-path gate, call logging |
| The 24 tools |
| COM bridge: one dedicated thread, retry-when-busy, reconnect |
| Environment configuration and secret generation |
| Smoke test with no MCP involved |
acad.py is the part worth understanding. AutoCAD's COM interface only accepts
calls from the thread that initialised COM, and rejects them outright while it
is busy, so every tool hands its work to a single dedicated thread that retries
with backoff and reconnects if AutoCAD restarts.
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 Servers
- Alicense-qualityCmaintenanceControls CAD applications (AutoCAD, ZWCAD, etc.) via AI assistants through the Model Context Protocol, enabling drawing, layer management, and automation through natural language or direct tool calls.Last updated72Apache 2.0
- Flicense-qualityCmaintenanceAn MCP server that bridges Claude with AutoCAD, enabling to generate architectural floor plans, draw geometry, and export DXF files just by describing what you need in natural language.Last updated
- Alicense-qualityCmaintenanceEnables LLMs like Claude to create and edit AutoCAD drawings via natural language, supporting both headless DXF generation and live AutoCAD LT connection through file-based IPC.Last updatedMIT
- Alicense-qualityCmaintenanceEnables natural-language control of AutoCAD LT for automation and headless DXF generation, supporting drawing, entity, layer, block, annotation, P&ID, and system operations via an MCP interface.Last updatedMIT
Related MCP Connectors
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
MCP server for AI dialogue using various LLM models via AceDataCloud
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
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/Erfouni/AutoCAD-AI'
If you have feedback or need assistance with the MCP directory API, please join our Discord server