execute_matlab_code
Execute MATLAB code and return the results
Run MATLAB code and get its results back, or have the code written from a description first, with either kept as a script on disk when you ask for it.
LABSCO SUMMARY
Two tools cover the whole loop — describe, generate, run, read the output — and the saveScript and scriptPath pair is what makes it more than a scratchpad, since the code behind a number survives the conversation. What is not here is everything around a session: no workspace inspection, no variable listing, no figure or plot handling, so anything past running code and reading its output sits outside this set.
A two-tool bridge to a MATLAB installation: one executes code and returns the results, the other generates code from a natural language description.
A MATLAB installation the server can drive, and a writable scriptPath when saveScript is set. Apache-2.0 licensed.
Build from source — git clone https://github.com/WilliamCloudQi/matlab-mcp-server.git
USE CASES
Run the code against the local MATLAB installation and read the results back, saving the script to a path when the run is one you will want to repeat.
Describe what the script should do, get MATLAB code back, then run it in the same session and iterate on whatever the output says.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
execute_matlab_codeExecute MATLAB code and return the results
generate_matlab_codeGenerate MATLAB code from a natural language description
BEFORE YOU INSTALL
2 tools when we connected.
The documented client runs the server on your machine.
CONTEXT COST
Rated by the size of the 2 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
git clone https://github.com/WilliamCloudQi/matlab-mcp-server.git
cd matlab-mcp-server
npm install
npm run buildAfter the build, add this to ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%/Claude/claude_desktop_config.json on Windows, with the path pointing at build/index.js inside your clone:
{
"mcpServers": {
"matlab-server": {
"command": "node",
"args": [
"<YOUR_PATH_TO_MATLAB_MCP_SERVER>/build/index.js"
],
"env": {
"MATLAB_PATH": "<YOUR_MATLAB_PATH>"
},
"disabled": false,
"autoApprove": []
}
}
}Set MATLAB_PATH to your MATLAB executable — usually C:\Program Files\MATLAB\R2023b\bin\matlab.exe on Windows, /Applications/MATLAB_R2023b.app/bin/matlab on macOS, /usr/local/MATLAB/R2023b/bin/matlab on Linux.