3D CAD BasePlate Generator MCP

3D CAD BasePlate Generator MCP

Generates printable 3D CAD models (e.g., bottle caps) from photos by combining client-side dimension extraction with CadQuery precision modeling, mesh repair, and optional AI-based visual mesh generation via Meshy.

Category
访问服务器

README

3D CAD BasePlate Generator MCP.

A NitroStack MCP server for the bottle-cap-cad workflow: turn a photo of a broken bottle cap, worn plug, or cavity into a printable replacement.

Vision/dimension extraction from the source photo happens client-side (in the MCP client, e.g. Claude) — none of these tools re-derive dimensions from pixels. generate_visual_mesh is the one exception, since Meshy infers geometry directly from the image itself.

Tools

Tool Input Backend Network
generate_precise_cap dimensions JSON (outer/inner diameter, height, thread pitch/starts/depth) CadQuery (Python, local subprocess) none
fill hole/cavity geometry JSON — circle, rectangle, stadium (slot), polygon, or freeform/organic outline, uniform or tapered CadQuery (Python, local subprocess) none
repair_mesh mesh URL or base64 (STL/OBJ/PLY/GLB/OFF) PyMeshLab (Python, local subprocess) none (fetches url if given)
generate_visual_mesh raw image (base64) Meshy image-to-3D API HTTPS

A fill-geometry-guide MCP prompt is also registered, walking a caller through the fields fill expects.

Suggested pipeline: generate_visual_mesh (rough visual reference from a photo) → repair_mesh (make it manifold/watertight) → generate_precise_cap or fill for the actual dimensionally-accurate part → repair_mesh again if the CAD output needs cleanup after boolean operations.

Setup

npm install
pip install -r requirements.txt --break-system-packages   # or your own venv
cp .env.example .env   # set MESHY_API_KEY
npm run build
npm start

For local iteration without a build step: npm run dev.

generate_precise_cap, fill, and repair_mesh shell out to a local Python interpreter (python-runtime.ts auto-detects python3/python/py, or respects a PYTHON_EXECUTABLE override in .env) — Python 3 with the packages in requirements.txt needs to be installed wherever this server runs. generate_visual_mesh only needs MESHY_API_KEY; it makes no Python calls.

Structure

3D-CAD-Modeling-using-MCP/
├── src/
│   ├── app.module.ts          # registers the four tool providers + prompt
│   ├── main.ts                 # bootstrap / entrypoint
│   ├── index.ts                # re-exports main.ts
│   ├── modules/bottle-cap-cad/
│   │   └── bottle-cap-cad.prompts.ts   # fill-geometry-guide prompt
│   └── tools/
│       ├── shapes.ts            # shared circle/rectangle/stadium/polygon/freeform zod schema
│       ├── cap.tools.ts         # generate_precise_cap
│       ├── fill.tools.ts        # fill
│       ├── repair.tools.ts      # repair_mesh
│       ├── mesh.tools.ts        # generate_visual_mesh (pure TS, calls Meshy)
│       ├── python-runtime.ts    # local python3/python/py auto-detection
│       └── cad-api-client.ts    # optional HTTP client for a remote CAD API
├── cad/
│   ├── precise_cap.py           # CadQuery threaded-cap builder
│   ├── fill.py                  # CadQuery plug builder
│   └── repair_mesh.py           # PyMeshLab repair pipeline
├── package.json
├── tsconfig.json
└── requirements.txt

Notes on the current code

  • Thread generation: precise_cap.py builds a solid, closed-top cap with a blind bore (not a through-hole) and sweeps one or more real helical thread ridges onto the skirt's inner wall along a cq.Wire.makeHelix() path. threadStarts (1–4), threadDepth, and topThickness are optional fields on generate_precise_cap; threadPitch falls back to an approximate PCO 1810-style pitch (3.18mm, single start) when omitted. This is a parametric approximation tuned for FDM printing, not a certified thread-spec generator.
  • fill shapes: shapes.ts supports five top/bottom shape types — circle, rectangle (with optional corner radius), stadium (true rounded slot with semicircular ends), polygon (straight-edged, arbitrary point count), and freeform (a smooth closed spline through 6–300 traced boundary points, for organic/irregular openings). capStyle: "flush" is only implemented for circle/rectangle/stadium/freeform tops — a polygon top with flush is downgraded to none by fill.tools.ts, with a warning returned to the caller rather than failing silently.
  • Low-confidence inputs: both generate_precise_cap and fill accept a confidence field (high/medium/low, from the caller's own vision-based dimension extraction). A low value still generates output, but the response includes a warning recommending the dimensions be confirmed before printing.
  • Remote CAD API: cad-api-client.ts supports routing generate_precise_cap / fill / repair_mesh over HTTP to a CAD_API_URL instead of spawning Python locally, for hosting environments without a Python runtime. This repo does not currently include the server-side counterpart (no api/ directory) — CAD_API_URL / CAD_API_KEY are recognized but there's nothing to point them at yet. Leave both unset for local development; the tools fall back to the local-subprocess path automatically.
  • Meshy polling: mesh.tools.ts polls Meshy's image-to-3d endpoint every 3s for up to 60 attempts rather than using a webhook callback. Meshy's free tier output is CC BY 4.0 licensed — check meshy.ai/pricing for current terms before relying on it beyond a demo.
  • app.module.ts registers a harmless placeholder for NitroStack's OAUTH_CONFIG DI token purely to silence a noisy (but non-fatal) startup log from OAuthModule — this server has no HTTP/OAuth surface and the placeholder has no effect on transport selection.

Team

  • Reshvanth Yeddla
  • Nirlep Boddapally
  • Tarun
  • Vijay Reddy

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选