
How to add MATLAB MCP Server to Cursor
MathWorks' official server that lets agents start MATLAB, write and run code, lint scripts, and execute test files. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 1.1k★ · stdio · no auth · official
Cursor config for MATLAB MCP Server
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary{
"mcpServers": {
"matlab-mcp-server": {
"command": "/fullpath/to/matlab-mcp-server-binary",
"args": []
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the MATLAB MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of MATLAB MCP Server's tools to confirm it's connected.
Before you start
- MATLAB R2021a or later installed and on the system PATH (releases from the past five years supported)
- The matlab-mcp-server binary from GitHub Releases (macOS: curl the arm64/x64 build and chmod +x), or `go install github.com/matlab/matlab-mcp-server/cmd/matlab-mcp-server@latest`
- For attaching to existing sessions: run `./matlab-mcp-server --setup-matlab` once, then `shareMATLABSession()` in MATLAB (R2023a+)
- Claude Desktop only: the matlab-mcp-server.mcpb bundle plus Anthropic's Filesystem extension
What MATLAB MCP Server can do in Cursor
detect_matlab_toolboxesReport installed MATLAB version and toolboxes.
check_matlab_codeRead-only static analysis of a .m file: style, potential errors, deprecated functions, performance issues.
evaluate_matlab_codeEvaluate a string of MATLAB code in a project directory and return the output.
run_matlab_fileExecute a .m script by absolute path and return the output.
run_matlab_test_fileRun a MATLAB unit-test file and return comprehensive results.
Security
evaluate_matlab_code and run_matlab_file execute arbitrary code in a local MATLAB session with your user's permissions — MathWorks itself says to review every tool call before approving. Anonymized telemetry is on by default (opt out with --disable-telemetry=true), and usage must follow the MathWorks Software License Agreement: the server must not be shared by multiple users.
MATLAB MCP Server + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the MATLAB MCP Server config there under the "mcpServers" key and restart the client.
Is MATLAB MCP Server safe to use with Cursor?
evaluate_matlab_code and run_matlab_file execute arbitrary code in a local MATLAB session with your user's permissions — MathWorks itself says to review every tool call before approving. Anonymized telemetry is on by default (opt out with --disable-telemetry=true), and usage must follow the MathWorks Software License Agreement: the server must not be shared by multiple users.
Is the MATLAB MCP Server free?
The server itself is a free download from MathWorks' GitHub, but it is useless without a licensed MATLAB R2021a+ installation — it launches the real product. MathWorks' license also forbids sharing one server across multiple users, so it is strictly a per-developer tool.
Can it use the MATLAB session I already have open?
Yes — that is the default 'auto' mode's first choice. Install the MATLAB MCP Server Toolbox once with ./matlab-mcp-server --setup-matlab, run shareMATLABSession() in your MATLAB (R2023a or newer), and the server attaches to that session instead of starting a new one.
Does it send my code or data to MathWorks?
Your code runs locally in your MATLAB; what MathWorks collects is fully anonymized usage telemetry, enabled by default. Set --disable-telemetry=true (or the MW_MCP_SERVER_DISABLE_TELEMETRY env var) to opt out.