LTSpice MCP 服务器
概览
模型上下文协议(MCP)服务器,允许代理和MCP客户端在macOS上控制LTspice,进行模拟、原理图生成、数据提取、验证和渲染。 该项目旨在实现实用自动化:可靠运行、可复现的伪造物,以及与LTspice行为高度匹配的输出。 灵感来源:- gtnoble/ngspice-mcp - luc-me/ltspiceMCP - 从 MCP 运行 LTspice 模拟(simulateNetlistFile、runSimulation、队列工具)。- 生成和优化原理图(createSchematic*、lint/清理/调试工具)。- 渲染原理图、图和符号的真实 LTspice 图像。- 查询 RAW 向量和分析指标(带宽、裕度、升降、稳定)。- 自动化 .meas 和断言驱动的验证流程。- 运行逐步和蒙特卡洛研究,并有结构化结果。 - macOS 安装了 LTspice(默认支持 /Applications/LTspice.app)。- Python 3.11+。- UV(推荐)或 PIP。 默认端点:- http://127.0.0.
概述(AI 翻译)
模型上下文协议(MCP)服务器,允许代理和MCP客户端在macOS上控制LTspice,进行模拟、原理图生成、数据提取、验证和渲染。
该项目旨在实现实用自动化:可靠运行、可复现的伪造物,以及与LTspice行为高度匹配的输出。
灵感来源:
- GTNOBLE/Ngspice-MCP
- luc-me/ltspiceMCP
你能做什么
- 从 MCP(
simulateNetlistFile、runSimulation,队列工具)运行 LTspice 仿真。 - 生成和优化原理图([
createSchematic*,lint/clean/debug工具)。 - 渲染真实的LTspice图像,用于示意图、图和符号。
- 查询RAW向量和分析指标(带宽、裕度、升降、稳定)。
- 自动化
.meas和断言驱动的验证工作流。 - 运行阶梯和蒙特卡洛研究,结果有结构化。
快速开始(5分钟)
1) 先决条件
- macOS 安装了 LTspice(默认情况下期望为
/Applications/LTspice.app)。 - Python 3.11+。
uv(推荐)或pip。
2)安装
如果你更喜欢PIP:
3)启动MCP守护进程
默认端点:
http://127.0.0.1:8765/mcp
4) 一次性授予macOS权限
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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
.measand assertion-driven verification workflows. - Run stepped and Monte Carlo studies with structured results.
Quick Start (5 Minutes)
1) Prerequisites
- macOS with LTspice installed (
/Applications/LTspice.appexpected by default). - Python 3.11+.
uv(recommended) orpip.
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,getLtspiceUiStatusdaemonDoctor,tailDaemonLog,getRecentErrors,getCaptureHealth
Simulation and queueing
simulateNetlist,simulateNetlistFile,runSimulationqueueSimulationJob,listJobs,jobStatus,cancelJob,listJobHistory
Schematic workflows
createSchematic,createSchematicFromNetlist,createSchematicFromTemplatevalidateSchematic,lintSchematic,autoDebugSchematicinspectSchematicVisualQuality,autoCleanSchematicLayout
Data, measurements, and verification
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"ltspice-mcp": {
"command": "/opt/homebrew/bin/npx",
"args": ["-y", "mcp-remote", "http://127.0.0.1:8765/mcp"]
}
}
}