Skip to main content
Glama
mcp-cad-viewer

mcp-cad-viewer

by gladiatorAsh

mcp-cad-viewer

An MCP server that opens CAD parts in an interactive 3D viewer inside the chat, using MCP Apps.

Most MCP tools answer with text. For mechanical engineers that's the wrong shape: "the bracket is 20 × 10 × 5 mm with 12k triangles" is less useful than the bracket itself. view_part returns a summary the model can reason about and a View the host renders in a sandboxed iframe, where you can rotate and zoom the part.

Status: early. The server, the STL pipeline and the View are working and smoke-tested. Next up is testing in real MCP Apps hosts and adding STEP support. See the roadmap.

How it works

model ──calls──▶ view_part(path)                         host (Claude, VS Code, ChatGPT…)
                   │                                         │
                   ├─ text: "12 triangles, 20 × 10 × 5"  ───▶│ shown to the model
                   ├─ structuredContent: summary + STL   ───▶│ passed to the View
                   └─ _meta.ui.resourceUri ──────────────────▶ fetches ui://cad-viewer/viewer.html
                                                             └─ renders it in a sandboxed iframe
                                                                (three.js, orbit controls)
  • Server (src/server.ts): MCP TypeScript SDK v2. serveStdio negotiates the protocol era per connection, so the same server works with 2025-era clients and stateless 2026-07-28 clients.

  • View (view/): uses the App class from @modelcontextprotocol/ext-apps to receive the tool result and three.js to render it. It's bundled with esbuild and inlined into one HTML resource, so it needs no network access and no CSP exceptions.

  • Safety: files are only read from inside CAD_VIEWER_ROOT. Path traversal is rejected, and parts are capped at 8 MB.

Related MCP server: CAD MCP Server

Try it

npm install
npm run smoke        # builds, starts the server, calls view_part on samples/bracket-block.stl

Add it to an MCP Apps–capable host (stdio):

{
  "mcpServers": {
    "cad-viewer": {
      "command": "npx",
      "args": ["-y", "mcp-cad-viewer"],
      "env": { "CAD_VIEWER_ROOT": "/path/to/your/parts" }
    }
  }
}

Then ask: "Show me bracket-block.stl".

With a CAD server

Root this viewer and a CAD server at the same folder, and "export it as STL and show it to me" ends with the part in the chat. freecad-mcp-server even returns the exact view_part call after an STL export. Its README has the full config and demo prompt.

Roadmap

  • view_part tool with STL parsing (ASCII and binary), bounding box and triangle count

  • Bundled three.js View delivered as an MCP Apps ui:// resource

  • Smoke test through a real MCP client

  • Release workflow: tag to publish on npm (with provenance) and the official MCP Registry

  • Verify rendering in Claude, VS Code and ChatGPT; follow the host's theme

  • STEP and IGES support (OpenCascade.js, converted server-side to a mesh)

  • Measurement tools in the View: click two points for a distance, section planes

  • View-to-server calls: "highlight the face I clicked" goes back to the model as context

  • Streamable HTTP transport and a hosted demo on free infrastructure

  • Shrink the View bundle (tree-shake three.js, lazy-load loaders)

License

MIT © Ashutosh Singh

Available Tools

1 tool
view_partView CAD partA

Open an STL part in an interactive 3D viewer (rotate, zoom, measure the bounding box). Returns a text summary with triangle count and dimensions as well.

Inputs: path (required).

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 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of misselection; its purpose (open an STL in an interactive 3D viewer) is unambiguous and self-contained.

    Naming Consistency5/5

    The single name view_part follows a clear verb_noun snake_case convention that reads predictably and would scale well if more tools were added.

    Tool Count3/5

    One tool is thin for a CAD viewer surface; realistic use cases like re-viewing, closing a session, or exporting a screenshot have no counterpart, though the scope itself is narrow enough that a single entry point is defensible.

    Completeness3/5

    The tool covers a single format (STL) and a single action (view/measure), with no support for other CAD formats, section/measurement beyond the bounding box, or capture/export of the view. These are notable gaps an agent cannot work around, though the core stated purpose is met.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Give your AI assistant the ability to inspect, measure, and compare 3D CAD models by dropping in a STEP file and asking engineering questions. Runs entirely on your machine with no cloud, no CAD license, and no setup.
      5
      160 npm
      6
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables reading, analyzing, and editing CAD files (DXF and DWG) via natural language, including entity queries, layer management, and safe copy-based edits.
      17
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables an AI assistant to open 3D model files (STL, 3MF, Bambu Studio and OrcaSlicer projects) in a local browser viewer where the user clicks exact spots to leave feedback. Each note comes back with the part name, millimetre coordinates, surface direction and a numbered screenshot, so the assistant can revise the design and show the new version.
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to build and edit native CAD parts and assemblies, inspect saved geometry and measurements, retain revisions, run mechanism and interference checks, and export STEP/STL/GLB artifacts through MCP tools.
      MIT