Civil3D MCP Server
Enables interaction with Autodesk Civil 3D software, allowing AI to retrieve drawing data, query Civil 3D object types, manage selected objects, create COGO points, and generate line segments. Requires the Civil 3D MCP plugin to execute commands within the Civil 3D application.
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., "@Civil3D MCP Server create a new COGO point at coordinates X=1000, Y=2000, elevation=50"
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
3 Meta-Tools
Tool | Purpose | Safety |
| Execute C# code with write access (transaction committed) | ⚠️ Modifies drawing |
| Execute C# code read-only (no commit) | ✅ No side effects |
| 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
├── drawing/ # Drawing info
└── workflows/ # Complex multi-object operationsScript 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 |
All Civil 3D namespaces are auto-imported.
Setup
1. Build MCP Server
npm install && npm run build2. Build Plugin
# Copy DLLs from Civil 3D to C_References/ (see C_References/README.md)
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 |
|
| Execution timeout (ms) |
|
| Log level |
Security
The Roslyn sandbox blocks:
Process execution (
Process.Start)File deletion (
File.Delete)Network requests (
HttpClient,Sockets)Registry access
Dynamic assembly loading
All Civil 3D API operations are allowed.
License
MIT
Available Tools
3 toolscivil3d_executeA
Execute C# code in Civil 3D with write access. The code runs inside a committed transaction. Available globals: Document, CivilDoc, Database, Transaction, Editor. All Civil 3D namespaces are auto-imported. Return a value to get results back as JSON. Use this for operations that MODIFY the drawing (create, edit, delete objects).
Inputs: code (required), description.
civil3d_queryA
Execute C# code in Civil 3D in READ-ONLY mode (no changes saved). Available globals: Document, CivilDoc, Database, Transaction, Editor. 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).
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), category, query, skillName.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: civil3d_execute for modifying drawings, civil3d_query for read-only queries, and civil3d_skills for browsing code templates. There is no overlap or ambiguity.
All tools follow a consistent 'civil3d_' prefix pattern with an action word. Two use verbs (execute, query) and one uses a noun (skills), which is a minor inconsistency, but the naming remains predictable and clear.
With 3 tools, the server is well-scoped for its purpose of executing C# code in Civil 3D. Each tool serves a necessary role: write access, read access, and skill templates. No extraneous tools.
The tool set covers the core operations for the meta-domain of code execution (read, write, and reference templates). However, it relies on the agent to write code for specific Civil 3D operations, so domain-specific completeness is limited but acceptable for the stated purpose.
Maintenance
Related MCP Connectors
- AutoMEPDeprecatedapp.automep
Edit AutoCAD and Revit MEP drawings from Claude or ChatGPT in plain English.
Read, query, edit and render DWG drawings with AI. No AutoCAD required.
AI Hub for AEC — 50+ 3D formats, clash detection, ACC integration via Autodesk Platform Services.
Connects AI assistants to QCDatabase.AI for everyday construction quality-control work.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to write and execute C# code directly inside Autodesk Civil 3D, providing full API access through code generation and execution.1101MIT
- 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