Prerequisites
mcltspice drives LTspice in batch mode. How you set it up depends on your platform: on Linux it runs LTspice through Wine (fully headless), and on macOS it drives the native LTspice.app directly (no Wine).
mcltspice drives LTspice through Wine in headless batch mode. You need two things: a working Wine installation and the LTspice application files extracted from the Windows installer.
Install Wine
Section titled “Install Wine”sudo pacman -S winesudo dpkg --add-architecture i386sudo apt updatesudo apt install wine64sudo dnf install wineVerify the installation:
wine --versionExtract LTspice
Section titled “Extract LTspice”LTspice is distributed as a Windows .msi installer. Rather than running it through Wine’s installer, extract the files directly with 7z.
-
Download LTspice
Get
LTspice64.msifrom analog.com/ltspice. -
Extract the MSI
Terminal window 7z x LTspice64.msi -oltspicecd ltspice7z x disk1.cab -
Initialize a Wine prefix
Terminal window export WINEPREFIX=$PWD/.wineexport WINEARCH=win64wineboot --initThis creates a minimal Wine prefix in the same directory. LTspice does not need a full Windows environment --- the prefix just provides the runtime.
Set the LTspice directory
Section titled “Set the LTspice directory”mcltspice looks for LTspice in this order:
- The
LTSPICE_DIRenvironment variable - The default path:
~/claude/ltspice/extracted/ltspice
If your extracted files are elsewhere, set the environment variable:
export LTSPICE_DIR=/path/to/your/extracted/ltspiceFor persistent configuration, add it to your shell profile (~/.bashrc, ~/.zshrc, etc.) or pass it through your MCP client configuration.
macOS has a native universal LTspice build, so there is no Wine, no WINEPREFIX, and no Z:\ drive translation. mcltspice calls the native binary directly.
Install LTspice.app
Section titled “Install LTspice.app”Install LTspice from the Mac App Store or from analog.com/ltspice. This gives you a native universal binary (Apple Silicon and Intel) at:
/Applications/LTspice.app/Contents/MacOS/LTspicePopulate the library
Section titled “Populate the library”The component library lives outside the app bundle, at ~/Library/Application Support/LTspice/, with lib/{sym,sub,cmp} underneath. LTspice unpacks this from a bundled lib.zip the first time it launches from the GUI.
-
Launch LTspice.app once, interactively.
Open LTspice from Finder or Spotlight. On first launch it populates
~/Library/Application Support/LTspice/lib/. This step is required before batch simulations can resolve symbols and models. -
Confirm the library exists.
Terminal window ls ~/Library/Application\ Support/LTspice/lib# expect: sym sub cmp
Set the binary path
Section titled “Set the binary path”mcltspice looks for the LTspice binary in this order:
- The
LTSPICE_BINenvironment variable - The default path:
/Applications/LTspice.app/Contents/MacOS/LTspice
If you installed LTspice.app elsewhere, set the override:
export LTSPICE_BIN=/path/to/LTspice.app/Contents/MacOS/LTspiceLTSPICE_BIN is the macOS equivalent of LTSPICE_DIR on Linux — it points mcltspice at the executable. The library root (~/Library/Application Support/LTspice/) is resolved separately.
Verify the setup
Section titled “Verify the setup”Once LTspice is in place, use the check_installation tool to confirm everything is working:
check_installation()The report is the single source of truth for whether the box is usable, and its contents differ by platform.
On Linux it checks for:
- Wine availability and version
- LTspice binary presence
- Library and symbol directories
- Write permissions for output files
On macOS it reports:
- The platform
- The resolved native binary path (from
LTSPICE_BINor the default) - The resolved library root (
~/Library/Application Support/LTspice/) - The detected LTspice version
- GUI-session availability (whether an active login session is present to run batch jobs)
If any check fails, the tool reports exactly what is missing and how to fix it.