Skip to main content
Glama

English | 简体中文

maycad-mcp

Deterministic Python SDK, CLI, and 75-Tool MCP Server for Autonomous AI-Driven MayCAD (MayTec) 3D Aluminum Profile Engineering

Python 3.10+ Platform Windows x64 MayCAD 12.10 MCP Tools 75 License MIT

maycad-mcp enables AI agents (Claude Code, Claude Desktop, Codex, Cursor, Antigravity, or any MCP client) and Python/CLI automation scripts to design, inspect, validate, modify, render, and export industrial MayTec aluminum extrusion assemblies programmatically—with zero simulated mouse clicks, zero screen-coordinate clicking, and zero vision-based GUI scraping.

IMPORTANT

Independent Open-Source Bridge: maycad-mcp does not redistribute any proprietary MayCAD binaries, library.zip bytecode, or .bindata catalog databases. It requires a legally installed, licensed copy of MayCAD 64-bit on Windows and leaves all original installation files 100% unmodified.


Live Verified Showcases

1. Eight-Corner Poly-Joint Test Frame (800 × 600 × 600 mm, PROF40-4040L)

Built autonomously end-to-end through the live MCP STDIO protocol (examples/eight_corners_demo/build_eight_corners.py): all eight corners of a cube frame use eight distinct MayTec joining methods simultaneously—without collisions (0 interference) and producing a 19-row native MayTec BOM.

Eight-Corner Frame Showcase

Corner

Connection Type

MayTec Profile / Part

Article No.

Corner 1 (Top Front-Left)

3-Way Sphere Corner Piece

CORNER40_SPHERE

1.48.448

Corner 2 (Top Front-Right)

3-Way Cubic Black Corner Piece

CORNER40_CUBIC-BK

1.48.441.2

Corner 3 (Top Back-Left)

3-Way Segment Corner Piece

CORNER40_SEGMENT

1.48.442

Corner 4 (Top Back-Right)

45° Polyamide Corner Piece

CORNER40_45-PA

1.48.14440

Corner 5 (Bottom Front-Left)

Cast Gusset Brackets + Fasteners

JE_GUS_3876_PC

1.46.204.3876.2

Corner 6 (Bottom Front-Right)

Steel 90° Angle Brackets

ACC_ANGLE_1.46.20639

1.46.20639

Corner 7 (Bottom Back-Left)

45° Mitered Diagonal Struts (294.56 mm)

PROF40-4040L

1.11.040040.43LP

Corner 8 (Bottom Back-Right)

Internal Concealed Connectors + Plastic Endcap

1.21.4EK1 / 1.21.4E0 + CAP40SQ4040

1.42.20404.2

2. Parametric Heavy Industrial Workbench (2000 × 800 × 900 mm → 2400 × 800 × 900 mm)

Verified across a full 17-step live MCP acceptance suite (Acceptance Report): parametric creation, real catalog lookup, outer-envelope vs. cut-length accounting (1920 / 720 / 844 mm → 2320 mm), automatic SceneMap.postprocess fastening (20/20 connectors), 3D OBB SAT collision checking (0 collisions), 6 m bar cutting optimization (85.42% utilization), headless OpenGL FBO multi-view rendering, native PDF drawing (615,274 bytes), 3-view DXF + panel DXF, and transfer.exe-verified AP214 STEP solid export (162,440 bytes, 184 vertices / 276 faces).

Heavy Workbench Isometric Render


Related MCP server: Adlor MCP CAD

Why Deterministic Architecture Instead of UI Automation?

Deep technical inspection of MayCAD 12.10 (Build: 292, RESEARCH.md) confirmed:

  • framedesigner.exe (py2exe, CPython 2.7.18 x64 + PyQt4 4.11.4) provides no official public SDK, CLI modeling mode, COM/ActiveX interface, Named Pipe, or local HTTP control API; -test and -docserver branches in bytecode are permanently disabled by hardcoded BRANCH_UID checks.

  • Windows UI Automation (UIAutomation) inspects the live QGLWidget viewport and sees only 24 generic Pane nodes with zero clickable menu/button/input controls.

  • However, the native .scene v14 format (XML / AES-256-CBC wrapper) is lossless and deterministic, and loading the unmodified C:\Program Files\MayTec\MayCad-64\python27.dll inside an isolated child worker process gives direct headless access to MayCAD's native app.Application(False), catalog.fdcache.FDCache, SceneMap.postprocess, BillMaytec, CutList, DxfPanelExporter, FdConstructionDocDrawable, and hardware OpenGL FBO pdf_get_frame_image.

flowchart LR
    Agent["AI Agent / MCP Client<br/>(Claude, Codex, Cursor, Antigravity)"] -->|STDIO / Streamable HTTP<br/>75 MCP Tools| MCP["maycad_mcp.server<br/>(FastMCP / MCPServer)"]
    CLI["maycad CLI / Python Scripts"] --> SDK["maycad_mcp.sdk<br/>(MayCADSDK)"]
    MCP --> SDK
    SDK --> Scene["Scene Codec &amp; Geometry<br/>(v14 XML/AES + 3D OBB SAT + Millimeter Units)"]
    SDK --> Catalog["Read-Only Product Catalog<br/>(fdcatalogMAYTEC.bindata)"]
    SDK --> Worker["Py27Worker Client<br/>(127.0.0.1 TCP + Token Auth)"]
    Worker --> Py27["Isolated Child Process<br/>(python27.dll + app.Application)"]
    Py27 --> MayCAD["Local MayCAD 12.10<br/>(Unmodified Install Dir)"]
    SDK --> Exporters["AP214 STEP / DXF / BOM / CutList / PDF / Report"]
    Exporters -->|transfer.exe validation| MayCAD

Capability & Honest Boundary Matrix

Capability

Status

Implementation & Verified Notes

Read / Write .scene v14 (Plain XML & Encrypted Binary)

Verified

Lossless roundtrip against 13 contrast scenes + official Board.scene (docs/SCENE_FORMAT.md)

Native MayCAD Kernel Execution (python27.dll)

Verified

Persistent loopback-TCP child process with token auth, crash/timeout cleanup, stale PID lock recovery

Real MayTec Product Catalog Search

Verified

Reads fdcatalogMAYTEC.bindata (96.8 MB): profiles, Ix/Iy, slot width, connectors, endcaps, feet, casters, brackets, screws, hinges, handles, panels

Missing Catalog Fields (cross_section_area_mm2, alloy)

Honest null

fdcatalogMAYTEC.bindata does not include net area or alloy grade; SDK explicitly returns null rather than guessing

3D Modeling, Assembly & 13 Parametric Templates

Verified

Distinguishes outer envelope vs. centerline vs. exact cut length; supports linked parameter resize (design_update_parameters)

3D Interference & Missing Connector Checks

Verified

OBB SAT collision check, joint detection, duplicate check, auto-connect via SceneMap.postprocess

Native BOM, CutList, DXF & Headless PDF Drawing

Verified

BillMaytec CSV/JSON/XML, FFD 6 m bar cutlist optimization, 3-view DXF + DxfPanelExporter, ReportLab PDF

AP214 Solid B-Rep STEP Export

Verified (Local)

MayCAD cloud STEP API returns HTTP 502/404; local pure-Python local_ap214 solid B-Rep exporter passes transfer.exe STEP→OBJ verification (envelope solids; see Known Issues)

Headless OpenGL FBO Viewport Screenshots

Verified (Ortho)

Uses native pdf_get_frame_image hardware OpenGL FBO with auto-scaled camera distance (>= 2000 cm); always renders orthographic projection

Euler-Bernoulli Deflection & Stress Heuristic

Heuristic Only

Uses real catalog Ix/Iy with assumed E = 70000 MPa, yield 160 MPa; always sets certified_safety_approval: false

Visual Clicking / Screen-Coordinate Automation

Zero

Audited all 58 src/maycad_mcp/**/*.py files (0 hits); UI backend is read-only dialog monitoring & optional preview launch


75 MCP Tools Overview

All 75 tools across 9 functional domains are documented in detail in docs/TOOLS.md:

Domain

Module

Count

Key Capabilities

System & Session

system_tools.py

6

Diagnostics (maycad_run_diagnostics), version, capabilities, active project, GUI preview launch

Project Lifecycle

project_tools.py

11

Create, open, save, save-as, inspect, object tree, snapshot, rollback, validate, undo, redo

Catalog

catalog_tools.py

6

Search profiles/connectors/accessories, inspect profile/connector specs, query compatibility

3D Modeling

modeling_tools.py

12

Add profile by origin or 2 points, modify, move, rotate, copy, mirror, linear/circular array, batch execute

Assembly

assembly_tools.py

10

Add connectors/panels/endcaps/feet/casters/corner pieces/brackets, detect joints, auto-connect, validate

Parametric Design

design_tools.py

7

create_frame, create_workbench, create_rack, create_gantry, create_enclosure, create_custom_structure, update_parameters

Engineering Analysis

analysis_tools.py

10

Collision check, connectivity, envelope dimensions, duplicates, missing connectors, weight, bbox, beam deflection, cut optimizer, profile recommender

Exporters

export_tools.py

6

export_step, export_dxf, export_bom, export_cutlist, export_drawing (PDF), export_project_report (MD + JSON)

3D Visualization

view_tools.py

7

Headless OpenGL FBO screenshots, camera aim, projection state, isolate objects, highlight objects, fit-all, 6 standard views


Requirements

  • OS: Windows 10 / 11 (64-bit)

  • MayCAD: Local licensed installation of MayCAD 64-bit (tested on MayCAD 12.10 Build 292 at C:\Program Files\MayTec\MayCad-64; override via MAYCAD_INSTALL_DIR environment variable if installed elsewhere)

  • Python: Python >= 3.10 (recommended 3.13 via uv or standard venv)

  • OpenGL: Working Windows OpenGL graphics driver for headless FBO rendering (view_* and export_drawing)


Installation & Quick Start

1. Clone and Install

git clone https://github.com/wubianluori/maycad-mcp.git
cd maycad-mcp
.\scripts\install.ps1

If MayCAD is installed in a custom directory:

$env:MAYCAD_INSTALL_DIR = "D:\Program Files\MayTec\MayCad-64"
.\scripts\install.ps1

2. Verify Health Diagnostics & Run Tests

# Check MayCAD installation, Py27 kernel, catalog DB, OpenGL FBO, and transfer.exe
.\scripts\health_check.ps1

# Run the complete unit and live MayCAD integration suite
.\scripts\run_tests.ps1

3. Start the MCP Server

# Default: STDIO transport (for AI desktop/IDE clients)
.\scripts\start_mcp.ps1

# Streamable HTTP transport (localhost-bound, recommended with Bearer token)
.\scripts\start_mcp.ps1 -Transport streamable-http -HostAddr 127.0.0.1 -Port 8765 -AuthToken "your-secret-token"

4. Connect Your AI Client

Ready-to-edit client templates are provided in configs/ and explained in docs/CLIENTS.md:

Replace C:\path\to\maycad-mcp in the chosen config with your cloned directory path and set PYTHONUTF8=1.


CLI & Python SDK Usage

Standalone CLI (maycad)

The CLI works completely independently of the MCP Server with UTF-8 Chinese path support, --json, --dry-run, --timeout, and automatic .maycad_backups/ write protection (docs/CLI.md):

# Inspect environment
maycad doctor --json

# Search catalog & inspect profile moments of inertia
maycad catalog search 4040 --series 40 --json
maycad catalog profile PROF40-4040L --json

# Generate a 2000 x 800 x 900 mm workbench, resize to 2400 mm, export STEP & BOM & screenshot
maycad design create-workbench --output bench.scene --length 2000 --width 800 --height 900 --json
maycad design update-parameters --project bench.scene --params-json '{"length_mm": 2400}' --output bench_2400.scene --json
maycad export step --project bench_2400.scene --output bench_2400.step --json
maycad export bom --project bench_2400.scene --output bom.csv --format csv --json
maycad view screenshot --project bench_2400.scene --output iso.png --view isometric --width 900 --height 900 --json

Python SDK (MayCADSDK)

from maycad_mcp.sdk import MayCADSDK

sdk = MayCADSDK()
status = sdk.run_diagnostics()
assert status["ok"]

# Create a parametric frame and auto-connect joints with native MayTec connectors
sdk.create_frame("cube.scene", frame_type="cube_frame", length_mm=800, width_mm=600, height_mm=600)
sdk.auto_connect("cube.scene", style="internal")

# Run geometry interference check, export STEP + BOM, and render isometric PNG
collisions = sdk.check_collision("cube.scene")
sdk.export_step("cube.scene", "cube.step")
sdk.export_bom("cube.scene", "cube_bom.json", fmt="json")
sdk.screenshot("cube.scene", "cube_iso.png", view="isometric", width=960, height=960)

Repository Structure

maycad-mcp/
├── src/maycad_mcp/
│   ├── sdk/                # Unified MayCADSDK public facade
│   ├── server.py           # Official MCP Server (STDIO & Bearer Streamable HTTP)
│   ├── cli.py              # Standalone `maycad` CLI
│   ├── tools/              # 75 MCP tools across 9 domain modules
│   ├── backends/           # Isolated python27.dll loopback-TCP worker, safety locks, read-only UI monitor
│   ├── scene/              # .scene v14 XML + AES-256-CBC lossless parser & atomic writer
│   ├── catalog/            # Read-only interface over fdcatalogMAYTEC.bindata
│   ├── geometry/           # Millimeter coordinate transforms, outer/centerline/cut envelopes, OBB SAT, joints
│   ├── modeling/           # Add, move, rotate, resize, copy, mirror, array, batch operations
│   ├── assembly/           # Connectors, panels, endcaps, leveling feet, casters, corner pieces, brackets
│   ├── parametric/         # 13 parametric frame/workbench/gantry/enclosure topologies & linked updates
│   ├── analysis/           # Interference, missing connectors, 1D FFD cut optimizer, beam deflection heuristic
│   ├── exporters/          # AP214 STEP (transfer.exe verified), DXF, BOM, CutList, PDF, Markdown/JSON reports
│   └── visualization/      # Headless hardware OpenGL FBO screenshot controller
├── tests/
│   ├── unit/               # Unit tests for catalog, geometry, safety locks, .scene roundtrip
│   ├── integration/        # Live Py27 kernel, catalog, SDK E2E, exporters/CLI, STDIO MCP tests
│   └── fixtures/           # 13 minimal contrast .scene fixtures & diff summary
├── examples/
│   ├── workbench_acceptance/ # 17-step live MCP workbench acceptance suite & exports
│   └── eight_corners_demo/   # 8-distinct-corner cube frame built live via MCP STDIO
├── configs/                # Ready-to-use MCP client configurations
├── scripts/                # PowerShell install, health check, test, and launch helpers
├── docs/                   # SCENE_FORMAT.md, TOOLS.md, CLI.md, CLIENTS.md, TROUBLESHOOTING.md, roadmap
├── RESEARCH.md             # Deep reverse-engineering & architecture research report on MayCAD 12.10
├── CHANGELOG.md            # Release changelog
└── LICENSE                 # MIT License

Documentation Index


  • maycad-mcp is released under the MIT License.

  • MayCAD and MayTec are trademarks of MayTec Aluminium Systemtechnik GmbH. This project is an independent third-party automation and interoperability bridge and is not affiliated with or endorsed by MayTec.

  • Users must hold a valid local license for MayCAD to run live kernel operations. No proprietary MayCAD executables, DLLs, bytecode archives, or product databases are included in this repository.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that gives AI agents genuine 3D spatial understanding of Autodesk Fusion 360, enabling exact measurements, collision analysis, and free-space placement search, plus Fusion-native parametric authoring for clean, human-editable models.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An open-source MCP server that bridges AI agents to Autodesk Revit and IFC geometry, providing ASME B31.3 pipe thickness verification, UK HSE Legionella compliance auditing, and 3D BIM property inspection.
      1
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      A local MCP server that lets coding agents turn conversational prompts into deterministic, re-runnable recipes for 3D objects, walkable worlds, and playable games, all stored on your own disk without API keys or cloud rendering. Those recipes can be edited in place and exported to the browser, Godot, Unity, Unreal, Blender, glTF/OpenUSD, or print-ready STL and 3MF at true scale.
      3
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to perceive, navigate, interact with, and build inside Minecraft through typed, bounded operations, including deterministic blueprints, verified builds, repair, and creative-mode flight or teleport. Runs as a provider-neutral MCP server or an interactive dev shell, exposing movement, voxel manipulation, inventory, chat, and diagnostics tools.
      3
      Apache 2.0