Logo vun SolidWorks MCP Server

SolidWorks MCP Server

Communautéit
vespo92

Solidworks MCP using Typescript

Editeurvespo92
RepositorySolidworksMCP-TS
SproochTypeScript
Forks
47
Stären
229
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    SolidWorks MCP Server stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    229 Stären an 47 Forks aus dem verlinkte Repository.

SolidWorks MCP Server

TypeScript MCP Compatible Node.js License: MIT Windows

A Node.js MCP server for automating SolidWorks via COM interop. Connects AI assistants (Claude Desktop, etc.) to SolidWorks for CAD automation tasks.

Project Status: Alpha / Experimental

This project is under active development. While the architecture is in place and basic operations (sketch planes, simple extrusions) have been demonstrated, most tools have not been validated against a live SolidWorks instance. Expect rough edges, COM quirks, and incomplete functionality. Contributions and testing reports are very welcome.

How It Works

The server exposes SolidWorks operations as MCP tools over stdio. An intelligent routing layer handles a key limitation of Node.js COM bridges: methods with 13+ parameters often fail via direct COM calls.

  • Simple operations (12 params or fewer) - Direct COM call via winax
  • Complex operations (13+ params) - Auto-generated VBA macro executed by SolidWorks
  • Failed operations - Automatic fallback with error context

Prerequisites

  • Windows 10/11 (required - COM interop is Windows-only)
  • SolidWorks 2021-2025 (licensed, installed)
  • Node.js 20+
  • An MCP-compatible client (Claude Desktop, etc.)

Installation

bash
git clone https://github.com/vespo92/SolidworksMCP-TS.git
cd SolidworksMCP-TS

# Install dependencies (compiles winax native module for your system)
npm install

# Build TypeScript
npm run build

Note: The winax native module must be compiled locally on each Windows machine. Global npm installation does not work.

Configure Claude Desktop

Add to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "solidworks": {
      "command": "node",
      "args": ["C:/path/to/SolidworksMCP-TS/dist/index.js"],
      "env": {
        "SOLIDWORKS_PATH": "C:\\Program Files\\SOLIDWORKS Corp\\SOLIDWORKS",
        "ADAPTER_TYPE": "winax-enhanced"
      }
    }
  }
}

Available Tools

The server registers tools across these categories:

CategoryToolsStatus
Modelingcreate_part, create_extrusion, create_revolve, create_sweep, create_loft, create_fillet, create_chamfer, etc.Partially tested
Sketchcreate_sketch, add_line, add_circle, add_rectangle, add_arc, add_constraints, dimension_sketchBasic ops verified
Drawingcreate_drawing_from_model, add_drawing_view, add_section_view, add_dimensions, etc.Untested
Exportexport_file (STEP, IGES, STL, PDF, DWG, DXF), batch_exportUntested
Analysisget_mass_properties, check_interference, measure_distance, check_geometryUntested
VBA Generationgenerate_vba_script, vba_sheet_metal, vba_configurations, vba_equations, etc.Code generation works; execution untested
Macromacro_start_recording, macro_stop_recording, macro_export_vbaUntested

"Partially tested" means the tool has been run against SolidWorks at least once but not comprehensively. "Untested" means only mock/unit tests exist (if any).

Architecture

MCP Protocol (stdio)
    |
Tool Registry (index.ts)
    |
Feature Complexity Analyzer --- routes by param count
    |                    |
Direct COM (winax)    VBA Macro Generator
    |                    |
    +--------------------+
    |
SolidWorks COM API

Key Design Decisions

  • COM parameter limit workaround: SolidWorks API methods like FeatureExtrusion3 take 20+ parameters. Node.js COM bridges choke on these. The complexity analyzer detects this and generates a VBA macro instead.
  • Never pass null to COM: Use undefined for optional parameters. COM interprets null as VT_NULL, causing type mismatch errors (this was the root cause of SelectByID2 failures).
  • Feature tree traversal over SelectByID2: FeatureByPositionReverse() + GetTypeName2() is more reliable for finding sketches than SelectByID2.
  • Winston logger only: Never use console.* - it corrupts the JSON-RPC stdio transport.

Development

bash
npm run build        # TypeScript compile
npm run dev          # Hot-reload dev server (tsx watch)
npm run check        # TypeScript + Biome lint in one command
npm run lint         # Biome lint check
npm run lint:fix     # Biome auto-fix
npm run format       # Biome format
npm run typecheck    # Type check without emit

Testing

See TESTING.md for the full testing guide.

bash
# Unit tests (mock adapter, no SolidWorks needed)
USE_MOCK_SOLIDWORKS=true npm test

# Watch mode
npm run test:watch

Current test status: Unit tests exist for config and environment utilities. Most tool modules lack test coverage. Integration tests require a Windows machine with SolidWorks and have not been run in CI.

Known Issues & Limitations

  • No CI integration testing - Tests only run against mocks. Real SolidWorks integration tests require a self-hosted Windows runner that doesn't exist yet.
  • winax compilation - Must be compiled locally on each machine. No pre-built binaries.
  • Edge.js adapter - Defined in architecture but not implemented.
  • PowerShell bridge - Defined in architecture but not implemented.
  • Connection pooling / circuit breaker - Referenced in code but not battle-tested.
  • Performance metrics are unverified - No real benchmarking has been done.

What Has Worked

Based on development testing:

  • Connecting to a running SolidWorks instance via COM
  • Creating sketch planes and basic sketch geometry
  • Simple extrusions with limited parameters
  • Feature tree traversal for sketch selection
  • VBA macro code generation (execution path needs more testing)

Roadmap

  • Comprehensive integration test suite on real SolidWorks
  • CI with self-hosted Windows runner
  • Validate all modeling tools end-to-end
  • Validate drawing and export tools
  • Edge.js adapter for .NET runtime path
  • PowerShell bridge as alternative COM path
  • Performance benchmarking with real metrics

Contributing

See CONTRIBUTING.md for guidelines.

Key areas where help is needed:

  • Testing against real SolidWorks - The biggest gap. If you have SolidWorks, running tools and reporting results is extremely valuable.
  • COM interop edge cases - Different SolidWorks versions behave differently.
  • Additional tool implementations - Many SolidWorks API methods aren't exposed yet.

Troubleshooting

For winax native build failures on Windows 11 Build 26200+ / VS 2022 BuildTools 17.14+ (issue #23) and other install-time problems, see TROUBLESHOOTING.md.

COM Registration Issues

powershell
regsvr32 "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\sldworks.tlb"

Build Issues

bash
rm -rf node_modules dist
npm install
npm run build

Debug Logging

bash
ENABLE_LOGGING=true LOG_LEVEL=debug node dist/index.js

License

MIT - See LICENSE

Acknowledgments

  • winax - COM bridge for Node.js
  • Anthropic MCP - Model Context Protocol
  • SolidWorks API documentation

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "vespo92-solidworksmcp-ts": {
      "command": "",
      "args": []
    }
  }
}

SolidWorks MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal SolidWorks MCP Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

SolidWorks MCP Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu SolidWorks MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "vespo92-solidworksmcp-ts": {
      "command": "npx",
      "args": [
        "-y",
        "solidworks-mcp-server"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu SolidWorks MCP Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu SolidWorks MCP Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat SolidWorks MCP Server?
SolidWorks MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat SolidWorks MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server SolidWorks MCP Server benotzt?

SolidWorks MCP Server ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech SolidWorks MCP Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir SolidWorks MCP Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat SolidWorks MCP Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann SolidWorks MCP Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech SolidWorks MCP Server MCP mat TypingMind?

SolidWorks MCP Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt SolidWorks MCP Server MCP an TypingMind zur Verfügung?

SolidWorks MCP Server stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir SolidWorks MCP Server MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann SolidWorks MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇