MATLAB MCP Server
Lets your AI agent start MATLAB, write and run MATLAB code, and check code for style and correctness.
1.8k stars on GitHubby MathWorksLicense NOASSERTIONUpdated 24 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Download the .mcpb file and open it with Claude Desktop.
Download the .mcpb file βReady! Now test it
Restart the app and paste one of these requests in the chat:
Run this MATLAB script and show me the output.
Check my MATLAB function for style problems and fix them.
What it is
The official MATLAB MCP Server from MathWorks connects your AI agent to a MATLAB installation on your computer. The agent can start and quit MATLAB, run code and assess your code. It can start a new MATLAB session or connect to one that is already running.
What it can do
- Start and quit MATLAB
- Write and run MATLAB code
- Assess MATLAB code for style and correctness
- Connect to an existing MATLAB session with
shareMATLABSession() - Custom tools through an extension file
When to use
- βΊWhen you want your agent to run MATLAB code and read the results.
- βΊWhen you want a review of your MATLAB code for style and correctness.
- βΊWhen you want the agent to work in the MATLAB session you already have open.
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
scientific-toolkit-skillHelps your agent write and debug MATLAB or Python scientific code for signal and image processing, statistics, simulations, and publication-ready figures.matlabLets your agent build, review, and plan numerical workflows in MATLAB or GNU Octave. It handles data, tests, and graphics.matlabHelps your agent write and debug MATLAB and GNU Octave scripts for matrix math, signal and image processing, differential equations, optimization, and plots.Frequently asked questions
Is it official?
Yes, it is the official MATLAB MCP Server from MathWorks.
What do I need first?
MATLAB R2021a or later, added to your PATH. Connecting to an existing session needs R2023a or later.
Which agents does it work with?
Any AI app that supports MCP. The readme gives steps for Claude Code, Claude Desktop, GitHub Copilot in VS Code and Codex.
Can it use my open MATLAB?
Yes. Run the setup once with --setup-matlab, then run shareMATLABSession() in MATLAB and use session mode existing or auto.
Can I hide the MATLAB window?
Yes. Use --matlab-display-mode=nodesktop, although commands that need a graphical interface will still open windows.
Can I choose which MATLAB version?
Yes, with the --matlab-root argument. By default it uses the first MATLAB found on your PATH.
If it does not work
- βΊMake sure MATLAB is installed and on your system PATH, or set --matlab-root.
- βΊOn Windows with Codex, add env_vars = ["WINDIR"] to the matlab section of config.toml.
- βΊOn macOS, run chmod +x on the downloaded binary so it can run.
5 new skills a week. 1 minute to read.