solidworks-mcp

solidworks-mcp

Enables AI (e.g., Claude) to control SolidWorks via natural language, automating part creation, sketching, and feature operations through the Model Context Protocol.

Category
访问服务器

README

SolidWorks MCP Server 🔧

Automate SolidWorks using natural language through Claude AI and the Model Context Protocol (MCP)

License: MIT Python 3.10+ SolidWorks 2025 MCP


🎯 What is This?

SolidWorks MCP Server is a production-ready Model Context Protocol server that lets Claude AI control SolidWorks through natural language. Instead of manually clicking through menus, you simply tell Claude what to design — and it builds it for you.

Example prompts you can use:

  • "Create a new part, draw a circle with radius 30mm and extrude it 15mm"
  • "Add a fillet of 2mm to all edges"
  • "Draw a hexagon and cut extrude it 10mm"
  • "List all features in the current part"

✨ Features

  • 22 Tools covering parts, sketches, features, and utilities
  • SolidWorks 2023–2025 Compatible with version-aware API fallbacks
  • Auto-detects SolidWorks installation via Windows registry
  • Multi-unit support — mm, cm, inch, meter, foot
  • Modular architecture — clean, extensible Python package
  • Robust error handling — cascading fallback chains for COM API
  • JSON configuration — easy to customize without touching code
  • Comprehensive logging — full debug output for troubleshooting

🛠️ Available Tools

Category Tool Description
Connection connect_solidworks Connect to running SolidWorks instance
Connection get_solidworks_info Get version and installation info
Documents create_new_part Create a new part document
Documents create_new_assembly Create a new assembly document
Documents open_document Open an existing SolidWorks file
Documents close_document Close the active document
Documents save_document Save the active document
Documents list_open_documents List all open documents
Sketches create_sketch Create a sketch on a plane (Front/Top/Right)
Sketches close_sketch Exit the active sketch
Sketches draw_circle Draw a circle by center and radius
Sketches draw_rectangle Draw a rectangle by two corners
Sketches draw_line Draw a line between two points
Sketches draw_arc Draw an arc by center and angles
Sketches draw_polygon Draw a regular polygon (triangle, hex, etc.)
Features extrude_sketch Boss-extrude the active sketch
Features cut_extrude Cut-extrude to remove material
Features fillet_edges Add fillets to selected edges
Features chamfer_edges Add chamfers to selected edges
Features list_features List all features in the model
Utilities set_units Change default unit (mm/inch/cm/m/ft)
Utilities execute_python Execute custom Python code in SW context

📋 Requirements

  • OS: Windows 10 or Windows 11
  • SolidWorks: 2023, 2024, or 2025 (must be installed and licensed)
  • Python: 3.10 or higher
  • Claude: Claude Desktop app or Claude Code

⚡ Quick Start

1. Clone the Repository

git clone https://github.com/alisamsam/solidworks-mcp.git
cd solidworks-mcp

2. Install Dependencies

pip install -r requirements.txt

3. Configure Claude Desktop

Add the following to your claude_desktop_config.json:

Location: C:\Users\YOUR_NAME\AppData\Roaming\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "solidworks": {
      "command": "python",
      "args": ["C:\\path\\to\\solidworks-mcp\\solidworks_mcp_server.py"]
    }
  }
}

4. Launch

  1. Open SolidWorks first
  2. Restart Claude Desktop
  3. In Claude, type: "Connect to SolidWorks"
  4. Start designing! 🎉

📁 Project Structure

solidworks-mcp/
├── solidworks_mcp_server.py      # Entry point
├── solidworks_mcp/               # Main package
│   ├── __init__.py              # Package exports (v3.0.0)
│   ├── server.py                # MCP server & tool definitions
│   ├── config.py                # Configuration management
│   ├── config.json              # Default settings
│   ├── constants.py             # SolidWorks constants & enums
│   ├── automation/              # Core automation modules
│   │   ├── base.py             # Connection management
│   │   ├── documents.py        # Document operations
│   │   ├── sketches.py         # Sketch operations
│   │   └── features.py         # Feature operations (SW 2025 fixed)
│   └── utils/                   # Utility modules
│       ├── units.py            # Unit conversion system
│       └── sw_finder.py        # Auto-detect SolidWorks
├── requirements.txt
├── .gitignore
└── DEVELOPMENT_ROADMAP.md       # Future development plan

⚙️ Configuration

Edit solidworks_mcp/config.json to customize behavior:

{
  "exe_path": "auto",
  "default_unit": "mm",
  "startup_timeout": 120,
  "log_level": "INFO",
  "default_extrude_depth": 10.0,
  "default_fillet_radius": 2.0
}
Setting Default Description
exe_path "auto" Path to SLDWORKS.exe or auto-detect
default_unit "mm" Default unit for all dimensions
startup_timeout 120 Seconds to wait for SW startup
log_level "INFO" Logging verbosity

🔧 SolidWorks 2025 Compatibility

This server includes special handling for SolidWorks 2025 API changes:

  • Extrusion fallback chain: FeatureExtrusion3FeatureExtrusion2FeatureBossSimple
  • Safe property access for feat.Name, feat.GetTypeName2(), IsSuppressed2()
  • stdout capture fix for execute_python tool
  • Registry-based SolidWorks auto-detection

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m "Add my feature"
  4. Push to the branch: git push origin feature/my-feature
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.


👤 Author

Samsaam Ali Baig


🙏 Acknowledgements


If this project helps you, please give it a star!

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选