Civil 3D MCP Server
Enables AI assistants to write and execute C# code directly inside Autodesk Civil 3D (built on AutoCAD), providing full access to the Civil 3D API for operations on surfaces, alignments, points, geometry, and drawing information.
Click on "Deploy 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., "@Civil 3D MCP Server list all surfaces in the drawing"
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.
Civil 3D MCP Server — Code Execution Architecture
An MCP server that enables AI assistants to write and execute C# code directly inside Autodesk Civil 3D. Instead of fixed tools, the AI generates code that runs with full API access.
Architecture
┌─────────────────┐ stdio ┌──────────────────┐ TCP/JSON-RPC ┌──────────────────┐
│ AI Assistant │ ◄────────────► │ MCP Server (TS) │ ◄──────────────────► │ Civil 3D Plugin │
│ (Claude, Cline) │ │ 3 meta-tools │ port 8080 │ Roslyn Engine │
└─────────────────┘ └──────────────────┘ └──────────────────┘
│ │
Skills Library C# Code Execution
(.skill.md files) (full Civil 3D API)Related MCP server: Civil 3D MCP Server
10 Meta-Tools
Tool | Purpose | Safety |
| Check connection, Civil 3D version, active drawing | ✅ Read-only |
| Real-time operation progress and queue state | ✅ Read-only |
| Inventory drawing objects without writing C# | ✅ Read-only |
| Read audit log of past operations | ✅ Read-only |
| Read sandbox mode, export paths, confirmation policy | ✅ Read-only |
| Execute C# code read-only | ✅ No side effects |
| Execute C# code with write access | ⚠️ Modifies drawing |
| Execute native Civil 3D command strings | ⚠️ May modify drawing |
| Multi-step transactions (begin/execute/commit/abort) | ⚠️ May modify drawing |
| Browse/search/read code skill templates | ✅ Metadata only |
How It Works
AI reads a skill → Gets a documented C# code template
AI adapts the code → Fills in parameters, combines patterns
AI sends code → Via
civil3d_executeorcivil3d_queryRoslyn compiles + runs → Inside Civil 3D with full API access
Results return as JSON → Back to the AI
Example Interaction
User: "What surfaces are in my drawing?"
AI: Uses civil3d_query with:
var surfaces = new List<object>();
foreach (ObjectId id in CivilDoc.GetSurfaceIds()) {
var s = Transaction.GetObject(id, OpenMode.ForRead) as TinSurface;
surfaces.Add(new { s.Name, s.Layer });
}
return surfaces;
Result: [{ "Name": "EG", "Layer": "C-TOPO-EG" }, ...]Skills Library
Skills are documented C# code templates in skills/:
skills/
├── surfaces/ # Surface operations
├── alignments/ # Alignment + station/offset
├── points/ # COGO points
├── geometry/ # Lines, polylines, text
├── corridors/ # Corridor listing and info
├── pipe_networks/ # Pipe network listing and details
├── parcels/ # Sites and parcels
├── profiles/ # Profile listing and elevation queries
├── sections/ # Sample lines and cross-sections
├── labels/ # Label style inventories
├── styles/ # Object style inventories
├── export/ # CSV, LandXML export patterns
├── quantity/ # Volumes and corridor quantities
├── drawing/ # Drawing info
└── workflows/ # Multi-step civil engineering workflowsScript Globals
Code executed via civil3d_execute or civil3d_query has access to:
Global | Type | Description |
|
| Active AutoCAD document |
|
| Active Civil 3D document |
|
| Document database |
|
| Active transaction |
|
| Document editor |
Helper methods: GetSurfaceByName, GetAlignmentByName, GetProfileByName, GetCogoPointByNumber, GetObjectIdByHandle, ListSurfaces, ListAlignments, ListCogoPoints, ToRef, ToPoint
All Civil 3D namespaces are auto-imported. Return values are auto-serialized (ObjectId → handle, Point3d → xyz).
Setup
Quick setup (recommended)
npm run setupThis interactive script will:
Detect installed Civil 3D versions (scans C:, D:, and other drives)
Configure plugin DLL references automatically
Build the MCP server and plugin
Print MCP config for Cursor
Civil 3D on D: or custom folder? Use one of these:
# Option A — pass the path directly
npm run setup -- -InstallPath "D:\Program Files\Autodesk\AutoCAD 2026"
# Option B — environment variable (picked up automatically during scan)
$env:CIVIL3D_INSTALL_PATH = "D:\Program Files\Autodesk\AutoCAD 2026"
npm run setup
# Option C — interactive: when the menu appears, press C and paste the path
npm run setupThe path must be the AutoCAD 20XX folder that contains C3D\AeccDbMgd.dll.
Manual setup
1. Build MCP Server
npm install && npm run build2. Build Plugin
# References are in plugin/Civil3dMcpPlugin/Civil3dMcpPlugin.References.props
# Regenerate with: npm run setup
# Custom install path: npm run setup -- -InstallPath "D:\...\AutoCAD 2026"
cd plugin/Civil3dMcpPlugin
dotnet build3. Load in Civil 3D
NETLOAD → select Civil3dMcpPlugin.dll
C3DMCPSTATUS → verify running4. Configure AI
{
"mcpServers": {
"civil3d": {
"command": "node",
"args": ["/path/to/civil3d-mcp/build/index.js"]
}
}
}Environment Variables
Variable | Default | Description |
|
| Plugin host |
|
| Plugin port (set on both MCP server and Civil 3D process) |
|
| Default operation timeout (ms) |
|
| C# script execution timeout |
|
| Native command timeout |
|
| Discover inventory timeout |
|
| Audit log file path |
|
|
|
|
| Require |
| (see below) | Extra export folders, semicolon-separated |
|
| Log level |
Development Roadmap
See ROADMAP.md for the phased plan to reach professional full access.
Security
Three sandbox modes via CIVIL3D_SANDBOX_MODE:
Mode | File IO | Civil 3D API |
| Blocked — use | Full |
| Only under allowed folders | Full |
| Unrestricted (delete still needs confirmation) | Full |
Default allowed export paths: %LOCALAPPDATA%\Civil3dMcp\Exports, Desktop, Documents.
Add more with CIVIL3D_ALLOWED_EXPORT_PATHS.
Safe file helpers in scripts: WriteExportFile(path, content), WriteExportLines(path, lines), ReadImportFile(path), AllowedExportPaths.
Destructive operations (erase, purge, delete) require confirmed: true when CIVIL3D_REQUIRE_CONFIRMATION=true (default). The tool returns CIVIL3D.CONFIRMATION_REQUIRED with the list of detected risks.
Always blocked: process execution, network, registry, P/Invoke, dynamic assembly loading.
Call civil3d_security to inspect the active policy before exports or destructive writes.
License
MIT
Available Tools
10 toolscivil3d_auditA
Read the audit log of Civil 3D MCP operations. Shows timestamp, method, description, success/failure, and duration for each operation. Useful for debugging and traceability.
Inputs: limit.
civil3d_commandA
Execute a native Civil 3D or AutoCAD command string (same as typing in the command line). Use for operations not easily done via C# API: CREATECORRIDOR, EXPORTLANDXML, etc. Prefer civil3d_execute/civil3d_query when the C# API is sufficient.
Inputs: command (required), confirmed, timeoutMs, description, +1 more.
civil3d_discoverA
Discover and inventory Civil 3D drawing objects without writing C# code. Returns structured JSON for surfaces, alignments, profiles, corridors, pipe networks, sites, parcels, COGO points, sample lines, and styles. Use this FIRST to understand what exists in the drawing before executing code.
Inputs: limit, timeoutMs, categories.
civil3d_executeA
Execute C# code in Civil 3D with write access. The code runs inside a committed transaction. Available globals: Document/Doc, CivilDoc/Civil, Database, Transaction/Tr, Editor. Helpers: GetSurfaceByName, GetAlignmentByName, ListSurfaces, ListAlignments, ToRef, ToPoint. All Civil 3D namespaces are auto-imported. Return a value to get results back as JSON. Use civil3d_session for multi-step workflows. Use civil3d_command for native C3D commands.
Inputs: code (required), confirmed, timeoutMs, description.
civil3d_healthA
Check Civil 3D MCP connection health. Returns plugin status, Civil 3D version, active drawing info, and queue state. Call this first to verify Civil 3D is running and the plugin is loaded.
Inputs: no named parameters.
civil3d_queryA
Execute C# code in Civil 3D in READ-ONLY mode (no changes saved). Available globals: Document/Doc, CivilDoc/Civil, Database, Transaction/Tr, Editor. Helpers: GetSurfaceByName, GetAlignmentByName, ListSurfaces, ListAlignments, ListCogoPoints. All Civil 3D namespaces are auto-imported. Return a value to get results as JSON. Use this for querying data: listing objects, getting properties, analyzing surfaces, etc.
Inputs: code (required), timeoutMs.
civil3d_securityA
Read the Civil 3D MCP security policy: sandbox mode (strict/professional/unlocked), allowed file export paths, and whether destructive operations require confirmed: true. Call this before file exports or destructive writes.
Inputs: no named parameters.
civil3d_sessionA
Manage multi-step Civil 3D script sessions with a shared transaction. Use 'begin' to start, 'execute' for each script step (no commit), 'commit' to save all changes, or 'abort' to discard. Useful for complex workflows that need multiple code steps in one transaction.
Inputs: action (required), code, confirmed, sessionId, +1 more.
civil3d_skillsA
Browse and read Civil 3D code skills (documented C# code templates). Use 'list' to see available skills, 'search' to find by keyword, 'get' to read the full skill with code template. Skills are pre-built C# patterns you can adapt and execute via civil3d_execute or civil3d_query.
Inputs: action (required), query, category, skillName.
civil3d_statusA
Get real-time status of the Civil 3D plugin operation queue and any in-progress task. Use during long operations (corridor rebuild, surface build) to check elapsed time without blocking the current operation.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a unique purpose: health, status, discover, audit, security, execute (write), query (read-only), command (native commands), session (multi-step), and skills (code templates). No overlap or ambiguity.
All tools follow the consistent pattern 'civil3d_<descriptive_noun>', making it easy to predict functionality from the name.
10 tools is an ideal number for a domain-specific server, covering all essential operations without bloat.
The tool set covers connection check, status monitoring, object discovery, audit, security, code execution (read/write), query, native commands, multi-step transactions, and code templates—a complete surface for Civil 3D interaction via MCP.
Maintenance
Related MCP Connectors
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
AI colleagues that keep your standards, your project and their reasoning between sessions
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Autodesk Civil 3D, allowing them to retrieve project data, create/modify/delete drawing elements, and execute code to automate Civil 3D operations.350MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to interact with Autodesk Civil 3D through natural language, supporting tools for surfaces, alignments, profiles, corridors, pipe networks, COGO points, and AutoCAD geometry.94MIT
- AlicenseNot gradedqualityCmaintenanceLets any MCP-compatible AI assistant read and edit Autodesk Civil 3D drawings through tools for alignments, surfaces, corridors, pipe networks, quantity takeoff, and cut/fill, using a local bridge plugin and named pipes.MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to write and execute C# code directly inside Autodesk Civil 3D, using read-only and write tools plus reusable skill templates for drawing and civil object tasks.34MIT