Λογότυπο SolidworksMCP Python

SolidworksMCP Python

Κοινότητα
andrewbartels1

A comprehensive Model Context Protocol (MCP) server for SolidWorks automation (in python)

Εκδότηςandrewbartels1
ΑποθετήριοSolidworksMCP-python
ΓλώσσαPython
Forks
32
Αστέρια
84
Διαθέσιμα εργαλεία
0
Τύπος μεταφοράςstdio
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Συνδέστε εργαλεία σε ροές εργασίας AI

    Το SolidworksMCP Python παρέχει δυνατότητες MCP που μπορούν να χρησιμοποιηθούν από συμβατές εφαρμογές-πελάτες AI και πράκτορες AI.

  • 0 διαθέσιμα εργαλεία

    Περιηγηθείτε παρακάτω στις ενέργειες που μπορούν να κληθούν, μαζί με τα ονόματα και τις περιγραφές τους, όταν παρέχονται από τον διακομιστή.

  • Ρυθμίσεις έτοιμες για αντιγραφή

    Χρησιμοποιήστε τα αποσπάσματα εγκατάστασης για να ρυθμίσετε αυτόν τον διακομιστή στην εφαρμογή-πελάτη MCP που προτιμάτε.

  • Δείκτες ενδιαφέροντος για τον ανοιχτό κώδικα

    84 αστέρια και 32 διακλαδώσεις στο συνδεδεμένο αποθετήριο.

SolidWorks CAD Assistant & MCP Server

Languages: English | Español

Python 3.13+ License: MIT Windows SolidWorks Coverage

Python MCP server for SolidWorks automation with 138 tools, plus an optional agent/prompt-testing layer for AI-assisted workflows.

Overview

⚠️ Project Status: This project is under active construction. Features, APIs, documentation, and setup steps may change as the Python and UI implementation is finalized. This is a hobby/research product, please feel free to make an issue if you have questions or feedback! ⚠️

This project focuses on practical SolidWorks automation with an AI-friendly loop:

  1. describe intent
  2. generate a plan
  3. execute MCP tools
  4. inspect results
  5. iterate

It includes:

  • core MCP runtime for SolidWorks tool execution
  • COM/VBA routing and adapter safety wrappers
  • tool coverage across modeling, sketching, drawing, analysis, export, automation, templates, and macros
  • optional agent orchestration/testing utilities under src/solidworks_mcp/agents/

Supported Today

  • Windows + SolidWorks COM automation for the main CAD lifecycle.
  • Modeling, sketching, drawing, analysis, export, automation, templates, and macro tools.

Not Yet / Simulated

  • Mock adapter output is simulated and should not be treated as engineering truth.
  • Live 3D viewport streaming in a UI.
  • Checkpoint-level interference validation.
  • Simple simulation and fluid workflows
  • Simple Topology Optimization via SimulationXpress etc.

What Works (Verified Windows Setup)

This is the setup path validated end-to-end:

  1. Install Python from python.org (Windows installer).
  2. Enable Add python.exe to PATH during install.
  3. Install this project into a local .venv.
  4. Launch MCP from .venv\Scripts\python.exe (not from WSL).

When this is correct, startup logs show:

  • Platform: Windows
  • SolidWorks COM interface is available
  • Registered ... SolidWorks tools (count varies as tools evolve)
  • Connected to SolidWorks

Requirements

  • Windows 10/11 for real SolidWorks COM automation.
  • Python 3.13+ from python.org.
  • Git.
  • SolidWorks installed and launched at least once.

Linux/WSL is useful for docs/tests/mock mode, but not for direct COM automation.

Quick Start (Windows, python.org)

powershell
git clone https://github.com/andrewbartels1/SolidworksMCP-python.git
cd SolidworksMCP-python

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip setuptools wheel
.\.venv\Scripts\python.exe -m pip install -e .

Start server manually:

powershell
.\.venv\Scripts\python.exe -m solidworks_mcp.server

Or use the helper script (open SolidWorks first):

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\deployment\run-mcp.ps1 --real --year 2026

Mock mode warning — running run-mcp.ps1 without --real starts the server in mock mode. All tool responses are simulated; nothing touches SolidWorks. Always pass --real --year <year> for live automation.

Development Commands

Use the helper script for common workflows:

powershell
.\dev-commands.ps1

Common commands:

  • dev-install - install/update local dev environment
  • dev-test - run standard test suite (CI-safe subset)
  • dev-test-full - run full test suite (includes smoke/integration paths)
  • dev-lint - lint checks
  • dev-format - format code
  • dev-docs-build - build docs site once
  • dev-docs-strict - strict docs build (fails on warnings)
  • dev-docs-audit - generate docs audit report in .generated/docs

Local CI Replica (Docker)

To mirror GitHub Actions CI locally (Ubuntu + conda env from solidworks_mcp.yml + make test), run:

powershell
.\run-ci-local.ps1

The first run builds the image. Re-run without rebuild when only executing tests:

powershell
.\run-ci-local.ps1 -NoBuild

MCP Client Configuration (Windows)

There are two parallel sets of launch scripts, both in deployment/:

  • deployment/run-mcp.ps1 / src/utils/start_local_server.py — the local dev/demo harness: decorative startup banners, an HTTP health-check step, and an example tool-call workflow. Good for running by hand in a terminal to see what the server does. Not recommended for MCP host configs — a stdio MCP host treats a spawned server's stdout as a pure JSON-RPC channel, and this script's banner output goes to stdout.
  • deployment/run-mcp-claude.ps1 / src/utils/start_local_server_claude.py — a minimal entrypoint with no decorative output, meant specifically for MCP host configs (Claude Desktop, Claude Code, VS Code, LM Studio). Use these for any host config below.

If a tool call fails with an error like invalid_union / "expected object, received string" — that's the client's JSON-RPC parser choking on non-JSON text. It almost always means the config's args point at start_local_server.py (or run-mcp.ps1) instead of the _claude variant. This is easy to hit after editing a config by hand or letting a client's own "fix it for me" assistant rewrite the command: it may resolve the path to the plain script by filename guess. Check the exact filename in your config against the list above.

MCP hosts spawn servers over raw stdio pipes with no console attached. Windows PowerShell's native-command invocation is unreliable in that exact scenario — run-mcp-claude.ps1's venv-detection step uses Start-Process instead of piping to Out-Null to avoid it (piping a native command's output makes it a pipeline stage, which throws Cannot run a document in the middle of a pipeline when there's no console attached to the host process). If you still hit connection failures with it, point the client directly at the venv's python.exe instead, which skips PowerShell entirely.

Claude Desktop

Claude Desktop reads its MCP server list from a claude_desktop_config.json file. The path depends on how the app was installed:

  • Classic/legacy installs: %APPDATA%\Claude\claude_desktop_config.json
  • Packaged (MSIX-style) installs: %LOCALAPPDATA%\Packages\Claude_<hash>\LocalCache\Roaming\Claude\claude_desktop_config.json — look under %LOCALAPPDATA%\Packages\ for a folder starting with Claude_ if the classic path doesn't exist.

Create the file if it doesn't exist yet, and use the server key solidworks (the troubleshooting runbook in CLAUDE.md and the app's own log filenames assume this name). If the file already has other top-level keys (preferences, etc.), just add mcpServers alongside them — don't replace the file:

json
{
  "mcpServers": {
    "solidworks": {
      "command": "C:\\path\\to\\SolidworksMCP-python\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\path\\to\\SolidworksMCP-python\\src\\utils\\start_local_server_claude.py",
        "--real",
        "--year",
        "2026"
      ]
    }
  }
}

Replace the paths with your local repository path. The --real --year 2026 flags start the server in live COM automation mode (requires SolidWorks already open). Omit them for mock mode.

After saving, fully quit Claude Desktop (not just close the window — use File > Exit or the tray icon) and relaunch it so it reloads the MCP server list. To confirm it picked up the server:

  • In the app, open Settings > Developer and check that solidworks is listed and connected.
  • Or check %LOCALAPPDATA%\Claude\Logs\mcp-server-solidworks.log for a full initialize / tools/list round trip.
  • Tool-call errors are logged separately; see Troubleshooting Runbook in CLAUDE.md if the server appears but tool calls fail.

VS Code

Set your user MCP config (%APPDATA%\Code\User\mcp.json) to:

json
{
  "servers": {
    "solidworks-mcp-server": {
      "type": "stdio",
      "command": "powershell",
      "args": [
        "-NoProfile",
        "-ExecutionPolicy",
        "Bypass",
        "-File",
        "C:\\path\\to\\SolidworksMCP-python\\deployment\\run-mcp.ps1",
        "--real",
        "--year",
        "2026"
      ]
  },
  "inputs": []
}

Replace the script path with your local repository path. The --real --year 2026 flags start the server in live COM automation mode (requires SolidWorks open). Omit them for mock mode.

If this doesn't connect (see the note above about stdio hosts and stdout), switch to the MCP-host-safe wrapper below.

Recommended for MCP use: run-mcp-claude.ps1

json
{
  "servers": {
    "solidworks-mcp-server": {
      "type": "stdio",
      "command": "powershell",
      "args": [
        "-NoProfile",
        "-ExecutionPolicy",
        "Bypass",
        "-File",
        "C:\\path\\to\\SolidworksMCP-python\\deployment\\run-mcp-claude.ps1",
        "--real",
        "--year",
        "2026"
      ]
  },
  "inputs": []
}

LM Studio

Set your LM Studio MCP config file to include this server (LM Studio expects mcpServers):

json
{
  "mcpServers": {
    "solidworks-mcp-server": {
      "command": "C:\\path\\to\\SolidworksMCP-python\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\path\\to\\SolidworksMCP-python\\src\\utils\\start_local_server_claude.py",
        "--real",
        "--year",
        "2026"
      ]
    }
  }
}

After saving, restart LM Studio so it reloads MCP servers.

Optional Features (environment toggles)

All off/default unless set. Pass these as environment variables when launching the server (or in your MCP host config's env block); every SOLIDWORKS_MCP_<FIELD> maps to a config field of the same name.

SolidWorks-as-Code session logging — off by default

Logs every adapter tool call to a local SQLite database so a session can be replayed or exported as a runnable Python script (see docs/getting-started/solidworks-as-code.md).

VariableDefaultMeaning
SOLIDWORKS_MCP_SOC_LOGGING_ENABLEDfalseTurn logging on.
SOLIDWORKS_MCP_SOC_SESSION_ID(generated)Session name to log under. If unset while logging is on, a soc-YYYYMMDD-HHMMSS id is generated at startup.
SOLIDWORKS_MCP_SOC_DB_PATH.solidworks_mcp/agent_memory.sqlite3Override the database file.
powershell
$env:SOLIDWORKS_MCP_SOC_LOGGING_ENABLED = "true"
$env:SOLIDWORKS_MCP_SOC_SESSION_ID = "my-bracket"
.\.venv\Scripts\python.exe -m solidworks_mcp.server
# ...work in your MCP client...
.\.venv\Scripts\python.exe -m solidworks_mcp.agents.soc_exporter my-bracket my_bracket.py

Effective only with the circuit-breaker adapter wrapper (the default for real SolidWorks); the mock adapter does not log.

API docs index auto-refresh — on by default

The granular API-lookup tools (lookup_api_interface, lookup_api_method, find_related_api_members) and search_solidworks_api_help read a JSON index built by discover_solidworks_docs. When that index is older than the threshold it is rebuilt automatically on the next lookup.

VariableDefaultMeaning
SOLIDWORKS_MCP_DOCS_INDEX_AUTO_REFRESHtrueRebuild a stale index automatically. No-op without SolidWorks + win32com; a failed rebuild keeps serving the existing index.
SOLIDWORKS_MCP_DOCS_INDEX_MAX_AGE_DAYS21Age after which the index counts as stale.

Common Windows Fixes

If python is not found:

powershell
python --version

If this opens Microsoft Store or fails, reinstall Python from python.org and enable PATH.

If startup fails with ModuleNotFoundError: solidworks_mcp:

powershell
.\.venv\Scripts\python.exe -m pip install -e .

If startup fails with ModuleNotFoundError: fastmcp:

powershell
.\.venv\Scripts\python.exe -m pip install -e .

Docs

Key docs sections:

Direct links:

License

MIT License. See LICENSE.

Χρησιμοποιήστε το MCP SolidworksMCP Python με πολλά μοντέλα AI

Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας. Έτσι, μόλις συνδεθεί το SolidworksMCP Python, μπορείτε να το χρησιμοποιείτε με διαφορετικά μοντέλα AI στο TypingMind, αντί να το ρυθμίζετε ξεχωριστά για κάθε μοντέλο. Αυτή η ενσωμάτωση MCP εκτελείται τοπικά στη συσκευή σας μέσω του συνδέσμου MCP του TypingMind.

Οδηγός ρύθμισης για τη χρήση του τοπικού συνδέσμου

Επιλέξτε αυτή τη μέθοδο όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές ή ιδιωτικούς πόρους στον υπολογιστή σας.

1

Ανοίξτε τις ρυθμίσεις MCP

Στο TypingMind, μεταβείτε στις «Ρυθμίσεις», έπειτα στις «Σύνθετες ρυθμίσεις» και στο «Model Context Protocol» και επιλέξτε «Ρύθμιση συνδέσμου».

  1. Ανοίξτε το TypingMind στο πρόγραμμα περιήγησής σας.
  2. Κάντε κλικ στο εικονίδιο «Ρυθμίσεις».
  3. Μεταβείτε στις «Σύνθετες ρυθμίσεις».
  4. Ανοίξτε την ενότητα Model Context Protocol.
  5. Κάντε κλικ στην επιλογή «Ρύθμιση συνδέσμου» και επιλέξτε «Αυτή η συσκευή».
Οθόνη ρύθμισης συνδέσμου MCP του TypingMind με επιλεγμένη την επιλογή «Αυτή η συσκευή»
2

Εκτελέστε την εντολή του συνδέσμου

Επιλέξτε «Αυτή η συσκευή», αντιγράψτε την εντολή από το TypingMind και εκτελέστε την στο Τερματικό. Διατηρήστε τη διεργασία σε λειτουργία όσο χρησιμοποιείτε το MCP.

  1. Αντιγράψτε την εντολή ρύθμισης που εμφανίζεται στο TypingMind.
  2. Ανοίξτε το Τερματικό στο macOS ή το Windows Terminal στα Windows.
  3. Επικολλήστε και εκτελέστε την εντολή.
  4. Εγκρίνετε την εγκατάσταση του πακέτου, αν το Τερματικό σάς ζητήσει επιβεβαίωση για να συνεχίσει.
  5. Διατηρήστε ανοιχτό το παράθυρο του Τερματικού και τη διεργασία σε λειτουργία όσο χρησιμοποιείτε εργαλεία MCP.
3

Προσθέστε το SolidworksMCP Python ως διακομιστή

Όταν η κατάσταση του συνδέσμου είναι «Έτοιμος», κάντε κλικ στο «Αλλαγή servers» και επικολλήστε τις ρυθμίσεις του διακομιστή MCP.

  1. Περιμένετε μέχρι η κατάσταση του συνδέσμου να εμφανιστεί ως «Έτοιμος».
  2. Κάντε κλικ στο «Αλλαγή servers».
  3. Επικολλήστε τις ρυθμίσεις του διακομιστή MCP SolidworksMCP Python.
  4. Αποθηκεύστε τη λίστα διακομιστών.
  5. Κάντε ανανέωση αν θέλετε να επιβεβαιώσετε ότι ο σύνδεσμος παραμένει έτοιμος για χρήση.
Ρυθμίσεις MCP του TypingMind με ενεργό διακομιστή και το κουμπί «Αλλαγή servers»
{
  "mcpServers": {
    "solidworksmcp-python": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Χρησιμοποιήστε τη σύνδεση με διαφορετικά μοντέλα

Αποθηκεύστε τη λίστα διακομιστών, ανοίξτε τα «Πρόσθετα», ενεργοποιήστε τα εργαλεία MCP του SolidworksMCP Python και έπειτα επιλέξτε οποιοδήποτε υποστηριζόμενο μοντέλο AI στο TypingMind. Χρησιμοποιήστε τα εργαλεία στη συνομιλία ή αναθέστε τα σε έναν πράκτορα AI.

  1. Ανοίξτε τη σελίδα «Πρόσθετα» στο TypingMind.
  2. Ενεργοποιήστε τα εργαλεία MCP του SolidworksMCP Python.
  3. Ξεκινήστε μια συνομιλία και επιλέξτε το μοντέλο AI που θέλετε να χρησιμοποιήσετε.
  4. Χρησιμοποιήστε τα εργαλεία MCP στη συνομιλία ή αντιστοιχίστε τα σε έναν πράκτορα AI.
  5. Μεταβείτε σε άλλο μοντέλο AI όποτε χρειάζεται, χωρίς να συνδέσετε ξανά το MCP.
Συνομιλία στο TypingMind με ενεργοποιημένα εργαλεία MCP και επιλεγμένο μοντέλο AI
Θα με βοηθήσετε σε αυτό μέσω SolidworksMCP Python;
SolidworksMCP Python
Βεβαίως. Το διάβασα.
Δείτε τι βρήκα μέσω του SolidworksMCP Python.

Συχνές ερωτήσεις

Σε τι χρησιμεύει ο διακομιστής MCP SolidworksMCP Python;

Το SolidworksMCP Python είναι ένας διακομιστής MCP που επιτρέπει σε συμβατές εφαρμογές AI να συνδέονται με εξωτερικά εργαλεία και πληροφορίες πλαισίου. Στο TypingMind, μπορείτε να προσθέσετε αυτόν τον διακομιστή MCP μία φορά και να κάνετε τα εργαλεία του διαθέσιμα στον χώρο εργασίας AI σας.

Μπορώ να χρησιμοποιήσω το SolidworksMCP Python MCP με πολλά μοντέλα AI στο TypingMind;

Ναι. Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας, ώστε να μπορείτε να χρησιμοποιείτε το SolidworksMCP Python με διαφορετικά μοντέλα AI, όπως τα Claude, ChatGPT, Gemini ή άλλα μοντέλα που έχετε ρυθμίσει στο TypingMind, χωρίς να ρυθμίζετε τον διακομιστή MCP ξεχωριστά για κάθε μοντέλο.

Γιατί να χρησιμοποιήσετε τον σύνδεσμο MCP SolidworksMCP Python με το TypingMind;

Το TypingMind είναι ένα από τα καλύτερα περιβάλλοντα συνομιλίας με μεγάλα γλωσσικά μοντέλα, καθώς συγκεντρώνει πολλά μοντέλα AI, προτροπές, πρόσθετα, πράκτορες AI, κλειδιά API και εργαλεία MCP σε έναν χώρο εργασίας. Συνδέοντας το SolidworksMCP Python, μπορείτε να χρησιμοποιείτε τα εργαλεία MCP του με τα μοντέλα που προτιμάτε, διατηρώντας οργανωμένη τη ροή εργασίας των συνομιλιών σας στο TypingMind.

Πώς συνδέω το SolidworksMCP Python MCP στο TypingMind;

Το SolidworksMCP Python λειτουργεί μέσω του τοπικού συνδέσμου MCP του TypingMind. Αυτή είναι η καλύτερη επιλογή όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές υπολογιστή, εργαλεία γραμμής εντολών ή ιδιωτικούς πόρους στον υπολογιστή σας.

Ποια εργαλεία παρέχει το SolidworksMCP Python MCP στο TypingMind;

Το SolidworksMCP Python διαθέτει δυνατότητες MCP που μπορείτε να ενεργοποιήσετε από τη σελίδα Πρόσθετα του TypingMind και να χρησιμοποιήσετε σε συνομιλίες ή να αναθέσετε σε πράκτορες AI.

Χρειάζεται να κοινοποιήσω τα κλειδιά API μου στο TypingMind για να χρησιμοποιήσω το SolidworksMCP Python MCP;

Όχι. Το TypingMind δίνει προτεραιότητα στην τοπική λειτουργία και σας επιτρέπει να διατηρείτε τον έλεγχο των παρόχων μοντέλων, των κλειδιών API, των προτροπών και των ρυθμίσεων MCP σας. Αν το SolidworksMCP Python απαιτεί έλεγχο ταυτότητας, προσθέστε τις απαιτούμενες κεφαλίδες, τις ρυθμίσεις OAuth ή τις τοπικές ρυθμίσεις για τον συγκεκριμένο διακομιστή MCP κατά τη δημιουργία της σύνδεσης.

Σχετικοί διακομιστές MCP

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇