VPI MCP
by Fierceman26
README.md
# VPI MCP
This is a personal learning project for controlling VPIphotonics Design Suite through MCP on Windows. It was assembled while learning the tool. It is not an official product, and it has not been validated for general distribution.
Use it at your own risk. The author is not responsible for lost data, occupied licenses, incorrect simulation results, or any other loss that results from using it.
Feedback is welcome through [GitHub Issues](https://github.com/Fierceman26/vpi-mcp/issues).
This wrapper is released under the [MIT License](LICENSE). The license covers this repository. VPIphotonics, its commercial license, examples, and trademarks remain with their owners.
## Requirements
- Windows only
- Python >=3.11,<3.12
- Dependencies in `pyproject.toml`: `mcp`, `pywin32`, and `pythonnet`
```text
python -m pip install -e .
```
The server speaks stdio. The installed `vpi-mcp` command calls `vpi_mcp.server:main()`.
## Environment variables
Point these variables at your own installation and workspace. This repository does not publish an install location, and the server does not manage licenses.
| Variable | Purpose |
|---|---|
| `VPI_INSTALL_DIR` | Required. Your own VPIphotonics installation directory. The server refuses to start when it is missing |
| `VPI_VERSION` | Defaults to `11.7`. Learning checks covered this version |
| `VPI_WORKSPACE_DIR` | Defaults to `workspace` under the current directory. Writes are allowed only inside this directory |
| `VPI_PDE_ENDPOINT` | Discovered automatically when unset. Required when more than one PDE endpoint is visible |
| `VPI_MCP_DEBUG` | Off by default. Set to `1`, `true`, `yes`, or `on` to enable it |
```json
{
"mcpServers": {
"vpi": {
"command": "python",
"args": ["-m", "vpi_mcp"],
"env": {
"VPI_INSTALL_DIR": "<your VPI installation directory>",
"VPI_VERSION": "11.7",
"VPI_WORKSPACE_DIR": "<your own writable workspace>"
}
}
}
}
```
## Limits
- Only one PDE and one in-progress SED job can run at a time. A second `vpi_pde_start` is refused before launch when a PDE is already running.
- `vpi_pde_shutdown` calls `Quit`, `Exit`, or `CloseApplication` when the contract exposes one of them, and it does not force a save. Otherwise it ends only the PID recorded for that launch. Whether the license is released is reported as `unknown`.
- A Resource Replacement Wizard or a daily prompt has to be dismissed by a person. The server does not click those dialogs, and a longer open timeout is not a fix.
- The only product set with learning evidence is `OS,PC`.
- SED fails immediately on `Universe is empty`. Running the simulation again does not fill an empty universe.
- An unfinished script run leaves a recovery directory. The next run reports that path and stays locked until `recovery_action` is `continue` or `abandon`. The recovery data is kept.
- Copy a demo before editing it. Do not modify the original examples in the installation directory.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues