Skip to main content

gNucleus Text-To-CAD MCP server - transforms text and images into editable CAD models

Project description

gNucleus Text To CAD MCP server

gNucleus is a Generative AI platform that transforms text and images into editable CAD models.

This repository contains the gNucleus Text-To-CAD MCP server, which connects to the gNucleus API. It allows MCP clients to generate CAD parts or assemblies from text input using gNucleus’s GenAI models.

Prerequisites

  • Python 3.7+
  • gNucleus Developer Accounts with:
    • gNucleus API key

Setup

  1. Clone this repository

  2. Create and activate a virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Create a .env file in the root directory with the following variables:

    Invidisual User

    GNUCLEUS_HOST="genai.gnucleus.ai"
    GNUCLEUS_API_KEY=<your-personal-api-key>
    

    Enterprise User

    GNUCLEUS_HOST="genai.gnucleus.ai"
    GNUCLEUS_API_KEY=<your-team-key>
    GNUCLEUS_ORG_ID=<your-team-id>
    

Obtaining gNucleus API KEY

  1. gNucleus Account: sign-up on https://gnucleus.ai/
  2. API KEY: Create a personal access token in gNucleus:
    • Go to User Profile (click your user icon in the top right)
    • Go to "Account"
    • Click "Generate New API Key" to generate a new API KEY
    • Each account start with 200 free API credit

Running the Server

Start the MCP server:

python main.py

You can test the MCP server using the inspector by running

npx @modelcontextprotocol/inspector python3 main.py

Available MCP Tools

The following MCP tools are available:

  • text_to_cad(input: str) - Generate CAD from input

Example Prompt with LLMs

When used with LLMs that support the MCP protocol, this server enables natural language interaction with gNucleus:

1. Text to CAD

  • "draw a block in CAD"
  • "draw a block with length=80mm, width=40mm, height=20mm in CAD"
  • "draw a spur gear shaft in CAD"
  • "draw a spur gear shaft with number_teeth=20 in CAD"
  • "draw an elbow flange in CAD"
  • "draw an elbow flange with number_bolt_holes=4 in CAD"

i18n support: You can use any language as the prompt, in general english works better than other languages, but it should work in general.

  • Chinese: "在CAD中绘制一个大小为10mm的方块"
  • Spanish: "Dibuja un bloque cuadrado de 10 mm en CAD"

2. Text to Assembly

  • "generate a tapered roller bearing using text-to-cad tool"
  • "draw a differential gear box in CAD"

3. Result CAD Display

The generated result include the design spec with Key Parameter, Description and a shared URL with 3D display viewer. The shared URL will be expired in 24 hrs.

Claude Desktop Setup

1. Add or update the Claude Desktop configuration file(claude_desktop_config.json):

virtual python environment

If you use virtual python enviroment, use this config:

{
  "mcpServers": {
    "gnucleus": {
      "command": "/ABSOLUTE/PATH/TO/YOUR/text-to-cad-mcp/.venv/bin/python",
      "args": [
        "/ABSOLUTE/PATH/TO/YOUR/text-to-cad-mcp/main.py"
      ],
      "workingDirectory": "/ABSOLUTE/PATH/TO/YOUR/text-to-cad-mcp",
      "env": {
        "GNUCLEUS_HOST": "genai.gnucleus.ai",
        "GNUCLEUS_API_KEY": "YOUR_API_KEY_HERE",
      }
    }
  }
}

global python environment

If you use global python enviroment and also installed the requirments.txt into your global python enviroment, use this config

{
  "mcpServers": {
    "gnucleus": {
      "command": "python",
      "args": [
        "/ABSOLUTE/PATH/TO/YOUR/text-to-cad-mcp/main.py"
      ],
      "workingDirectory": "/ABSOLUTE/PATH/TO/YOUR/text-to-cad-mcp",
      "env": {
        "GNUCLEUS_HOST": "genai.gnucleus.ai",
        "GNUCLEUS_API_KEY": "YOUR_API_KEY_HERE",
      }
    }
  }
}

2. Save the file and restart Claude Desktop

You should see the gNucleus Text-To-CAD tools in Claude gNucleus Text-To-CAD Tool

3. Chat with Claude to generate the CAD model

Chat with Claude and add "in CAD" in each prompt or tell Claude to use "text-to-cad tools"can help Claude to trigger the Text-To-CAD tool better.

The generated result include the design spec with Key Parameter, Description and a shared link with 3D display viewer. The shared URL will be expired in 24 hrs. If Claude didn't output the shared URL in the chat message, you can ask Claude to always output the shared URL.

Click the shared URL, it will display the CAD model in gNucleus 3D viewer, you can

  • Rotate by holding the left mouse button
  • Pan by holding the right mouse button
  • Zoom using the middle mouse button

Example 1: Text To CAD Part

  • Input and CAD Part design spec Chat with Claude to generate CAD

  • CAD Part in 3D viewer Display the generated CAD model in gNucleus Viewer

Example 2: Text To CAD Assembly

  • Input and CAD Assembly design spec Chat with Claude to generate CAD Assembly

  • CAD Assembly in 3D viewer Display the generated CAD Assembly in gNucleus Viewer

Note: Downloading CAD models from the viewer is not yet supported. To download the model, please log in to https://gnucleus.ai and try the same prompt using the full feature set.

Troubleshooting

CAD Model

If the CAD model looks incorrect or only partially generated, try logging in at https://gnucleus.ai, enter the same prompt, and download the CAD file (e.g., FreeCAD format). Then open it in your CAD software(e.g. FreeCAD ). This issue is often caused by incomplete generation of CAD features within the part.

You can also report a bug or contact us with the model link and prompt at https://gnucleus.ai/contact.

Security Considerations

  • Secure your .env file and never commit it to github
  • Run this server in a secure environment

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_gnucleus_text_to_cad_mcp-0.1.1.tar.gz (524.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_gnucleus_text_to_cad_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: iflow_mcp_gnucleus_text_to_cad_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 524.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_gnucleus_text_to_cad_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1ca0cb30e3031bd3baa972498ac3dd8eae9ae07e81ee411e0adc0b52a1216a8d
MD5 a1fbf5a3a122c1916417790ef4284148
BLAKE2b-256 1055f9211fa4d0d1ad74add56d6f49d576e2fbd3e59c7ff916d54e72e8dcb65c

See more details on using hashes here.

File details

Details for the file iflow_mcp_gnucleus_text_to_cad_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_gnucleus_text_to_cad_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 532.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_gnucleus_text_to_cad_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5fc738f16b94059c4e2fa4f3581c5969b551dad90339a5095627234059340b77
MD5 732b98b5c0b321b3bf010d303df2a37b
BLAKE2b-256 da973671121936839812a6e5084edc28a3c29c40d7150563ceb0d0d9974be4b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page