LCS CAD MCP

LCS CAD MCP

Exposes Pre-DCR and Auto-DCR building scrutiny workflows as AI-consumable tools, enabling AI assistants to open DXF drawings, validate layers, compute areas, run regulatory checks, and generate compliance reports via natural language.

Category
访问服务器

README

LCS CAD MCP

An MCP (Model Context Protocol) server that exposes Pre-DCR and Auto-DCR building scrutiny workflows as AI-consumable tools. Designed to let AI assistants (Claude, etc.) open DXF drawings, validate layer conventions, compute areas, run regulatory rule checks, and generate compliance reports — all via natural language.

What it does

  • PreDCR setup — creates standardised layers (PREDCR-WALL-EXT, PREDCR-PLOT, etc.) and validates drawings against authority naming conventions
  • Entity management — draws polylines, lines, arcs, circles, text and blocks; moves, copies, deletes and queries entities
  • Area computation — calculates plot area, built-up area, carpet area, FSI and ground coverage using Shapely polygons
  • AutoDCR scrutiny — evaluates FSI, ground coverage, setbacks, parking ratios and height restrictions against loaded DCR rule configs
  • Report generation — produces PDF, DOCX and JSON compliance reports
  • Workflow archival — stores scrutiny runs, tool events and audit trails in SQLite

Architecture

src/lcs_cad_mcp/
├── modules/
│   ├── cad/          # Drawing lifecycle (open, new, save, backend selection)
│   ├── layers/       # Layer CRUD + property management
│   ├── predcr/       # PreDCR layer catalog and validation
│   ├── entities/     # Entity draw/query/edit tools
│   ├── verification/ # Closure, containment, naming and count checks
│   ├── area/         # FSI, coverage and area computation (Shapely)
│   ├── config/       # DCR rule config load and validation
│   ├── autodcr/      # Rule evaluation engine + dry-run mode
│   ├── reports/      # PDF/DOCX/JSON report generation
│   └── workflow/     # Pipeline orchestration and audit trail
├── backends/
│   ├── ezdxf_backend.py   # Cross-platform DXF backend (primary)
│   └── com_backend.py     # Windows AutoCAD COM backend (optional)
├── rule_engine/      # DCRConfig Pydantic models + RuleEvaluator
├── archive/          # SQLAlchemy ORM models + repository
└── session/          # DrawingSession context + SnapshotManager

Transport: stdio (default) and SSE supported via FastMCP 3.x.

Requirements

  • Python 3.11+
  • uv (recommended) or pip

Installation

git clone <repo-url>
cd lcs-cad-mcp
uv sync

For development dependencies (pytest, ruff):

uv sync --extra dev

Running the server

stdio (for Claude Desktop / MCP clients)

uv run python -m lcs_cad_mcp

SSE

uv run python -m lcs_cad_mcp --transport sse --port 8000

Claude Desktop integration

See docs/claude-desktop-config.md for the full config snippet. Quick version:

{
  "mcpServers": {
    "lcs-cad": {
      "command": "uv",
      "args": ["run", "--project", "/path/to/lcs-cad-mcp", "python", "-m", "lcs_cad_mcp"]
    }
  }
}

DCR Rule configs

YAML or JSON configs define the regulatory rules evaluated during scrutiny. Example:

version: "1.0.0"
authority: "MCGM"
effective_date: "2024-01-01"
rules:
  - rule_id: "FSI_001"
    name: "Max FSI"
    rule_type: "FSI"
    threshold: 1.5
    unit: "ratio"
    zone_applicability: ["R1", "R2"]

Sample configs are in dcr_configs/. Full schema: docs/dcr-config-schema.md.

Available MCP tools

Category Tools
CAD cad_ping, cad_open_drawing, cad_new_drawing, cad_save_drawing, cad_select_backend
Layers layer_create, layer_delete, layer_get, layer_list, layer_set_properties, layer_set_state
PreDCR predcr_run_setup, predcr_get_layer_spec, predcr_list_layer_specs, predcr_validate_drawing
Entities entity_draw_polyline, entity_draw_line, entity_draw_arc, entity_draw_circle, entity_add_text, entity_insert_block, entity_move, entity_copy, entity_delete, entity_change_layer, entity_close_polyline, entity_query
Verification verify_closure, verify_containment, verify_naming, verify_min_entity_count, verify_all
Area area_compute_plot, area_calculate, area_compute_builtup, area_compute_carpet, area_compute_fsi, area_compute_coverage
Config config_load, config_validate
AutoDCR autodcr_run_scrutiny, autodcr_dry_run
Reports report_generate_pdf, report_generate_docx, report_generate_json
Workflow workflow_retrieve_run, workflow_get_audit_trail, workflow_run_pipeline

Full API reference: docs/tool-api-reference.md.

Testing

uv run pytest

173 tests across unit and integration suites. Backends, services, rule engine and archive are all covered.

Windows / AutoCAD COM backend

The COM backend enables live interaction with a running AutoCAD instance on Windows. See docs/windows-deployment-guide.md.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选