Skip to main content
Glama
Said-AER

SolidWorks MCP Bridge

by Said-AER

SolidWorks MCP Bridge 🌉 ⚙️

Server und Integrations-Bridge basierend auf Model Context Protocol (MCP) zur Kommunikation lokaler Sprachmodelle (über Ollama) mit der COM-API von SolidWorks.

Ermöglicht es LLMs wie qwen3:8b und qwen3:30b-a3b, den Konstruktionszustand zu inspizieren, den Feature-Baum zu analysieren, Bemaßungen zu lesen, Gleichungen abzufragen, physikalische Masseeigenschaften zu extrahieren und technische Dateien automatisiert und strukturiert zu exportieren.


🎯 Projektumfang

  • Stufe 1 (Aktuelle Phase - Lesen): Zerstörungsfreie Inspektion von Teilen, Baugruppen, Bemaßungen, Gleichungen, Masse und FEA-Studien.

  • Stufe 2 (Zukünftige Phase - Bearbeiten): Parametrische Änderung von Bemaßungen, globalen Variablen und kontrollierter Neuaufbau.

  • Stufe 3 (Zukünftige Phase - Generieren): Erstellung von 2D/3D-Skizzen, Features und automatisierten Makros.

Related MCP server: solidworks-mcp

📂 Projektstruktur

LOCAL LLM/
├── requirements.txt         # Dependencias Python (mcp, pywin32, pydantic, ollama, etc.)
├── pyproject.toml           # Configuración del paquete y testing
├── .env.example             # Plantilla de variables de entorno
├── .env                     # Configuración activa local
├── src/
│   └── sw_bridge/
│       ├── config.py         # Carga de configuración (pydantic-settings)
│       ├── logging_config.py # Logging estructurado JSON por sesión
│       ├── server.py         # Servidor MCP (fastmcp / stdio / sse)
│       ├── sw_connection/    # Conexión COM a SolidWorks
│       │   ├── connector.py  # Singleton y reconexión automática
│       │   ├── exceptions.py # Excepciones tipadas
│       │   └── models.py     # Modelos de datos Pydantic
│       └── tools/            # Herramientas de Nivel 1
│           ├── document_tools.py
│           ├── feature_tree_tools.py
│           ├── dimension_tools.py
│           ├── mass_props_tools.py
│           ├── export_tools.py
│           └── fea_tools.py
├── tests/                    # Pruebas automatizadas (pytest)
├── scripts/
│   ├── test_tool_calling.py  # Validación de llamadas a funciones con Ollama
│   └── smoke_test.py         # Smoke test contra SolidWorks
└── docs/                     # Especificaciones y resolución de problemas
    ├── alcance.md
    ├── tool_schemas.md
    └── troubleshooting.md

🚀 Installation und Inbetriebnahme

1. Virtuelle Umgebung aktivieren

.\sw-mcp-env\Scripts\activate

2. Modelle in Ollama überprüfen

Stellen Sie sicher, dass das Modell mit Werkzeugunterstützung verfügbar ist:

ollama list
ollama show qwen3:8b

3. Tool Calling mit dem lokalen LLM testen

.\sw-mcp-env\Scripts\python scripts/test_tool_calling.py

4. Testsuite ausführen

.\sw-mcp-env\Scripts\pytest tests/ -v

5. MCP-Server starten (stdio-Modus)

.\sw-mcp-env\Scripts\python -m sw_bridge.server --transport stdio

🛠️ Verfügbare Werkzeuge (Stufe 1)

Werkzeug

Beschreibung

check_solidworks_status

Stellt fest, ob SolidWorks über COM antwortet.

get_active_document_info

Ruft Typ, Pfad, Konfigurationen und Speicherstatus ab.

list_open_documents

Listet alle in der Sitzung geladenen Dokumente auf.

get_feature_tree

Extrahiert den vollständigen Feature-Baum (FeatureManager).

get_feature_details

Inspiziert Definition und Parameter eines Features.

list_dimensions

Listet numerische Bemaßungen des Modells oder eines Features auf.

get_equations

Liest die Gleichungen und globalen Variablen des Gleichungsmanagers.

get_mass_properties

Berechnet Masse (kg), Volumen, Schwerpunkt und Trägheit.

export_step

Exportiert das aktive Modell in das neutrale STEP-Format.

export_pdf

Exportiert die 2D-Zeichnung oder aktive Ansicht als PDF.

export_screenshot

Speichert einen Screenshot in hoher Auflösung im PNG-Format.

list_simulation_studies

Listet Finite-Elemente-Analyse-Studien (FEA) auf.

get_simulation_study_results

Fragt von-Mises-Spannungen und Sicherheitsfaktoren ab.


⚙️ Konfiguration als MCP-Server in Antigravity / Claude Desktop

Fügen Sie Ihrem MCP-Client die folgende Konfiguration hinzu:

{
  "mcpServers": {
    "solidworks-bridge": {
      "command": "C:\\Users\\said\\Desktop\\LOCAL LLM\\sw-mcp-env\\Scripts\\python.exe",
      "args": ["-m", "sw_bridge.server", "--transport", "stdio"],
      "cwd": "C:\\Users\\said\\Desktop\\LOCAL LLM"
    }
  }
}

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server that exposes CAD geometry reasoning over STEP files to LLMs, allowing natural language queries about parts, assemblies, dimensions, holes, and mass properties.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP bridge server for SolidWorks that enables AI assistants to control SolidWorks programmatically via COM automation.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI (e.g., Claude) to control SolidWorks via natural language, automating part creation, sketching, and feature operations through the Model Context Protocol.
    1
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that drives SolidWorks 2023+ on Windows, exposing CAD operations like sketching, extrusions, assemblies, and exports through tools for AI assistants like Kimi and Claude.
    1
    -