MCP ExplorerExplorer

Solidgen Ts

@arhamgargon 16 days ago
1 AGPL-3.0
FreeCommunity
AI Systems
A Model Context Protocol (MCP) server that generates SolidWorks automation Python scripts using pywin32.

Overview

What is Solidgen Ts

solidgen-ts is a Model Context Protocol (MCP) server that generates SolidWorks automation Python scripts using the pywin32 library. It utilizes a Large Language Model (LLM) to interpret user requests and produce executable Python code for creating parts and drawings in SolidWorks.

Use cases

Use cases include automating repetitive tasks in SolidWorks, generating parts and drawings based on user specifications, and integrating with other MCP-compatible tools for enhanced productivity.

How to use

To use solidgen-ts, clone the repository, install the dependencies with npm, and run the FastMCP server. An MCP client can then call the solidgen tool to generate Python scripts based on user requests.

Key features

Key features include SolidWorks automation for generating Python scripts, LLM-powered code generation from natural language requests, easy integration as a FastMCP server, and timestamped saving of generated scripts.

Where to use

solidgen-ts can be used in engineering and design fields where SolidWorks is employed for creating and automating CAD designs.

Content

SolidWorks MCP (TypeScript)

This project implements an MCP server that provides a powerful tool for generating SolidWorks automation scripts using Python and the pywin32 library. It leverages a Large Language Model (LLM) to interpret user requests and produce runnable Python code for creating parts and drawings in SolidWorks.

Features

  • SolidWorks Automation: Generate Python scripts to automate tasks within SolidWorks.
  • LLM-Powered Code Generation: Utilizes an LLM to translate natural language requests into pywin32 code.
  • Easy Integration: Designed as a FastMCP server, allowing seamless integration with MCP-compatible clients and assistants.
  • Timestamped Saving: Generated scripts include logic to save SolidWorks parts with unique, timestamped filenames.

How it Works

The solidgen tool exposed by this server takes a user request as input. It then constructs a detailed prompt for an LLM, instructing it to generate a Python script that uses pywin32 to perform the requested SolidWorks operation. The generated script includes boilerplate for initializing SolidWorks and saving the created part.

Getting Started

Installation

  1. Clone this repository:
    git clone https://github.com/arhamgarg/solidgen-ts.git
    cd solidgen-ts
    
  2. Install dependencies using npm:
    npm install
    

Running the Server

To run the FastMCP server:

npx fastmcp dev src/index.ts

Once running, the server will expose the solidgen tool, which can be called by an MCP client.

Usage (via an MCP Client)

An MCP client can call the solidgen tool.

Example of how an MCP client might call the tool:

{
  "mcpServers": {
    "solidgen-ts": {
      "command": "npx",
      "args": [
        "tsx",
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/solidgen-ts/src/index.ts"
      ]
    }
  }
}

The tool will return a Markdown-formatted Python code block containing the generated SolidWorks automation script.

Tools

No tools

Comments