Skip to content
Skillpedia
βœ“ Official Β· MathWorks● Free and open sourceπŸ’» LocalπŸ”“ No API keyProgramming

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

MATLAB R2021a or later installed and on your system PATH. Download the server binary from the GitHub releases page, or install it with MathWorks' Agentic Toolkit Installer.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

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.