AO

altendky/onshape-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 5 forks 质量 82 趋势 30Apache-2.0

AI辅助访问您的Onshape CAD文档

概览

AI辅助访问您的Onshape CAD文档。 Onshape MCP 将你的 AI 助手连接到 Onshape。你用 Onshape 术语描述你想要的东西——创建草图、拉伸零件、导出 STL——AI 负责 API 调用。这是对已经会 Onshape 的人的帮助,不是替代 CAD 技能的。 早期开发。这是供感兴趣的人尝试的——事情可能并不总是如预期般顺利,欢迎反馈。 本项目不提供公共托管的MCP服务器或公共OAuth代理。您可以本地运行、自托管,或连接到您独立信任的服务器。 这是推荐的路径。本地服务器可以直接读写你设备上的文件——截图、导出和FeatureScript——而不是通过对话传递内容。 在Onshape中创建你自己的OAuth应用,使用http://localhost:18338/callback作为重定向URL。

概述(AI 翻译)

AI辅助访问您的Onshape CAD文档。

这是什么

Onshape MCP 将你的 AI 助手连接到 Onshape。你描述你的需求 用Onshape的术语——创建草图、拉伸零件、导出STL文件——以及AI。 负责处理 API 调用。这是一个帮助已经熟悉 Onshape 的人的工具, 不能替代CAD技能。

状态

早期开发。如果有人感兴趣,可以尝试—— 事情可能并不总是如预期般顺利,欢迎反馈。

本项目不提供公共托管的MCP服务器或公共OAuth 代理。本地运行、自架,或者连接到别人运营的服务器 你独立信任。

开始

本地设置(Claude 桌面、OpenCode 或任何 MCP 客户端)

这是推荐的路径。本地服务器可以读写你的文件 机器直接——截图、导出和FeatureScript——而不是传递 通过对话感到满足。

步骤1:创建Onshape OAuth应用

在 Onshape 中创建你自己的 OAuth 应用,使用 http://localhost:18338/callback 作为重定向URL。保留其客户端ID, 客户端秘密可用于onshape-mcp auth login。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Onshape MCP

AI-assisted access to your Onshape CAD documents.

What This Is

Onshape MCP connects your AI assistant to Onshape. You describe what you want in Onshape terms — create a sketch, extrude a part, export an STL — and the AI handles the API calls. This is a helper for people who already know Onshape, not a replacement for CAD skills.

Status

Early development. This is offered for people to try if they’re interested — things may not always work as expected, and feedback is appreciated.

This project does not provide a public hosted MCP server or a public OAuth proxy. Run it locally, self-host it, or connect to a server operated by someone you independently trust.

Getting Started

Local Setup (Claude Desktop, OpenCode, or any MCP client)

This is the recommended path. A local server can read and write files on your machine directly — screenshots, exports, and FeatureScript — instead of passing content through the conversation.

Step 1: Create an Onshape OAuth application

Create your own OAuth application in Onshape with http://localhost:18338/callback as a redirect URL. Keep its client ID and client secret available for onshape-mcp auth login. Direct OAuth with these user-owned credentials is the default. API access and secret keys are also supported as an alternative; see Authentication.

Step 2: Get the server binary

Pick whichever is easier for you:

  • npx (requires Node.js): No separate install needed — your MCP client runs npx --yes onshape-mcp and it downloads automatically.
  • Pre-built binary: Download from GitHub Releases and save it somewhere convenient.

Step 3: Configure your MCP client

Tell your MCP client how to launch the server.

Claude Desktop

Add to your Claude Desktop config (claude_desktop_config.json):

Using npx:

{
  "mcpServers": {
    "onshape": {
      "command": "npx",
      "args": ["--yes", "onshape-mcp"]
    }
  }
}

Using the downloaded binary:

{
  "mcpServers": {
    "onshape": {
      "command": "/path/to/onshape-mcp"
    }
  }
}

OpenCode

Add to your opencode.json:

Using npx:

{
  "mcp": {
    "onshape": {
      "type": "local",
      "command": ["npx", "--yes", "onshape-mcp"]
    }
  }
}

Using the downloaded binary:

{
  "mcp": {
    "onshape": {
      "type": "local",
      "command": ["/path/to/onshape-mcp"]
    }
  }
}

Other MCP clients

Any MCP client that supports stdio transport can launch this server. The command is either npx --yes onshape-mcp or the path to the downloaded binary.

Step 4: Authenticate and try it

Configure your OAuth client ID and secret, then run npx --yes onshape-mcp auth login when using the npm package, or onshape-mcp auth login when using the downloaded binary. Prefer configuration or ONSHAPE_MCP_AUTH__CLIENT_ID and

在 GitHub 查看完整 README

安装

npx --yes onshape-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "onshape": { "command": "npx", "args": ["--yes", "onshape-mcp"] } } }