MATLAB MCP Server
The official MathWorks MCP server: the agent starts and quits MATLAB, writes and runs code, and checks it for errors and style
High risk
We rate an entry high when the tool writes to external systems, handles money, production databases or secrets, or runs arbitrary commands. The CLI installs it only with your consent.
Why this level
- Runs arbitrary MATLAB code on the user's machine
- Starts and quits MATLAB processes and works with project files
Install
Manual install
go install github.com/matlab/matlab-mcp-server/cmd/matlab-mcp-server@latestBuild from source, needs Go. Prebuilt binaries for Windows, Linux and macOS are on the releases page.
This is third-party code. Review the repository files before installing.
What it does
The server connects an MCP client to a MATLAB installation on the machine. The agent can start and quit MATLAB, evaluate a line of code or run a full .m script and get the output, run tests under the MATLAB test framework, and perform static analysis of a script without executing it. A separate tool returns the installed toolboxes and their versions. The server can start a new MATLAB session or connect to an existing one via shareMATLABSession, with or without the desktop. It offers configuration through flags and MW_MCP_SERVER_ environment variables, custom tools through extension files, and resources with MATLAB coding rules the agent reads before generating code.
Who it is for. For engineers, researchers and analysts who write and run MATLAB code and want to connect an agent to it.
Good fit when
- You want the agent to write and run MATLAB code in your installation
- You want to run MATLAB tests and get the results parsed
- You want to lint a script for errors, deprecated functions and style without running it
- You need the installed toolboxes and their versions
Not a fit when
- There is no MATLAB R2021a or newer installed on the machine
- You need a shared or centralized multi-user install without arranging it with MathWorks
Example request
Run my analysis.m script and explain what the plot showsLimitations
Requires MATLAB R2021a or newer on the system PATH; the MATLAB license is bought separately from MathWorks. The server ships as a Go binary for Windows, Linux and macOS on the releases page, or builds from source via go install. Under the MathWorks license agreement the server must not be shared by multiple users. It collects anonymized telemetry by default, disabled with the disable-telemetry flag. Connecting to an existing session requires installing a toolbox first and calling shareMATLABSession.
How to disable. In Claude Code run claude mcp remove matlab. In other clients delete the matlab entry from the MCP configuration, or remove the extension in Claude Desktop.
MCP
- Transport
- stdio
- Authentication
- not required
| Environment variables | |
|---|---|
| MW_MCP_SERVER_MATLAB_ROOT | Path to the MATLAB installation to use, without /bin. By default the first MATLAB on PATH is used. |
Security check
- Runs arbitrary MATLAB code on the user's machine
- Starts and quits MATLAB processes and works with project files
README in short
The README presents the official MathWorks MCP server for running MATLAB from an agent. It documents the tools: detecting installed toolboxes, static code checks, evaluating code, running a script and running a test file, plus resources with MATLAB coding rules. It gives setup for Claude Code, Claude Desktop, GitHub Copilot in VS Code and Codex, installing via a release binary or a go install build. Arguments are set through flags or MW_MCP_SERVER_ environment variables, with session modes new, auto and existing. It notes telemetry on by default and the MathWorks license terms.
FAQ
Is this the official MathWorks server?
Yes, the repository belongs to the MathWorks organization and is presented as the official MATLAB MCP Server.
Do I need a MATLAB license?
Yes. The server runs on top of an installed MATLAB R2021a or newer, licensed separately from MathWorks.
Related
166 skills for scientific work: bioinformatics, cheminformatics, clinical data, geospatial analysis and 100+ databases
Google's open-source MCP server for databases: ready tools for Postgres, MySQL, BigQuery, Spanner and more, plus custom tools in tools.yaml
Official Hugging Face skills: Hub operations via the hf CLI, datasets, model training, Spaces, evals and deployment
A visualization language for agents and an MCP server: neat charts from a simple semantic spec