jupytercad-mcp
An MCP server for JupyterCAD that allows you to control it using LLMs/natural language.
https://github.com/user-attachments/assets/7edb31b2-2c80-4096-9d9c-048ae27c54e7
Suggestions and contributions are very welcome.
Usage
The default transport mechanism is stdio. To start the server with stdio, use the following command:
uvx --with jupytercad-mcp jupytercad-mcp
To use the streamable-http transport, use this command instead:
uvx --with jupytercad-mcp jupytercad-mcp streamable-http
Example
An example using the OpenAI Agents SDK is available at examples/openai_agents_client.py. To run it, follow these steps:
-
Clone the repository and navigate into the directory:
git clone git@github.com:asmith26/jupytercad-mcp.git cd jupytercad-mcp
-
Install the OpenAI Agents SDK. A Makefile target is provided for convenience:
make setup-examples-env -
In examples/openai_agents_client.py, update line 13 to configure a
MODEL(see supported models). -
Run JupyterLab from the project's root directory:
make jupyter-lab -
In JupyterLab, create a new "CAD file" and rename it to my_cad_design.jcad. This file path matches the default
JCAD_PATHin the example, allowing you to visualise the changes made by the JupyterCAD MCP server. -
(Optional) The OpenAI Agents SDK supports tracing to record events like LLM generations and tool calls. To enable it, set
USE_MLFLOW_TRACING=Trueand run the MLflow UI:make mlflow-ui -
Run the example with the default instruction, "Add a box with width/height/depth 1":
make example-openai-agents-client
Interactive Chat Interface
The example includes an interactive chat interface using the OpenAI Agents SDK's
REPL utility. To enable it, set USE_REPL=True.
streamable-http
To use the streamable-http transport, first start the MCP server:
uvx --with jupytercad-mcp jupytercad-mcp streamable-http
Then, run the example with the TRANSPORT variable set to "streamable-http" in the client example.
Tools
The following tools are available:
- get_current_cad_design: Reads the current content of the JCAD document.
- remove: Remove an object from the document.
- rename: Rename an object in the document.
- add_annotation: Add an annotation to the document.
- remove_annotation: Remove an annotation from the document.
- add_occ_shape: Add an OpenCascade TopoDS shape to the document.
- add_box: Add a box to the document.
- add_cone: Add a cone to the document.
- add_cylinder: Add a cylinder to the document.
- add_sphere: Add a sphere to the document.
- add_torus: Add a torus to the document.
- cut: Apply a cut boolean operation between two objects.
- fuse: Apply a union boolean operation between two objects.
- intersect: Apply an intersection boolean operation between two objects.
- chamfer: Apply a chamfer operation on an object.
- fillet: Apply a fillet operation on an object.
- set_visible: Sets the visibility of an object.
- set_color: Sets the color of an object.
Metadata
Release files for iflow-mcp-asmith26-jupytercad-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iflow_mcp_asmith26_jupytercad_mcp-0.1.1.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iflow_mcp_asmith26_jupytercad_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.6 kB
Release files / iflow_mcp_asmith26_jupytercad_mcp-0.1.1.tar.gz
| Download URL | iflow_mcp_asmith26_jupytercad_mcp-0.1.1.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9b8d1a1b30f7c7bd1ffdd2b4eaec9f89b483c57545481f7c3e3c11427c5d6b1
|
|
BLAKE2b-256 checksum How to use checksums |
85f4d6c2b1cabb0e58dbac94d4a70bcd9829816ab49c0442f05f5601145c4798
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / iflow_mcp_asmith26_jupytercad_mcp-0.1.1-py3-none-any.whl
| Download URL | iflow_mcp_asmith26_jupytercad_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01910b1977512a2a61b5f2c65fe1349bc2d427b18c16c2d498492420d1e716ea
|
|
BLAKE2b-256 checksum How to use checksums |
84e3758adfa14abe61047fa45586972b4ad8527faccfd0cc32a770c8c80be257
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|