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 "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., "@Civil3D MCP Servercreate 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: revit-mcp
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).
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | C# code to execute. Has access to Document, CivilDoc, Database, Transaction, Editor. Example: var id = TinSurface.Create(Database, "MySurface"); return new { success = true }; | |
| description | No | Brief description of what this code does (for logging/audit trail). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations, but description covers transaction context, available globals, auto-imports, and JSON return. Good disclosure of execution environment, though lacks error handling details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four concise sentences, each providing unique value. Front-loaded with purpose. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Comprehensive for a code execution tool: covers purpose, transaction, globals, return format, and modification scope. Absence of output schema mitigated by description of JSON return.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers both parameters fully (100% coverage). Description reinforces code purpose with example but adds limited new semantic value beyond schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states verb 'Execute' and resource 'C# code in Civil 3D'. Distinguishes from siblings by emphasizing write access and modification, contrasting with query tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use: 'for operations that MODIFY the drawing'. Implies not for read-only, but could be more explicit about not using for queries.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | C# code to query data. Has access to Document, CivilDoc, Database, Transaction, Editor. Example: 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; |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It clearly states READ-ONLY mode and lists available globals (Document, CivilDoc, Database, Transaction, Editor) and notes that all Civil 3D namespaces are auto-imported. It also explains how to return results as JSON. However, it does not mention error handling, performance implications, or any limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with three sentences, each serving a distinct purpose: stating the read-only mode, listing globals, and providing usage guidance. There is no redundant or unnecessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (code execution) and single parameter, the description covers all needed aspects: read-only guarantee, available globals, auto-imported namespaces, and how to return results. No output schema exists, but the description explains the JSON return format. It is complete for safe and correct usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There is only one parameter 'code' with a schema description that includes an example. The description adds value by specifying the available globals and auto-imported namespaces, which are not in the schema. Since schema coverage is 100%, baseline is 3, but the added context justifies a 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool executes C# code in Civil 3D in READ-ONLY mode, with a specific verb and resource. It distinguishes from siblings by emphasizing read-only querying vs. execution, and the sibling names (civil3d_execute, civil3d_skills) further clarify the differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Use this for querying data: listing objects, getting properties, analyzing surfaces, etc.' This provides clear when-to-use guidance. It does not explicitly state when not to use it, but the READ-ONLY mode and sibling names imply it is not for modifications. A small gap in not naming the alternative directly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | list = show all skills, search = find by keyword, get = read full skill | |
| category | No | Filter by category (surfaces, alignments, points, etc.) | |
| query | No | Search query for 'search' action | |
| skillName | No | Skill name for 'get' action |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description is the sole source. It explains the three actions and their purposes, but does not disclose additional behavioral traits such as error handling, pagination, or authentication needs. Adequate but not detailed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with clear front-loading of purpose and actions. No filler or redundancy. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple browse tool with 4 parameters and no output schema, the description covers the essential actions and their usage. It could optionally clarify category usage with list, but overall it is complete enough.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with individual parameter descriptions. The description adds context (e.g., list = show all skills) but does not significantly augment the schema's own descriptions. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Browse and read Civil 3D code skills' and lists three specific actions (list, search, get) with brief explanations. Distinguishes from siblings by focusing on browsing/reading versus execution/query.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly mentions that skills are 'pre-built C# patterns you can adapt and execute via civil3d_execute or civil3d_query', providing clear when-to-use vs alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
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
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.
Convert Revit files to XKT, IFC, or DWG and query BIM data via natural language.
Give your AI agents the tools to build, manage, and run automation workflows.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Autodesk Construction Cloud (ACC) projects through natural language, allowing users to query project data, manage issues and RFIs, browse files, and automate construction workflows directly from their development environment.1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Autodesk Revit to query project data, manage elements, and execute generated code via the Model Context Protocol. It provides full compatibility with GitHub Copilot and Claude to automate BIM modeling workflows.1391MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to write and execute C# code directly inside Autodesk Civil 3D, providing full API access through code generation and execution.102MIT
- AlicenseAqualityBmaintenanceEnables 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.92MIT
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/barbosaihan/civil3d-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server