Skip to content

feat request: Add generic PowerShell scripts for automated MCP setup and configuration #3

@romanilyin

Description

@romanilyin

I wrote a set of PowerShell scripts designed to automate the setup, compilation, and configuration of the KiCad MCP server on Windows 11. The goal is to simplify the installation process and make it easier to integrate the server with editors like Cursor.

Changes Include:

  • install_kicad_mcp_win11_generic.ps1:

    • Automates the overall installation process.
    • Checks for and installs python and poetry if needed.
    • Updates Git submodules.
    • Dynamically locates and calls the compilation script from the same directory.
    • Installs the main project dependencies using Poetry.
    • Interactively creates the .env file with KICAD_CLI_PATH and PCB_PATHS, using single quotes for paths to handle spaces correctly.
    • Accepts the repository path as a parameter instead of hardcoding it.
  • compile_kicad_python_win11_generic.ps1:

    • Automates the steps outlined in kicad-python/COMPILING.md.
    • Checks for and downloads/installs protoc v25.3 if not found.
    • Checks for and installs poetry if not found.
    • Creates a virtual environment and installs dependencies within the kicad-python subdirectory.
    • Builds and installs the kicad-python library in editable mode.
    • Accepts the main repository path as a parameter, allowing it to run from any location relative to the repo root.
    • Uses Push-Location to correctly perform operations within the kicad-python subdirectory.
  • generate_cursor_mcp_config.ps1:

    • Automatically generates a cursor_mcp.json file.
    • Uses poetry env info --path to dynamically determine the correct Python executable path within the Poetry virtual environment.
    • Constructs the path to main.py based on the script's location (assumed to be in the repo root).
    • Outputs a correctly formatted JSON configuration compatible with MCP clients, ready for use with Cursor or similar editors.

Benefits:

  • Reduced Manual Steps: Eliminates the need for manual dependency checks, environment setup, and configuration file creation.
  • Consistency: Ensures a consistent setup process across different environments.
  • Accessibility: Makes the project easier to set up for users less familiar with Poetry or manual Python environments.
  • Portability: The scripts now accept the repository path as a parameter, removing hardcoded paths like d:\Work\KiCad\....

This should streamline the initial setup experience for Windows users.

finerestaurant-kicad-mcp-python.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions