igor-bridge-mcp-server
Health Uyari
- No license — Repository has no license file
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Gecti
- Code scan — Scanned 2 files during light audit, no dangerous patterns found
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
MCP server for Igor Pro 9+
Igor Pro Bridge
An MCP server that exposes a running Igor Pro instance to Claude (or any MCP
client) as a set of tools: run commands, read wave data, manage compilation,
launch/relaunch Igor Pro, and more. It talks to Igor Pro over the
ZeroMQ-XOP's CallFunction
JSON protocol (a plain localhost TCP socket), calling into Igor-side helper
functions in procedure/ZMQ_BridgeHelpers.ipf (the ZBR independent module).
Key functions
- Run code —
run_igor_codecompiles and runs procedure code as a ProcGlobal
function (flow control, local variables, the experiment's own constants and functions).
It is the default way to run anything beyond a short command. - Run commands —
execute_igor_commandruns a command line and returns what it
printed and its error message. By default Igor's Debugger is disabled for the call,
so a Debugger pause can't hang it; errors never open a modal dialog. - Long-running commands —
submit_igor_commandqueues a command and returns a
token immediately without waiting;poll_igor_commandchecks completion later.
Reliable across bridge/Claude Desktop restarts, and across waits of any length
(hours to weeks), since all state lives in Igor Pro's own data waves, not in this
bridge's process. - Tests —
run_igor_testscompiles changed procedures and starts a test run of
IgorTest;get_igor_test_resultsreturns
its results from the JUnit output once the run has finished. - Read data back —
get_wavereturns an existing wave's full data and
metadata (any dimensionality, numeric/complex/text/wave-reference).read_session_historyreads back everything sent to Igor's history area. - Compilation management —
check_compilation_state/reload_and_compile_procedurescheck and refresh Igor's compiled state
after editing a.ipffile on disk. - Windows and dialogs —
list_igor_windowslists Igor's top-level windows,
e.g. a modal dialog blocking the bridge, with the texts and buttons of each
dialog;click_igor_dialog_buttonclicks a button by its caption,close_igor_windowcloses a dialog (WM_CLOSE, Escape, and only on request
Enter, which selects the default button),send_key_to_igor_windowsends a
key andcapture_igor_windowreturns a screenshot of a window, e.g. of an
unknown dialog, all without needing OS focus.check_bridge_healthreports such dialogs,
andload_experimentanswers the old instance's "save changes to experiment?"
question with "No". - Debugger control —
get_debugger_state/set_debugger_enabled/restore_debugger_settingsread, change, and restore Igor's Debugger
settings (must be disabled for unattended/automated use). - Environment inspection —
get_environment_summarysummarizes the live
instance (version, loaded experiment, XOPs, included procedure files, data
folders, Debugger settings).read_help_filereads an Igor help file
(.ihf) as structured text, optionally with character styles, and caches it;edit_help_fileedits a help file with Notebook operations and verifies its topics.get_bridge_versionreports the running
bridge/Python/package versions. - Launching and switching instances —
configure_igor_launchrecords the
Igor Pro executable path to use, and optionally a custom ZeroMQ port (for
talking to more than one Igor Pro instance, one at a time);launch_igor_pro_unattendedlaunches it with/UNATTENDEDand waits for it
to become reachable;load_experimentquits the running instance and
relaunches it with a.pxpfile path as a launch argument;switch_igor_profilequits Igor Pro, activates another profile (user files
folderIgor Pro <N> User Files_<profile>inDocuments\WaveMetrics) by
renaming the folders, and relaunches it. - Health check —
check_bridge_healthdiagnoses whether this bridge can
reach Igor Pro's ZeroMQ server right now.
How to install
This bridge is a local MCP server (stdio transport): it only works from a
Claude Desktop session running on the same Windows machine as Igor Pro.
One-time Igor-side setup:
- Add the ZeroMQ XOP to Igor Pro
- The XOP is shipped in the ZeroMQ-XOP folder
- Unpack the zip file with subfolders
- Open Igor Pro and from the Help menu choose
Show Igor Pro User Files - navigate to the output\win\x64\xop\Release subfolder from the unpacked XOP
- Put a shortcut to
ZeroMQ-64.xopin theIgor Extensions (64-bit)folder - Put a shortcut to the
procedure\ZMQ_BridgeHelpers.ipffile in theIgor Proceduresfolder - Put a shortcut to the
procedure\ZBR_UserProceduresfolder in theUser Proceduresfolder.
The bridge includesZBR_ProcGlobal.ipffrom there on demand (run_igor_code), see below.
Install the pinned Python dependencies, into the same Python
environment Claude Desktop itself resolves when it launches the bridge:.\install.ps1Run this from an elevated PowerShell (elevation is required only for
pywin32's one-time COM-support DLL registration, not for running the
bridge or Igor Pro afterward). Optionally, pass-PythonPathto target a specific
interpreter if auto-resolution picks the wrong one. SeeGet-Help ./install.ps1 -Fullfor details.Install the Claude Desktop extension (
.mcpb). A pre-built package is
included atmcp/igor-pro-bridge-<version>.mcpb(build a new one withmcpb pack mcp). In Claude Desktop, go to
Settings → Extensions → Advanced settings → Extension Developer → Install
Extension, and select that file. Do not register this bridge by manually
editingclaude_desktop_config.json— that does not work reliably for
local MCP servers in current Claude Desktop builds.Restart Claude Desktop fully, then call the bridge's
get_bridge_version
tool to confirm it's running, andcheck_bridge_healthto confirm it can
reach Igor Pro.
First steps
- When starting Igor Pro there should be a printout in the history
Igor Pro Bridge MCP bound through ZMQ at port 5680. - Close Igor Pro
- In Claude Desktop (or your agent), say you want to start Igor Pro. It should ask you for the path. Give the path and it will remember it and start Igor Pro.
- Ask to print "Hello World" to the Igor Pro history
The general idea is that you have some repository / folder where your .ipf files are that you work on. Allow Claude write access to this folder.
Then it can edit these files on disk and reload the changes in Igor Pro and recompile.
It is worthwhile to hint Claude that it should read the Igor Help for specific tasks first as it has a dedicated function for this included.
Working with the bridge
run_igor_codeis the default for running code. It runs as a compiled ProcGlobal function:
flow control, local variables, WAVE/NVAR/SVAR references and the experiment's own constants and
functions all work. Useprintto return data.execute_igor_commandis for quick queries and for what only works outside functions, e.g.QuitorExecute/P .... On Igor's command line, results of built-in functions must be printed or
assigned, there is no flow control, and SVAR/NVAR/WAVE references are not allowed.- Recompiling stops background tasks.
run_igor_coderecompiles every time and refuses while
named background tasks run (e.g. a data acquisition); call already compiled code withexecute_igor_commandthen. - Reload before tests.
run_igor_testscompiles changed procedure files first, otherwise Igor Pro
goes uncompiled in the middle of the run when it notices them. - When the bridge does not answer,
check_bridge_healthtells whether Igor Pro runs, is busy or
shows a dialog;list_igor_windows/close_igor_windowclose such dialogs.
Advanced Use
The mcp folder includes some session notes to help Claude.
run_igor_code compiles and runs scratch code as functions in ProcGlobal, e.g. small utility functions.
The code is written to procedure\ZBR_UserProcedures\ZBR_Scratch.ipf, which ZBR_ProcGlobal.ipf includes. On first use the bridge
adds ZBR_ProcGlobal.ipf to the experiment with INSERTINCLUDE; remove_scratch_procedures takes it out again.
While it is included, commands run in ProcGlobal context as well, so the experiment's constants and functions resolve as on Igor's own command line.
The MCP Bridge is able to run multiple instances of Igor Pro with different ports for ZeroMQ communication.
You can ask Claude to start a new Igor Pro instance with a custom port. (default is 5680)
Then Claude can talk and identify each instance by its port and work with each Igor Pro instance independently.
Claude Desktop can take advantage of the Igor Programming Tool !
If you put ipt in your working folder or PATH then Claude can call it to generate symbol tables or the advanced syntax tree of your Igor Pro code and thus, understand it better. The ipt tool is also suitable for automatically formatting Igor code.
Requirements
- Igor Pro 9.00 or later, running on Windows, with the ZeroMQ-XOP installed
and loaded. procedure/ZMQ_BridgeHelpers.ipf(or a copy of it)#include-d and
compiled into the target experiment.- Python (accessible as
pythonon PATH), with the pinned packages inrequirements.txtinstalled into that same environment —mcp,pyzmq,
and (on Windows)pywin32andcomtypes.requirements.txtpins every package, direct
and transitive, with hashes for supply-chain integrity; install withinstall.ps1rather than a plainpip install.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi