Content
# Tool List
[中文](#) | [English](#english)
## English
This is a lightweight MCP server for **CST Studio Suite**. It implements MCP over Node.js stdio JSON-RPC and delegates CST operations to a Windows PowerShell helper that talks to CST through COM automation.
There are no third-party npm dependencies. After downloading the repository, you only need Node.js, PowerShell, and a local CST Studio Suite installation.
### Tools
The server exposes 9 tools:
| Tool | Purpose |
| --- | --- |
| `cst_ping` | Connect to CST COM and report basic status |
| `cst_open_project` | Open an existing `.cst` project |
| `cst_save_project` | Save the active project, or save it to a new path |
| `cst_run_vba_code` | Run VBA code in the active project |
| `cst_run_vba_file` | Run a `.bas` / `.vbs` macro file |
| `cst_add_to_history` | Add one step to the History List |
| `cst_set_parameter` | Set or update a project parameter |
| `cst_rebuild` | Rebuild the model |
| `cst_start_solver` | Start the solver |
### Requirements
- Windows
- CST Studio Suite with COM automation support
- PowerShell 5.1 or later
- Node.js 18 or later
- An MCP client, such as Codex
> If `node` is intercepted by the Windows Store app execution alias, install Node.js or use the absolute path to the real `node.exe` in your MCP config.
### Download
```powershell
git clone https://github.com/RFer-Dreaming/cst-mcp.git
cd cst-mcp
```
You can also use **Code -> Download ZIP** on GitHub and extract the folder locally.
### Codex MCP Configuration
Add this block to your Codex MCP config, replacing `C:\\path\\to\\cst-mcp` with your local checkout path:
```toml
[mcp_servers.cst]
command = "node"
args = ["C:\\path\\to\\cst-mcp\\cst-mcp-server.js"]
env = { CST_MCP_POWERSHELL = "powershell.exe" }
```
See [codex-mcp-config.example.toml](codex-mcp-config.example.toml) for a complete example.
### Smoke Tests
The default smoke test does not require CST. It only checks that the MCP server can initialize and list its tools:
```powershell
npm run smoke
```
Or run it directly:
```powershell
node scripts\smoke-test.js
```
If CST is installed, you can run the optional COM test:
```powershell
npm run smoke:cst
```
On success, it prints the JSON result returned by `cst_ping`. If it fails, check that CST is installed, the COM ProgID matches your CST version, and PowerShell execution is not blocked by system policy.
### Notes
- This repository is intended for GitHub sharing and direct download, not npm publishing.
- CST project files, logs, local dependencies, and temporary files are ignored by default.
- The default CST COM ProgID is `CSTStudio.Application`; versioned ProgIDs such as `CSTStudio.Application.2025` can be passed through tool arguments when needed.
### License
MIT License. See [LICENSE](LICENSE).