Codex setup
The RunMat plugin lets Codex run MATLAB-syntax code and work in the Projects open in RunMat Desktop on the same computer. Runs appear in the app.
Set up Codex
- Install RunMat Desktop, open it and sign in.
- Open the Project you want Codex to work in.
- Open Settings › Connections. Under On this computer, choose Connect next to Codex.
- Start a new Codex session, enter
/mcpand confirm that therunmatserver is connected. - The first time Codex works in a Project, RunMat asks in Connected agents. Choose Allow while this project is open or Always allow.
Connecting installs the RunMat plugin, which adds RunMat's MCP server and skills. RunMat Desktop serves the tools while it's open. The skills apply automatically when the task matches, or explicitly with $run-matlab-code and $work-in-runmat-project.
To install the plugin from a terminal, or to connect another MCP client on the same computer, see Coding agents on your computer.
Verify the connection
Try these checks in a new Codex session:
- Ask RunMat for its status.
- Run
x = linspace(0, 2*pi, 200); plot(x, sin(x));. - Confirm that RunMat returns the figure without a runtime error.
- Ask Codex to list the Project's files before making any change.
If RunMat is absent from the tools list, reinstall the plugin from Settings › Connections and start a new session. Also check that RunMat Desktop is open and signed in. See Troubleshooting.