Skip to main content
Glama

LTspice MCP for macOS

Model Context Protocol (MCP) server that lets agents and MCP clients control LTspice on macOS for simulation, schematic generation, data extraction, verification, and rendering.

This project is designed for practical automation: reliable runs, reproducible artifacts, and outputs that match LTspice behavior closely.

Inspired by:

What You Can Do

  • Run LTspice simulations from MCP (simulateNetlistFile, runSimulation, queue tools).

  • Generate and refine schematics (createSchematic*, lint/clean/debug tools).

  • Render real LTspice images for schematics, plots, and symbols.

  • Query RAW vectors and analysis metrics (bandwidth, margins, rise/fall, settling).

  • Automate .meas and assertion-driven verification workflows.

  • Run stepped and Monte Carlo studies with structured results.

Related MCP server: local-mmcp

Quick Start (5 Minutes)

1) Prerequisites

  • macOS with LTspice installed (/Applications/LTspice.app expected by default).

  • Python 3.11+.

  • uv (recommended) or pip.

2) Install

uv sync

If you prefer pip:

python3 -m venv .venv
source .venv/bin/activate
pip install -e .

3) Start the MCP daemon

./scripts/ltspice_mcp_daemon.sh start
./scripts/ltspice_mcp_daemon.sh status

Default endpoint:

  • http://127.0.0.1:8765/mcp

4) Grant macOS permissions once

Required for screenshot/render and some UI automation features.

./scripts/ltspice_mcp_daemon.sh trigger-initial-permissions
./scripts/ltspice_mcp_daemon.sh check-accessibility

5) Run a smoke test

uv run python smoke_test_mcp.py \
  --transport streamable-http \
  --server-url http://127.0.0.1:8765/mcp

Client Configuration

URL-capable MCP clients

[mcp_servers.ltspice]
url = "http://127.0.0.1:8765/mcp"
enabled = true

Claude Desktop via mcp-remote

{
  "mcpServers": {
    "ltspice-mcp": {
      "command": "/opt/homebrew/bin/npx",
      "args": ["-y", "mcp-remote", "http://127.0.0.1:8765/mcp"]
    }
  }
}

stdio (subprocess) mode

{
  "mcpServers": {
    "ltspice-mcp": {
      "command": "ltspice-mcp",
      "args": ["--transport", "stdio"],
      "cwd": "/absolute/path/to/ltspice-mcp"
    }
  }
}

Core Capabilities by Category

Setup and diagnostics

  • getLtspiceStatus, getLtspiceUiStatus

  • daemonDoctor, tailDaemonLog, getRecentErrors, getCaptureHealth

Simulation and queueing

  • simulateNetlist, simulateNetlistFile, runSimulation

  • queueSimulationJob, listJobs, jobStatus, cancelJob, listJobHistory

Schematic workflows

  • createSchematic, createSchematicFromNetlist, createSchematicFromTemplate

  • validateSchematic, lintSchematic, autoDebugSchematic

  • inspectSchematicVisualQuality, autoCleanSchematicLayout

Data, measurements, and verification

  • getPlotNames, getVectorsInfo, getVectorData, getLocalExtrema

  • getBandwidth, getGainPhaseMargin, getRiseFallTime, getSettlingTime

  • parseMeasResults, runMeasAutomation, runVerificationPlan, runSweepStudy

Native LTspice rendering

  • renderLtspiceSchematicImage

  • renderLtspicePlotImage, renderLtspicePlotPresetImage

  • renderLtspiceSymbolImage

  • startLtspiceRenderSession, endLtspiceRenderSession

Reliability Notes

  • Streamable HTTP defaults are tuned for compatibility:

    • json_response = true

    • stateless_http = true

  • UI integration is disabled by default (LTSPICE_MCP_UI_ENABLED=0).

  • Schematic single-window updates are enabled by default.

  • Rendering uses LTspice + ScreenCaptureKit direct-window capture.

  • Run artifacts are stored per run to keep historical results stable.

Daemon Operations

./scripts/ltspice_mcp_daemon.sh start
./scripts/ltspice_mcp_daemon.sh restart
./scripts/ltspice_mcp_daemon.sh stop
./scripts/ltspice_mcp_daemon.sh status
./scripts/ltspice_mcp_daemon.sh logs --lines 200
./scripts/ltspice_mcp_daemon.sh logs --follow

Permission helpers:

./scripts/ltspice_mcp_daemon.sh trigger-screen-recording-permission
./scripts/ltspice_mcp_daemon.sh trigger-accessibility-permission

Testing

Run core tests:

PYTHONPATH=src .venv/bin/python -m unittest discover -s tests -v

Run real ScreenCaptureKit integration tests (opt-in):

LTSPICE_MCP_RUN_REAL_SCK=1 PYTHONPATH=src .venv/bin/python -m unittest tests.test_screencapturekit_integration -v
LTSPICE_MCP_RUN_REAL_SCK=1 PYTHONPATH=src .venv/bin/python -m unittest tests.test_plot_render_mcp_real -v

Contributing

Contributions are welcome. Start with:

When filing bugs, include:

  • MCP server version,

  • LTspice version,

  • transport mode,

  • exact tool call + parameters,

  • daemon log excerpts.

Documentation Map

Important Environment Variables

Core:

  • LTSPICE_BINARY

  • LTSPICE_MCP_WORKDIR

  • LTSPICE_MCP_TIMEOUT

  • LTSPICE_MCP_TRANSPORT

  • LTSPICE_MCP_HOST

  • LTSPICE_MCP_PORT

  • LTSPICE_MCP_STREAMABLE_HTTP_PATH

  • LTSPICE_MCP_JSON_RESPONSE

  • LTSPICE_MCP_STATELESS_HTTP

UI/render:

  • LTSPICE_MCP_UI_ENABLED

  • LTSPICE_MCP_SCHEMATIC_SINGLE_WINDOW

  • LTSPICE_MCP_SCHEMATIC_LIVE_PATH

  • LTSPICE_MCP_SCK_HELPER_DIR

  • LTSPICE_MCP_SCK_HELPER_PATH

  • LTSPICE_MCP_VERIFY_WINDOW_CLOSE

Logging:

  • LTSPICE_MCP_LOG_LEVEL

  • LTSPICE_MCP_TOOL_LOGGING

  • LTSPICE_MCP_TOOL_LOG_MAX_ITEMS

  • LTSPICE_MCP_TOOL_LOG_MAX_CHARS

  • LTSPICE_MCP_DISABLE_UVICORN_NOISE_FILTERS

  • LTSPICE_MCP_DAEMON_LOG_DIR

Available Tools

71 tools
autoCleanSchematicLayoutC

Auto-clean schematic layout and return before/after quality analysis.

Inputs: asc_path (required), output_path, prefer_sidecar_regeneration, grid, +3 more. Returns: object

autoDebugSchematicB

Iteratively validate, simulate, and apply targeted fixes to a schematic until it runs or stalls.

Inputs: asc_path (required), max_iterations, ascii_raw, timeout_seconds, +7 more. Returns: object

cancelJobC

Request cancellation for a queued/running job.

Inputs: job_id (required), force. Returns: object

closeLtspiceWindowA

Close LTspice windows whose title contains title_hint.

Inputs: title_hint (required). Returns: object

createIntentCircuitB

Create a circuit from high-level intent templates (filters, amplifier, regulator).

Returns schematic and sidecar netlist paths, and optionally validation payload.

Inputs: intent (required), parameters, circuit_name, output_path, +5 more. Returns: object

createSchematicC

Create an LTspice .asc schematic from structured component/wire/directive data.

Components must include: symbol, reference, x, y. Optional component fields: value, orientation|rotation, attributes, pin_nets.

Inputs: components (required), wires, directives, labels, +5 more. Returns: object

createSchematicFromNetlistB

Create an LTspice .asc schematic from a SPICE netlist using auto-placement/routing.

Supports common two-pin primitives (R, C, L, D, V, I) plus multi-pin active elements such as X-subcircuits, BJTs (Q), and MOSFETs (M) when symbols can be resolved.

Inputs: netlist_content (required), circuit_name, output_path, sheet_width, +3 more. Returns: object

createSchematicFromTemplateB

Create an LTspice .asc schematic from a JSON template.

Templates support type=netlist (auto-layout) and type=spec (explicit placement).

Inputs: template_name (required), parameters, circuit_name, output_path, +5 more. Returns: object

daemonDoctorC

Run a daemon/system health check and return actionable recommendations.

Inputs: include_recent_warnings, deep_checks. Returns: object

endLtspiceRenderSessionC

Close the LTspice window associated with a render session.

Inputs: render_session_id (required). Returns: object

generatePlotPresetSettingsB

Generate deterministic .plt settings for a named preset.

Inputs: preset (required), vectors, plot, run_id, +3 more. Returns: object

generatePlotSettingsC

Generate a LTspice .plt file from vectors and return parsed settings for debugging.

Inputs: vectors (required), plot, run_id, raw_path, +10 more. Returns: object

generateVerifyAndCleanCircuitB

One-shot orchestration: create intent circuit, lint, simulate, verify, clean, and inspect.

Inputs: intent (required), parameters, assertions, measurements, +11 more. Returns: object

getBandwidthC

Compute -drop_db bandwidth for an AC response vector.

Inputs: vector (required), plot, run_id, raw_path, +3 more. Returns: object

getCaptureHealthC

Summarize ScreenCapture/LTspice capture health from in-process capture events.

Inputs: limit, include_recent_events. Returns: object

getGainPhaseMarginC

Compute gain and phase margins from an AC loop-gain vector.

Inputs: vector (required), plot, run_id, raw_path, +1 more. Returns: object

getLocalExtremaC

Get local minima/maxima for vectors.

Inputs: vectors (required), plot, run_id, raw_path, +2 more. Returns: object

getLtspiceLibraryStatusC

Get LTspice symbol library ZIP status and basic counts.

Inputs: lib_zip_path. Returns: object

getLtspiceStatusA

Get LTspice executable status and server configuration.

Inputs: no named parameters. Returns: object

getLtspiceSymbolInfoC

Get pin map and metadata for a symbol in LTspice's lib.zip.

Inputs: symbol (required), include_source, source_max_chars, lib_zip_path. Returns: object

getLtspiceUiStatusA

Return whether LTspice UI appears to be running on this machine.

Inputs: no named parameters. Returns: object

getPlotNamesA

List LTspice plot names available in one RAW file or all RAW files from a run.

Inputs: run_id, raw_path. Returns: object

getRecentErrorsC

Scan recent daemon logs and return structured error entries.

Inputs: limit, log_count, include_warnings, log_dir. Returns: object

getRiseFallTimeC

Compute first rise/fall times for a transient response.

Inputs: vector (required), plot, run_id, raw_path, +3 more. Returns: object

getRunDetailsB

Get full details for a run_id, or the latest run if omitted.

Inputs: run_id, include_output, log_tail_lines. Returns: object

getSettlingTimeC

Compute settling time to a target within tolerance_percent band.

Inputs: vector (required), plot, run_id, raw_path, +3 more. Returns: object

getToolTelemetryC

Return rolling performance telemetry for MCP tools.

Inputs: tool_name. Returns: object

getVectorDataC

Get data for vectors, optionally interpolated at explicit scale points.

Inputs: vectors (required), plot, run_id, raw_path, +4 more. Returns: object

getVectorsInfoC

Get detailed information about vectors in a plot.

Inputs: plot, run_id, raw_path, step_index. Returns: object

importModelFileC

Import a model file into the MCP workdir for reproducible .include usage.

Inputs: source_path (required), destination_name, models_dir. Returns: object

inspectSchematicVisualQualityC

Inspect schematic visual quality and suggest coordinate-level fixes.

Inputs: asc_path (required), render, settle_seconds, downscale_factor. Returns: object

jobStatusC

Get status for one queued/running/completed simulation job.

Inputs: job_id (required), include_run. Returns: object

lintSchematicC

Run structural lint checks on a schematic, including pin connectivity and dangling wires.

Inputs: asc_path (required), strict, strict_style, min_style_score, +4 more. Returns: object

listIntentCircuitTemplatesB

List high-level circuit intent templates and default parameters.

Inputs: no named parameters. Returns: object

listJobHistoryB

List archived (terminal) queue jobs retained across daemon restarts.

Inputs: limit, status. Returns: object

listJobsC

List queued/running/completed simulation jobs.

Inputs: limit, status, order_by, include_history. Returns: object

listLtspiceLibraryEntriesC

List LTspice symbol ZIP entries (.asy), optionally filtered by query.

Inputs: query, limit, lib_zip_path. Returns: object

listLtspiceSymbolsC

List/search LTspice symbols parsed from the symbol library ZIP.

Inputs: query, library, limit, lib_zip_path. Returns: object

listPlotPresetsA

List built-in deterministic LTspice plot presets.

Inputs: no named parameters. Returns: object

listRunsA

List recent simulation runs (newest first).

Inputs: limit. Returns: result

listSchematicTemplatesA

List available schematic templates from the built-in or user-provided JSON file.

Inputs: template_path. Returns: object

loadCircuitC

Create a netlist file in the MCP workdir and mark it as the currently loaded circuit.

Inputs: netlist (required), circuit_name. Returns: object

loadNetlistFromFileC

Load an existing netlist file (.cir/.net/.sp/.spi/.sub/.lib/.txt) as the current circuit.

Inputs: filepath (required). Returns: object

openLtspiceUiA

Open LTspice UI on a selected artifact.

If path is provided it is opened directly. Otherwise, the path is resolved from run_id and target:

  • target=netlist|raw|log

Inputs: run_id, path, target. Returns: object

parseMeasResultsB

Parse LTspice .meas results from a run log or explicit log path.

Inputs: run_id, log_path. Returns: object

patchNetlistModelBindingsC

Patch netlist model bindings by adding includes and remapping model/subckt names.

Inputs: netlist_path (required), include_files, subckt_aliases, model_aliases, +1 more. Returns: object

queueSimulationJobB

Queue a simulation job and return a job id for status polling/cancelation.

Inputs: netlist_path, netlist_content, circuit_name, ascii_raw, +3 more. Returns: object

readAgentGuideC

Read AGENT_README.md through MCP for interactive agent guidance.

  • section: heading index (1-based) or heading title (exact/contains match)

  • query: optional case-insensitive text search

Inputs: section, query, include_headings, max_chars. Returns: object

readLtspiceUiTextA

Read visible LTspice window text using macOS Accessibility APIs.

Use this to compare parser outputs against text displayed in LTspice UI (for example values shown in log windows).

Inputs: run_id, path, target, title_hint, +6 more. Returns: object

renderLtspicePlotImageB

Render one or more vectors from a RAW dataset to a plot image and return it through MCP.

Supports run_id/raw_path resolution and optional step filtering for stepped runs. pane_layout: single | split | per_trace

Inputs: vectors (required), plot, run_id, raw_path, +19 more.

renderLtspicePlotPresetImageC

Render a plot image using a built-in deterministic preset.

Inputs: preset (required), vectors, plot, run_id, +7 more.

renderLtspiceSchematicImageC

Render an LTspice schematic (.asc) to an image and return it through MCP.

downscale_factor lets clients request smaller rendered images.

Inputs: asc_path (required), output_path, width, height, +5 more.

renderLtspiceSymbolImageC

Render an LTspice symbol to an image and return the image through MCP.

The response includes both image content and structured metadata (image_path, bounds, etc.).

Inputs: symbol (required), output_path, width, height, +5 more.

resetToolTelemetryA

Reset rolling performance telemetry for one tool or all tools.

Inputs: tool_name. Returns: object

resolveSchematicSimulationTargetB

Resolve which file simulateSchematicFile will execute and explain sidecar requirements.

Inputs: asc_path (required), require_sidecar_on_macos. Returns: object

runMeasAutomationC

Inject .meas directives into a netlist, run simulation, and parse measurement values.

Inputs: measurements (required), netlist_path, netlist_content, circuit_name, +5 more. Returns: object

runSimulationA

Run LTspice in batch mode for the currently loaded netlist.

The ngspice-style command parameter is accepted for compatibility, but LTspice ignores it.

Inputs: command, ascii_raw, timeout_seconds, show_ui, +1 more. Returns: object

runSweepStudyC

Run stepped or Monte-Carlo parameter studies and return aggregate metrics.

Inputs: parameter (required), mode, netlist_path, netlist_content, +13 more. Returns: object

runVerificationPlanB

Run simulation (or reuse a run) and evaluate assertion checks in one call.

Assertion types:

  • vector_stat: vector + statistic(min|max|avg|rms|pp|final|abs_max)

  • bandwidth: vector (+ optional drop_db/reference/metric)

  • gain_phase_margin: vector (+ optional metric)

  • rise_fall_time: vector (+ optional metric)

  • settling_time: vector (+ optional tolerance_percent/target_value)

  • meas: name from .meas results

  • all_of: all nested assertions must pass

  • any_of: at least one nested assertion must pass Bounds:

  • min, max Tolerances:

  • target (+ optional rel_tol_pct, abs_tol)

Inputs: assertions (required), run_id, netlist_path, netlist_content, +8 more. Returns: object

scanModelIssuesC

Scan LTspice log text for missing model/include/subcircuit issues.

Inputs: run_id, log_path, search_paths, suggest_matches, +2 more. Returns: object

setLtspiceUiEnabledA

Set default UI behavior for simulation calls where show_ui is omitted.

Inputs: enabled (required). Returns: object

setSchematicUiSingleWindowC

Set whether schematic UI opens reuse a single live schematic path.

Inputs: enabled (required). Returns: object

simulateNetlistC

Write a netlist and run LTspice batch simulation in one call.

Inputs: netlist_content (required), circuit_name, ascii_raw, timeout_seconds, +2 more. Returns: object

simulateNetlistFileC

Run LTspice batch simulation for an existing netlist path.

Inputs: netlist_path (required), ascii_raw, timeout_seconds, show_ui, +1 more. Returns: object

simulateSchematicFileC

Run LTspice batch simulation for an existing schematic (.asc) file.

Optional preflight validation is included to help agents debug schematics before simulation.

Inputs: asc_path (required), ascii_raw, timeout_seconds, show_ui, +3 more. Returns: object

startLtspiceRenderSessionC

Open an LTspice window once for repeated image rendering.

Inputs: path (required), title_hint. Returns: object

syncSchematicFromNetlistFileA

Regenerate schematic from a netlist file only when source content changed.

Stores sync metadata in JSON so repeated calls are fast and deterministic.

Inputs: netlist_path (required), circuit_name, output_path, state_path, +5 more. Returns: object

tailDaemonLogC

Return tail text from the active daemon log file.

Inputs: lines, log_path, log_dir. Returns: object

validateLtspiceMeasurementsB

Validate parsed metric endpoints against LTspice-native .meas values.

This reruns the source netlist with generated measurement directives and compares LTspice's own reported values to the server's computed metrics.

Inputs: vector (required), plot, run_id, raw_path, +11 more. Returns: object

validateSchematicB

Validate a schematic (.asc) for simulation readiness.

Checks for components, ground flag, and simulation directives in TEXT commands.

Inputs: asc_path (required). Returns: object

watchSchematicFromNetlistFileB

Poll a netlist file and regenerate schematic whenever the netlist changes.

Returns update events for each rebuild detected during the watch interval.

Inputs: netlist_path (required), circuit_name, output_path, state_path, +8 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 71 tools

    Disambiguation2/5

    Many tools have overlapping purposes, such as multiple ways to create a schematic (createSchematic, createSchematicFromNetlist, createSchematicFromTemplate, createIntentCircuit) and multiple simulation entry points (simulateNetlist, simulateNetlistFile, simulateSchematicFile, runSimulation, queueSimulationJob). Despite detailed descriptions, the high number of similar tools hinders clear disambiguation for an agent.

    Naming Consistency4/5

    Tool names follow a consistent camelCase verb_noun pattern (e.g., getBandwidth, createSchematic, listJobs). There are minor deviations like 'daemonDoctor' and 'autoCleanSchematicLayout', but overall the naming is predictable and consistent.

    Tool Count2/5

    With 71 tools, the server is heavily overloaded. For a domain like circuit simulation, 10-20 tools would be well-scoped. The excessive number implies redundancy and complexity, making it cumbersome for agents to navigate.

    Completeness4/5

    The tool set covers a wide range of tasks: schematic creation, simulation execution, result analysis, job management, UI interaction, and telemetry. There are minor gaps (e.g., lack of a direct 'delete schematic' tool), but overall it is quite complete for the intended domain.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      A lightweight MCP server that bridges AI agents and macOS, enabling automation of file navigation, application control, UI interaction, browser automation, and system operations.
      239
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for AI agents to control a Mac via screen and mouse/keyboard, supporting Anthropic Claude and OpenAI for task automation.
      236 npm
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      MCP server that enables AI to fully control macOS — mouse, keyboard, terminal, screenshots, window management, UI element detection, and provides AI-optimized information reporting.
      36
      29 npm
      MIT