multisim-mcp 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Multisim MCP contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ include LICENSE
2
+ include README.md
3
+ include pyproject.toml
4
+ recursive-include multisim_mcp *.py
5
+ include multisim_mcp/templates/manifest.json
6
+ recursive-exclude multisim_mcp/templates *.xml
7
+ recursive-include tests test_*.py
8
+ global-exclude __pycache__
9
+ global-exclude *.py[cod]
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.4
2
+ Name: multisim-mcp
3
+ Version: 0.1.0a1
4
+ Summary: Unofficial MCP server for NI Multisim Automation API
5
+ Author: Multisim MCP contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yxy050208/multisim-mcp
8
+ Project-URL: Repository, https://github.com/yxy050208/multisim-mcp
9
+ Project-URL: Issues, https://github.com/yxy050208/multisim-mcp/issues
10
+ Project-URL: Security, https://github.com/yxy050208/multisim-mcp/security/advisories/new
11
+ Keywords: multisim,mcp,circuit,simulation,ai-agent,automation
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Win32 (MS Windows)
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: mcp<2,>=1.2.0
22
+ Requires-Dist: pywin32>=306
23
+ Dynamic: license-file
24
+
25
+ # Multisim MCP
26
+
27
+ <!-- mcp-name: io.github.yxy050208/multisim-mcp -->
28
+
29
+ Unofficial Windows MCP server for creating NI Multisim schematics, running
30
+ experiments, exporting data, and generating reproducible reports.
31
+
32
+ 非官方 Multisim 自动化 MCP:从受限 SPICE 网表生成可编辑电路图,调用本机
33
+ Multisim 执行实验,并导出 `.ms14`、原理图、raw、CSV、SVG 和 Markdown 报告。
34
+
35
+ > Alpha software. This project is not affiliated with NI. Multisim must be
36
+ > installed and licensed locally. The current COM worker requires 32-bit Python.
37
+
38
+ ## Current capability
39
+
40
+ Stable and verified on Multisim 14.3:
41
+
42
+ - MCP stdio lifecycle and 32-bit runtime diagnostics.
43
+ - Open/save circuits and enumerate components, inputs, and outputs.
44
+ - DC operating point, AC sweep, single-frequency AC, and transient analysis.
45
+ - Input waveform injection and RLC value read/write.
46
+ - SPICE netlist execution with safe `op`, `dc`, `ac`, and `tran` commands.
47
+ - Netlist, BOM, schematic image, raw data, CSV, SVG, and Markdown export.
48
+ - High-level `run_circuit_experiment` workflow.
49
+
50
+ Experimental:
51
+
52
+ - Editable schematic generation supports R/L/C, scalar and waveform voltage/current
53
+ sources, B/E/F/G/H controlled sources, T/O/U distributed lines, coupled
54
+ inductors, modeled diodes,
55
+ NPN/PNP BJT, NMOS/PMOS, JFET/MESFET, voltage switches, five-terminal op-amps,
56
+ and generic two-to-sixteen-terminal X subcircuits. Extended families currently
57
+ use verified carrier symbols pending dedicated artwork.
58
+ Native NOT/AND/OR/NAND/NOR/XOR/XNOR and JK flip-flop symbols are available as
59
+ a preview; their open/export and authoritative timing-data paths are verified.
60
+ Native XSC oscilloscope and configurable XFG function-generator state are
61
+ generated alongside authoritative CSV/SVG experiment data.
62
+ Multisim's exported native netlist is checked after opening so silently
63
+ omitted parts fail the run.
64
+ - Generated schematic probes are not enabled by default. Experiment data is
65
+ obtained authoritatively from the same netlist through Multisim's engine.
66
+
67
+ ## Install
68
+
69
+ Requirements:
70
+
71
+ - Windows and a licensed Multisim 14+ installation.
72
+ - 32-bit Python 3.10+.
73
+ - Node.js 18+ only for `.ms14` XML conversion.
74
+
75
+ Install the Python package once; the server launcher never installs packages or
76
+ writes setup logs to MCP stdout:
77
+
78
+ ```powershell
79
+ cd mcp_server
80
+ .\setup.ps1 -Python C:\path\to\python32\python.exe
81
+ npm install --global electronics-workbench-decoder@0.2.0
82
+ ```
83
+
84
+ The public wheel is intentionally code-only: it contains the provenance
85
+ manifest but no XML extracted from NI samples. Before generating schematics,
86
+ build a local component pack from your own licensed installation as described
87
+ below and set `MULTISIM_MCP_TEMPLATE_DIR`. Other Automation API tools can still
88
+ be installed without that pack.
89
+
90
+ Start the server:
91
+
92
+ ```powershell
93
+ .\run_server.ps1
94
+ ```
95
+
96
+ MCP client configuration:
97
+
98
+ ```json
99
+ {
100
+ "mcpServers": {
101
+ "multisim": {
102
+ "command": "C:\\path\\to\\python32\\python.exe",
103
+ "args": ["-m", "multisim_mcp.server"]
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ Call `runtime_status` first when diagnosing installation problems.
110
+
111
+ ### User-local component packs
112
+
113
+ To keep licensed/reverse-engineered component assets separate from the open
114
+ engine, a contributor can derive a local pack from the NI samples installed on
115
+ their own machine:
116
+
117
+ ```powershell
118
+ $env:PYTHONPATH = (Resolve-Path .\mcp_server).Path
119
+ .\tools\python32\python.exe .\tools\bootstrap_local_component_pack.py `
120
+ --output C:\MultisimMcp\component-pack
121
+ $env:MULTISIM_MCP_TEMPLATE_DIR = 'C:\MultisimMcp\component-pack'
122
+ ```
123
+
124
+ The configured pack is the public release's schematic-template source. A local
125
+ development checkout may contain ignored fallback templates, but public wheels
126
+ do not. The generated manifest records relative sample provenance. Local
127
+ reverse-engineering authorization does not itself grant permission to publish
128
+ the resulting XML files.
129
+
130
+ ## Recommended agent workflow
131
+
132
+ The high-level tool accepts a SPICE netlist and a safe experiment command:
133
+
134
+ ```json
135
+ {
136
+ "netlist": "VIN vin 0 DC 10\nR1 vin vout 1k\nR2 vout 0 1k\n.end\n",
137
+ "commands": "dc VIN 0 10 0.1",
138
+ "output_dir": "C:\\experiments\\divider",
139
+ "title": "Resistor divider",
140
+ "overwrite": false
141
+ }
142
+ ```
143
+
144
+ `run_circuit_experiment` will:
145
+
146
+ 1. Validate the supported netlist and analysis command.
147
+ 2. Generate and encode an editable `circuit.ms14`.
148
+ 3. Open the design in Multisim and export `schematic.png`.
149
+ 4. Run the requested analysis through Multisim's engine.
150
+ 5. Export `result.raw`, `data.csv`, `plot.svg`, logs, and `report.md`.
151
+
152
+ Use `create_schematic_from_netlist` when only an editable schematic is needed,
153
+ or `run_spice_netlist` for netlist-only simulation.
154
+
155
+ Virtual instruments use explicit pseudo-device records in the same netlist:
156
+
157
+ ```spice
158
+ XFG1 out 0 inv FGEN WAVE=SINE FREQ=1k AMPLITUDE=2 OFFSET=0.5
159
+ XSC1 out inv 0 0 out 0 OSCILLOSCOPE
160
+ ```
161
+
162
+ The XSC terminal order is A, B, C, D, EXT+, EXT-. XFG supports `WAVE` (SINE,
163
+ SQUARE, or TRIANGLE), `FREQ`, `AMPLITUDE`, `OFFSET`, `DUTY`, and `RISE`.
164
+
165
+ ## Safety model
166
+
167
+ - Safe analysis commands are allowlisted: `op`, `dc`, `ac`, and `tran`.
168
+ - `do_command_line` is disabled by default. It requires the server-side
169
+ `MULTISIM_MCP_ENABLE_UNSAFE_COMMANDS=1` opt-in.
170
+ - Runtime npm downloads are disabled. On Windows the npx fallback remains
171
+ disabled even when opted in because `.cmd` shims are not safe for
172
+ caller-controlled paths. Install the pinned codec globally, or set
173
+ `MULTISIM_MCP_EWD` and `MULTISIM_MCP_EWE` to its `dist/ewd.js` and
174
+ `dist/ewe.js` entry points; the server invokes them through `node.exe`.
175
+ - Existing experiment artifacts are not overwritten unless `overwrite=true`.
176
+ - The server is intended for trusted local stdio clients, not public network
177
+ exposure. See `SECURITY.md` in the repository root.
178
+
179
+ ## Test
180
+
181
+ COM-free tests:
182
+
183
+ ```powershell
184
+ $env:PYTHONPATH = (Resolve-Path .\mcp_server).Path
185
+ C:\path\to\python32\python.exe -m unittest discover -s mcp_server\tests -p 'test_*.py' -v
186
+ ```
187
+
188
+ Real Multisim E2E:
189
+
190
+ ```powershell
191
+ $env:MULTISIM_MCP_E2E_SAMPLE='C:\path\to\fixture.ms14'
192
+ tools\python32\python.exe mcp_server\tests\e2e_mcp_test.py
193
+ ```
194
+
195
+ The E2E test requires a local fixture with RLC components and at least one
196
+ simulation output; proprietary NI sample designs are not distributed.
197
+
198
+ ## License
199
+
200
+ Project code is MIT licensed. NI Multisim, its formats, trademarks, and locally
201
+ installed samples remain subject to their respective owners' terms.
@@ -0,0 +1,177 @@
1
+ # Multisim MCP
2
+
3
+ <!-- mcp-name: io.github.yxy050208/multisim-mcp -->
4
+
5
+ Unofficial Windows MCP server for creating NI Multisim schematics, running
6
+ experiments, exporting data, and generating reproducible reports.
7
+
8
+ 非官方 Multisim 自动化 MCP:从受限 SPICE 网表生成可编辑电路图,调用本机
9
+ Multisim 执行实验,并导出 `.ms14`、原理图、raw、CSV、SVG 和 Markdown 报告。
10
+
11
+ > Alpha software. This project is not affiliated with NI. Multisim must be
12
+ > installed and licensed locally. The current COM worker requires 32-bit Python.
13
+
14
+ ## Current capability
15
+
16
+ Stable and verified on Multisim 14.3:
17
+
18
+ - MCP stdio lifecycle and 32-bit runtime diagnostics.
19
+ - Open/save circuits and enumerate components, inputs, and outputs.
20
+ - DC operating point, AC sweep, single-frequency AC, and transient analysis.
21
+ - Input waveform injection and RLC value read/write.
22
+ - SPICE netlist execution with safe `op`, `dc`, `ac`, and `tran` commands.
23
+ - Netlist, BOM, schematic image, raw data, CSV, SVG, and Markdown export.
24
+ - High-level `run_circuit_experiment` workflow.
25
+
26
+ Experimental:
27
+
28
+ - Editable schematic generation supports R/L/C, scalar and waveform voltage/current
29
+ sources, B/E/F/G/H controlled sources, T/O/U distributed lines, coupled
30
+ inductors, modeled diodes,
31
+ NPN/PNP BJT, NMOS/PMOS, JFET/MESFET, voltage switches, five-terminal op-amps,
32
+ and generic two-to-sixteen-terminal X subcircuits. Extended families currently
33
+ use verified carrier symbols pending dedicated artwork.
34
+ Native NOT/AND/OR/NAND/NOR/XOR/XNOR and JK flip-flop symbols are available as
35
+ a preview; their open/export and authoritative timing-data paths are verified.
36
+ Native XSC oscilloscope and configurable XFG function-generator state are
37
+ generated alongside authoritative CSV/SVG experiment data.
38
+ Multisim's exported native netlist is checked after opening so silently
39
+ omitted parts fail the run.
40
+ - Generated schematic probes are not enabled by default. Experiment data is
41
+ obtained authoritatively from the same netlist through Multisim's engine.
42
+
43
+ ## Install
44
+
45
+ Requirements:
46
+
47
+ - Windows and a licensed Multisim 14+ installation.
48
+ - 32-bit Python 3.10+.
49
+ - Node.js 18+ only for `.ms14` XML conversion.
50
+
51
+ Install the Python package once; the server launcher never installs packages or
52
+ writes setup logs to MCP stdout:
53
+
54
+ ```powershell
55
+ cd mcp_server
56
+ .\setup.ps1 -Python C:\path\to\python32\python.exe
57
+ npm install --global electronics-workbench-decoder@0.2.0
58
+ ```
59
+
60
+ The public wheel is intentionally code-only: it contains the provenance
61
+ manifest but no XML extracted from NI samples. Before generating schematics,
62
+ build a local component pack from your own licensed installation as described
63
+ below and set `MULTISIM_MCP_TEMPLATE_DIR`. Other Automation API tools can still
64
+ be installed without that pack.
65
+
66
+ Start the server:
67
+
68
+ ```powershell
69
+ .\run_server.ps1
70
+ ```
71
+
72
+ MCP client configuration:
73
+
74
+ ```json
75
+ {
76
+ "mcpServers": {
77
+ "multisim": {
78
+ "command": "C:\\path\\to\\python32\\python.exe",
79
+ "args": ["-m", "multisim_mcp.server"]
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ Call `runtime_status` first when diagnosing installation problems.
86
+
87
+ ### User-local component packs
88
+
89
+ To keep licensed/reverse-engineered component assets separate from the open
90
+ engine, a contributor can derive a local pack from the NI samples installed on
91
+ their own machine:
92
+
93
+ ```powershell
94
+ $env:PYTHONPATH = (Resolve-Path .\mcp_server).Path
95
+ .\tools\python32\python.exe .\tools\bootstrap_local_component_pack.py `
96
+ --output C:\MultisimMcp\component-pack
97
+ $env:MULTISIM_MCP_TEMPLATE_DIR = 'C:\MultisimMcp\component-pack'
98
+ ```
99
+
100
+ The configured pack is the public release's schematic-template source. A local
101
+ development checkout may contain ignored fallback templates, but public wheels
102
+ do not. The generated manifest records relative sample provenance. Local
103
+ reverse-engineering authorization does not itself grant permission to publish
104
+ the resulting XML files.
105
+
106
+ ## Recommended agent workflow
107
+
108
+ The high-level tool accepts a SPICE netlist and a safe experiment command:
109
+
110
+ ```json
111
+ {
112
+ "netlist": "VIN vin 0 DC 10\nR1 vin vout 1k\nR2 vout 0 1k\n.end\n",
113
+ "commands": "dc VIN 0 10 0.1",
114
+ "output_dir": "C:\\experiments\\divider",
115
+ "title": "Resistor divider",
116
+ "overwrite": false
117
+ }
118
+ ```
119
+
120
+ `run_circuit_experiment` will:
121
+
122
+ 1. Validate the supported netlist and analysis command.
123
+ 2. Generate and encode an editable `circuit.ms14`.
124
+ 3. Open the design in Multisim and export `schematic.png`.
125
+ 4. Run the requested analysis through Multisim's engine.
126
+ 5. Export `result.raw`, `data.csv`, `plot.svg`, logs, and `report.md`.
127
+
128
+ Use `create_schematic_from_netlist` when only an editable schematic is needed,
129
+ or `run_spice_netlist` for netlist-only simulation.
130
+
131
+ Virtual instruments use explicit pseudo-device records in the same netlist:
132
+
133
+ ```spice
134
+ XFG1 out 0 inv FGEN WAVE=SINE FREQ=1k AMPLITUDE=2 OFFSET=0.5
135
+ XSC1 out inv 0 0 out 0 OSCILLOSCOPE
136
+ ```
137
+
138
+ The XSC terminal order is A, B, C, D, EXT+, EXT-. XFG supports `WAVE` (SINE,
139
+ SQUARE, or TRIANGLE), `FREQ`, `AMPLITUDE`, `OFFSET`, `DUTY`, and `RISE`.
140
+
141
+ ## Safety model
142
+
143
+ - Safe analysis commands are allowlisted: `op`, `dc`, `ac`, and `tran`.
144
+ - `do_command_line` is disabled by default. It requires the server-side
145
+ `MULTISIM_MCP_ENABLE_UNSAFE_COMMANDS=1` opt-in.
146
+ - Runtime npm downloads are disabled. On Windows the npx fallback remains
147
+ disabled even when opted in because `.cmd` shims are not safe for
148
+ caller-controlled paths. Install the pinned codec globally, or set
149
+ `MULTISIM_MCP_EWD` and `MULTISIM_MCP_EWE` to its `dist/ewd.js` and
150
+ `dist/ewe.js` entry points; the server invokes them through `node.exe`.
151
+ - Existing experiment artifacts are not overwritten unless `overwrite=true`.
152
+ - The server is intended for trusted local stdio clients, not public network
153
+ exposure. See `SECURITY.md` in the repository root.
154
+
155
+ ## Test
156
+
157
+ COM-free tests:
158
+
159
+ ```powershell
160
+ $env:PYTHONPATH = (Resolve-Path .\mcp_server).Path
161
+ C:\path\to\python32\python.exe -m unittest discover -s mcp_server\tests -p 'test_*.py' -v
162
+ ```
163
+
164
+ Real Multisim E2E:
165
+
166
+ ```powershell
167
+ $env:MULTISIM_MCP_E2E_SAMPLE='C:\path\to\fixture.ms14'
168
+ tools\python32\python.exe mcp_server\tests\e2e_mcp_test.py
169
+ ```
170
+
171
+ The E2E test requires a local fixture with RLC components and at least one
172
+ simulation output; proprietary NI sample designs are not distributed.
173
+
174
+ ## License
175
+
176
+ Project code is MIT licensed. NI Multisim, its formats, trademarks, and locally
177
+ installed samples remain subject to their respective owners' terms.
@@ -0,0 +1,3 @@
1
+ """Unofficial Multisim MCP server."""
2
+
3
+ __version__ = "0.1.0a1"