Skip to main content
Glama
dsh18235538266-crypto

onshape-mcp-codex

onshape-mcp-codex

OpenAI Codex 版 Onshape CAD MCP server —— 让 Codex 对话驱动真实的参数化 CAD

本仓库是 jarvis-onshape-mcp(★168,MIT)的 Codex 适配 fork。复用其全部 ~69 个 MCP 工具与 CAD 方法论,替换 Claude 专属接入层为 Codex 兼容形式(MCP stdio + server instructions + Codex skills)。

与上游的区别

jarvis-onshape-mcp(上游)

onshape-mcp-codex(本仓库)

目标客户端

Claude Code(.claude-plugin

OpenAI Codex(stdio MCP)

接入方式

/plugin install

codex mcp add~/.codex/config.toml

MCP server 内核

onshape_mcp/(69 工具)

✅ 同源保留

方法论注入

SKILL.md(Claude 加载)

MCP instructions 字段(Codex 读前 512 字符)+ Codex skills

依赖

anthropic / claude-agent-sdk

✅ 已去除,仅 mcp/httpx/pydantic 等

Related MCP server: Onshape MCP Server

它能干什么

Codex 获得 69 个工具,可驱动真实 Onshape CAD:

  • Document:创建/查找文档、Part Studio、装配

  • Sketch:多实体草图 + 14 种约束(坐标优先 / 约束优先双模式)

  • Feature:拉伸/旋转/加厚/倒角/圆角/抽壳/布尔/阵列/偏置面

  • Assembly:4 种配合(固定/滑块/旋转/圆柱)+ 干涉检查 + 实例对齐

  • Parametric:Variable Studio 参数化迭代(改一个变量驱动整条特征链)

  • FeatureScript:逃逸舱口——Codex 直接写 FeatureScript 自定义特征(螺纹/扫掠/放样)

  • Vision:多视图 PNG 渲染、crop 放大、参考图对比、工程图 OCR

  • Export:STL / STEP / GLTF

关键设计(继承自 jarvis 的 truth-telling):每个变更工具返回 {ok, status, feature_id, changes?, hints?},特征失败带修复提示,Codex 不会在静默失败上继续堆特征。

快速开始

1. 注册 Onshape API Key

dev-portal.onshape.com 创建 OAuth/API 密钥对,得到 ONSHAPE_API_KEY + ONSHAPE_API_SECRET

Free 账号注意:Onshape Free 计划只能创建 public 文档(私有文档需付费)。MCP 的 create_document 需传 is_public=true(Codex 对话里说"创建公开文档"即可)。认证、建模、导出等其余功能 Free 账号均可用。

2. 安装

pip install onshape-mcp-codex
# 或本地开发
git clone https://github.com/yourname/onshape-mcp-codex.git
cd onshape-mcp-codex
pip install -e .

3. 接入 Codex

codex mcp add onshape \
  --env ONSHAPE_API_KEY=你的Key \
  --env ONSHAPE_API_SECRET=你的Secret \
  -- onshape-mcp-codex

或手动编辑 ~/.codex/config.toml

[mcp_servers.onshape]
command = "onshape-mcp-codex"
env = {
  ONSHAPE_API_KEY = "你的Key",
  ONSHAPE_API_SECRET = "你的Secret",
}

4. 验证

codex mcp list        # 应看到 onshape 及 69 个工具

新开 Codex 会话,试试:

"创建一个新的 Onshape 文档,加一个 Part Studio,做一个 60×40×8 的安装板,四角 6mm 内打 Ø4 孔"

5. 安装方法论 skills(推荐)

仓库 skills/ 提供两个 Codex skill,完整承载 CAD 方法论:

# CAD 构建协议(render-first / entity-first / 迭代纪律 / 陷阱表)
mkdir -p ~/.codex/skills && cp -r skills/onshape ~/.codex/skills/
# 视觉分解(参考图 → 结构化特征树,先描述后建模)
cp -r skills/vision-decompose ~/.codex/skills/

安装后 Codex 遇到 CAD 任务会自动匹配加载;参考图建模时显式要求走 vision-decompose 流程。

MCP instructions(自动注入)

server 启动时通过 MCP instructions 字段注入 6.3KB 工具索引 + 协议(Codex 读取该字段并用于整个会话)。前 512 字符自包含关键约束:mm 单位、describe_part_studio 验证循环、面/边选取前必须 list_entities

已知限制

与上游一致:

  • Onshape 平台无 section-view REST 端点(仅 UI Shift+X)

  • create_filletvariableCenter 遇 Onshape 侧 phantom-reference bug(裸半径正常)

  • 图像理解仍是墙:Codex 从工程图自主建模质量低于"人类描述规格 → 建模"(见 RESEARCH.md 的 2×2 基准)

致谢

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Connects AI coding agents to Autodesk Fusion 360 for CAD automation, enabling natural language control over sketching, 3D modeling, and CAM operations. It uses a Python-based bridge and a custom add-in to execute over 80 tools ranging from simple geometry creation to complex assembly and parameter management.
    80
    77
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables programmatic CAD modeling with Onshape's REST API, offering 45 tools for parametric sketches, feature management, assemblies, analysis, variables, and exports.
    45
    131
    -
  • A
    license
    B
    quality
    B
    maintenance
    An MCP server for parametric part modeling in Onshape, producing fully-defined, variable-driven sketches and features. It enables LLMs to create editable CAD models using semantic selection and geometrically grounded constraints.
    33
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dsh18235538266-crypto/onshape-mcp-codex'

If you have feedback or need assistance with the MCP directory API, please join our Discord server