Skip to main content
Glama
OpenFab MCP

OpenFab MCP

by HB-0921

OpenFab MCP

English | 简体中文

An open-source MCP toolkit for industrial manufacturing workflows, starting with FANUC robot programs and STEP CAD files.

OpenFab MCP v0.1.0 is an offline-first engineering toolkit. It turns common manufacturing engineering files into structured, auditable data and exposes the same capabilities through Python integration functions, a CLI, and an MCP server.

Problem

AI coding agents can already work effectively with source code and developer tooling, but traditional manufacturing engineering files and offline robot programs still lack an open, standardized, auditable tool layer for agents.

OpenFab starts with two practical formats:

  • FANUC .LS robot program source

  • STEP / STP CAD files

The goal of v0.1.0 is not robot control. It is a small, inspectable offline engineering workflow for parsing, analysis, linting, and draft generation.

Related MCP server: Fusion360 MCP Server

Architecture

Codex / Claude / MCP Clients
            ↓
       OpenFab MCP
       /         \
    FANUC        CAD
      ↓           ↓
   .LS files   STEP/STP

Internally, the CLI and MCP server share the same service boundary:

CLI ─┐
     ├→ services.py → FANUC / STEP
MCP ─┘

See docs/ARCHITECTURE.md for the integration design.

Current capabilities

FANUC .LS

  • parse .LS source

  • inspect program structure

  • preserve source-oriented program semantics without aggressive guessing

  • lint UFRAME_NUM, UTOOL_NUM, and P[...] references

  • detect missing and duplicate positions

  • check J / L motion forms

  • check basic speed formats

  • check CNT / FINE termination forms

  • generate explicitly offline .LS drafts from structured input

STEP / STP

  • STEP schema and selected Part-21 header metadata

  • topology counts: solids, shells, faces, edges, wires, vertices, compsolids, compounds

  • bounding box

  • overall X / Y / Z dimensions

  • volume when reliably available

  • center of mass when reliably available

  • basic B-Rep statistics such as surface area and total edge length

STEP geometry is handled by Open CASCADE Technology through the cadquery-ocp-novtk package. See docs/CAD_STEP_LIMITS.md for explicit limits.

MCP tools

  • step_analyze

  • fanuc_parse_ls

  • fanuc_lint_ls

  • fanuc_generate_ls_draft

CLI commands

openfab fanuc parse <file.ls> [--json]
openfab fanuc lint <file.ls> [--json]
openfab fanuc generate <draft.json> [-o output.ls] [--json]
openfab step analyze <file.step|file.stp> [--json]
openfab --version

The MCP stdio entry point is:

openfab-mcp

Installation

OpenFab requires Python 3.11 or newer.

Base install: MCP server, CLI, and FANUC text functionality. This does not install OCCT/OCP.

pip install -e .

Add STEP/STP analysis:

pip install -e ".[step]"

Install all OpenFab runtime functionality:

pip install -e ".[all]"

For development and tests, install runtime functionality plus development tools:

pip install -e ".[all,dev]"

Examples

Parse a known-good offline FANUC example:

openfab fanuc parse examples/fanuc/sample_ok.ls --json

Lint the intentionally malformed example:

openfab fanuc lint examples/fanuc/sample_bad.ls --json

Generate an offline draft from structured JSON:

openfab fanuc generate examples/fanuc/draft.json -o openfab_draft.ls

Analyze the included 10 × 20 × 30 mm STEP box:

openfab step analyze examples/step/box_10x20x30.step --json

The repository examples are synthetic/offline fixtures and are not real production robot programs.

MCP server

Start the stdio server:

openfab-mcp

The server exposes the same integration functions used by the CLI. MCP protocol tests use the official MCP Python SDK v2 in-memory client (from mcp import Client) against the server object directly.

See docs/API.md for the current data/API notes.

Safety

OpenFab MCP v0.1.0 is designed for offline engineering analysis and draft preparation.

It:

  • does not connect to real FANUC controllers

  • does not upload programs

  • does not execute robot motion

  • does not validate reachability

  • does not validate collision safety

  • does not validate DCS or other safety systems

  • treats generated LS output as an offline draft only

Generated robot programs require review and validation by qualified personnel using appropriate FANUC tooling and simulation before any real-world use.

Testing

The release CI installs dependencies in a clean environment and runs the full test suite on Python 3.11, 3.12, and 3.13 on Ubuntu, plus Python 3.12 on a GitHub-hosted macOS ARM64 runner.

Local release checks:

pip install -e ".[all,dev]"
pytest
python -m compileall src
python -m build

Documentation

License

OpenFab MCP is licensed under the Apache License 2.0. See LICENSE.

Third-party components retain their own licenses and copyright. See docs/THIRD_PARTY_LICENSES.md.

Available Tools

4 tools
fanuc_generate_ls_draftB

Generate an explicitly non-production FANUC LS offline draft from structured input.

Inputs: draft (required). Returns: object

fanuc_lint_lsB

Lint FANUC LS source offline and return structured diagnostics.

Inputs: path, text. Returns: object

fanuc_parse_lsA

Parse FANUC LS source from exactly one local .ls path or LS text string.

Inputs: path, text. Returns: object

step_analyzeA

Analyze a local STEP/STP file offline. No CAM, deployment, or robot control is performed.

Inputs: path (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 4 tools

    Disambiguation4/5

    step_analyze is clearly distinct from the FANUC LS tools, and the three fanuc_ tools have reasonably distinct outputs: parse returns structure, lint returns diagnostics, generate produces a draft. fanuc_parse_ls and fanuc_lint_ls both consume LS source, so a small amount of overlap exists.

    Naming Consistency4/5

    The FANUC tools follow a consistent fanuc_<verb>_ls pattern, but step_analyze breaks the convention by placing the object before the verb and omitting a domain prefix. The overall naming is readable and mostly predictable.

    Tool Count5/5

    Four tools is appropriate for this narrow offline manufacturing scope. Each tool serves a distinct purpose: STEP analysis, LS parsing, LS linting, and LS draft generation.

    Completeness4/5

    The set covers the core offline workflow for STEP analysis and FANUC LS handling: parse, lint, and generate. Minor gaps exist, such as no direct STEP-to-LS conversion or LS editing utilities, but the explicit offline/non-production scope keeps the surface reasonable.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Connects AI coding agents to Autodesk Fusion 360 for CAD/CAM automation, exposing 84 tools for sketching, modeling, assembly, inspection, export, and G-code post-processing through any MCP-compatible client.
      85
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables conversational creation and editing of STEP CAD models through MCP clients like Codex, Claude, or Cursor, with real-time 3D browser preview and tools for primitives, booleans, mounting holes, flanges, and gripper bases.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI clients such as Claude Desktop, Cursor, and Copilot to connect over MCP STDIO to CAD/CAE/CAM tooling for natural-language parametric shape synthesis, CSG script generation, solid watertightness validation, error analysis, and autonomous correction.
      MIT