OriginLab-MCP
Enables controlling OriginLab Origin through MCP to read and write worksheets, build and style multi-panel graphs, and export figures, reporting what Origin actually did rather than what it was asked to do. Works from macOS or Linux against Origin running in a Windows VM.
README
OriginLab-MCP
An MCP server for OriginLab Origin. It reads and writes worksheets, builds and styles multi-panel graphs, and exports figures — and it is careful about the difference between what Origin accepted and what Origin did.
1.0.0. Every tool here has been run against a real Origin 2024, the Origin App installs and starts the bridge, and
examples/five_panel_figure.pybuilds a five-panel figure end to end.Known gaps, so they are not a surprise: a legend placed in a corner is checked for being inside its panel, not for sitting on top of the data; a log axis gets no minor ticks unless you ask; and the 213-entry option table records what Origin documents, not what each option was measured to do — sixteen of them have been watched change a picture.
Requirements
- Origin or OriginPro 2021b or newer (embedded Python 3.9+)
- Python 3.10+ for the server
- Windows, either natively or in a VM
Install
pip install originlab-mcp
originlab-mcp --build-app .
That prints the three steps Origin needs, which are worth stating here because
the obvious one does nothing: dragging the folder onto the Apps gallery is
accepted in silence and adds no button. Copy the generated OriginLab MCP Bridge folder into %LOCALAPPDATA%\OriginLab\Apps, pack it from Origin's
Command Window with
mkOPX app:="OriginLab MCP Bridge" opx:="C:\path\to\OriginLab MCP Bridge.opx";
— backslashes, because forward slashes hang mkOPX — and drag the resulting
.opx into Origin. A button appears; clicking it brings the Script Window
forward, where the bridge reports starting, loaded, serving.
Point your MCP client at originlab-mcp.
originlab-mcp --status says whether a bridge is listening, and exits non-zero
when one is not. originlab-mcp --stop ends it.
Stopping is a command rather than a second button because a button must not do
the work itself: while the bridge serves it holds Origin's UI thread, so
anything the button ran would run from inside the message pump. A button that
only spawns an external process is possible -- that is how the upstream project
does it -- but the instruction still has to reach the bridge over the socket,
and --stop is that instruction without the indirection.
What's different
Origin accepts a great deal that it then ignores, without ever saying so.
set <plot> -zzzz 9— an option Origin has never heard of — returns true, reads back as 9.0, and leaves the graph pixel-for-pixel identical.plot:=2003is not a plot type. Origin makes the window, draws the axes, writes the legend, and plots nothing.- A style written to a plot inside a group reads back exactly as requested, while Origin goes on drawing the group's style.
None of these is catchable from the reply, so the checking happens before the write and after the figure:
Before. Options are checked against Origin's own documented list, and an
invented one is refused with the options it was probably meant to be. This
matters because the real names are unguessable — line width is -w, bar fill
pattern is -pfp — so a plausible guess is the likely failure, not a typo.
Writing to a grouped plot member is refused outright. Plot types come from
oPlotIDs.h in the Origin installation rather than from documentation, and
every name in the table was drawn and looked at.
After. A per-call check cannot reach the question that matters, which is whether the figure is right. So the operations that build one report the thing that could contradict them:
| operation | what it reports back |
|---|---|
origin_plot |
the layer used, and how many plots Origin says are in it |
origin_layers_arrange |
every layer's real geometry, and the box they all occupy |
origin_legend_set |
where the legend is, and whether that is inside its layer |
origin_axis_set |
which side of the frame the title landed on |
That list exists because of a measured failure: a five-panel figure where all
twenty-three steps returned OK and the result was unusable. One legend had been
placed at left = 24953 on a page 6432 wide — legend.x is in data
coordinates, not the percentages it was being given — and Origin's export grew
the canvas to contain it, squeezing the figure into a corner. Nothing in any
reply said anything was wrong.
A read-back is reported as a read-back, never as proof:
{
"requested": 60,
"readback": {"readable": true, "value": 60.0, "matches_request": true},
"readback_means": "Origin stored this value where 'get' can find it. It is not
proof that the graph changed: Origin also stores options it
does not recognise."
}
Exporting the graph is the only thing that settles it, which is why
origin_graph_export is a first-class tool rather than a way to save pictures.
Arguments this server does not read are refused, with the nearest name it
does. The same failure it guards against in Origin turned up here first:
worksheet_read takes max_rows, and a call passing rows=3 used to get every
row in the sheet and no indication its argument had been dropped.
The tool surface is small on purpose. One plot tool with a plot_type
parameter rather than one per chart type; one plot_option_get/set pair
rather than a wrapper per property.
Tools
origin_ping |
Is the bridge alive — answers even when originpro is broken |
origin_bridge_status |
Where the bridge is, and whether it is answering |
origin_worksheet_info |
Size, column names, formats |
origin_worksheet_read |
Columns as lists, refusing rather than truncating |
origin_worksheet_write |
Columns in, with the format stated not guessed |
origin_plot |
Plot columns into a new page or a new layer of an existing one |
origin_graph_info |
Layers, plots, addresses, group membership |
origin_graph_export |
PNG out — and the only witness that a style took |
origin_layer_add |
Add a panel, and say what its index is |
origin_layers_arrange |
Grid the panels, and report where they really went |
origin_legend_set |
Rebuild a legend, place it, check it is inside its panel |
origin_axis_set |
Scale, range and title, with the title's side reported |
origin_axis_get |
Read an axis back |
origin_plot_option_get |
Read one LabTalk set option |
origin_plot_option_set |
Write one, and report what that established |
origin_set_options |
Search Origin's 213 documented set options |
origin_labtalk |
The escape hatch, with Origin's output captured |
examples/five_panel_figure.py builds a
five-panel figure end to end and prints, at every step, the number that could
contradict it.
Setups
Windows, everything local — the usual case. Server and Origin on the same machine, talking over loopback TCP.
Origin in a Windows VM, working from macOS or Linux — also supported. The server runs inside the VM over ssh; only the MCP client is on the host. This works because the server reaches Origin through a loopback socket rather than COM, which cannot cross a Windows session boundary.
MCP client ──ssh──▶ server (Windows) ──TCP 127.0.0.1──▶ Origin
docs/remote-origin.md walks through that one:
the ssh server, the key (Windows puts an administrator's in a different file
and ignores the usual one without saying so), and pointing an MCP client at it.
Notes on Origin's behaviour
Things measured here that no documentation mentions:
- originpro is single-threaded, absolutely. Called from any thread but Origin's UI thread it blocks while holding the GIL and deadlocks the whole embedded interpreter. Origin's window stays responsive; its Python is gone. The bridge therefore serves on that thread and pumps Origin's message queue between requests.
- A modal dialog stops the bridge, because the dialog holds the thread the bridge serves on — while the handshake file goes on saying it is up. Exporting into a directory that does not exist opens one, so that is checked before the export is sent.
- A legend has two pairs of coordinates in different spaces.
legend.x/legend.yare the layer's data coordinates;legend.left/.topare page units, the same onespage.widthreports. plotxy ogl:=<new>makes a new layer, not a new page, and does not make it active.[<new>]is the new page.- Origin exchanges the axes for bar charts and reports it through no layer property. It moves the title objects to match and keeps their rotation, so the value-axis title ends up under the frame reading bottom to top.
-wis points × 500;-wptakes points. Passing a point value to-wgives a hairline rather than an error.- A fill pattern set with
-pfpalone is invisible: Origin draws it in the fill colour, so-pfcis needed too, and neither changes anything on its own. - LabTalk stops at the first statement it rejects, so a script that reports failure has run an unknown prefix of itself.
- Origin refuses to start Python while a command is in flight, and every bridge
request is one. Scripts containing
run -pyforpy.execare refused up front rather than failing without explanation.
References
- Ge-Shun/origin-mcp — the embedded-bridge transport approach this project's architecture follows.
- garethbeaumo/originlab-mcp — a COM-attached server; simpler to run when Origin is on the same desktop session.
- Origin LabTalk reference · originpro
Origin and OriginPro are products of OriginLab Corporation. This project is not affiliated with OriginLab.
Licence
MIT.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。