Content
# originpro-mcp
English | [English](README-en.md)
OriginPro MCP service for Codex, calling OriginLab OriginPro through stdio transport.
## Prerequisites
- Windows.
- OriginLab OriginPro COM Automation Server installed and registered.
- Node.js 20 or higher.
- Codex installed and MCP service configurable.
## Deployment
It is recommended to install from GitHub as a global command:
```powershell
npm install -g github:noc228076/origin-pro-mcp-codex#codex/publish-originpro-mcp
```
Confirm the command is available after installation:
```powershell
originpro-mcp
```
If you are developing in the source code directory:
```powershell
npm install
npm run build
npm link
```
`npm link` will register the current source code package as a global `originpro-mcp` command, making it convenient for Codex to start directly.
## Startup
Normally, there is no need to manually start the service. Codex will automatically start `originpro-mcp` according to the MCP configuration.
If you only want to manually verify that the service can start, you can run:
```powershell
originpro-mcp
```
You can also run it during source code debugging:
```powershell
npm start
```
On Windows, you can also double-click:
```text
start-originpro-mcp.cmd
```
## Codex Configuration
Use the following JSON in Codex's MCP configuration. This example assumes the repository is located at `D:\Documents\origin-pro-mcp-codex`; if your repository is in a different location, please replace this path with your actual repository directory.
```json
{
"type": "stdio",
"command": "node",
"args": [
"D:\\Documents\\origin-pro-mcp-codex\\dist\\index.js"
],
"env": {
"ORIGIN_MCP_WORKDIR": "D:\\Documents\\origin-pro-mcp-codex"
}
}
```
Restart Codex after modifying the configuration.
## CCSwitch Configuration
If you are running directly from the current source code directory, you can use the following JSON in CCSwitch. This example assumes the repository is located at `D:\Documents\origin-pro-mcp-codex`; if your repository is in a different location, please replace this path with your actual repository directory.
```json
{
"type": "stdio",
"command": "node",
"args": [
"D:\\Documents\\origin-pro-mcp-codex\\dist\\index.js"
],
"env": {
"ORIGIN_MCP_WORKDIR": "D:\\Documents\\origin-pro-mcp-codex"
}
}
```
## Path Description
- `ORIGIN_MCP_WORKDIR` is the working directory for Origin project files, exported images, and other files.
- All file tools only accept relative paths.
- Absolute paths and `..` out-of-bounds paths are rejected.
## Description
- This MCP service is for OriginLab OriginPro.
- Uses stdio transport.
- Codex will automatically manage the service process as an MCP client.
## MCP Tools
- `origin_status`
- `origin_connect`
- `origin_set_visible`
- `origin_new_project`
- `origin_load_project`
- `origin_save_project`
- `origin_run`
- `origin_exit`
- `origin_create_page`
- `origin_put_worksheet`
- `origin_get_worksheet`
- `origin_execute_labtalk`
- `origin_get_ltvar`
- `origin_set_ltvar`
- `origin_get_ltstr`
- `origin_set_ltstr`
- `origin_plot_xy`
- `origin_set_plot_style`
- `origin_set_axis_style`
- `origin_apply_graph_theme`
- `origin_create_combo_chart`
- `origin_create_publication_figure`
- `origin_export_graph`
## Recommended Calling Process
1. `origin_connect`
2. `origin_create_publication_figure`
3. `origin_export_graph`
4. `origin_save_project`
It is recommended that the agent prioritizes calling these advanced tools and does not directly write LabTalk unless the existing tools do not cover it.