# MATLAB MCP Server

MathWorks' official MCP server lets an AI agent start MATLAB, write and run code, and check it for style and correctness.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 1723
- Author: matlab
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/matlab/matlab-mcp-server
- Updated: 2026-10-15
- HTML: https://affpapa.org/en/nevibecode/mcp/matlab-mcp-server

## What it does

The server wires an AI agent into MATLAB. Through it the agent starts and quits a MATLAB session, writes and runs code, and reviews what it wrote for style and correctness. Any application that speaks Model Context Protocol works, and Claude takes it with one terminal command.

You need MATLAB R2021a or later installed and on the system PATH before anything else. Grab the server binary from the latest GitHub release: a ready file for Windows and Linux, separate macOS builds for Apple silicon and Intel. On macOS you then run `chmod +x` on the downloaded file so it can execute. Prefer building it yourself? Install Go and compile from source instead.

Windows users running Codex hit a snag: Codex does not forward the `WINDIR` environment variable, and MATLAB and Simulink need it. Add it by hand to `C:\Users\<username>\.codex\config.toml` under `[mcp_servers.matlab]`. Server behaviour is tuned with arguments, and `--initial-working-folder` sets the folder the session opens in.

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- run a MATLAB script without leaving the agent chat
- check MATLAB code for style and correctness
- run MATLAB tests from inside a Claude session
- open MATLAB in a specific project folder with `--initial-working-folder`
- hook MATLAB into an agent in VS Code or Cursor via `mcp.json`

## Example prompts
- Add the MATLAB MCP Server and run my `analysis.m` script
- Review this MATLAB code for style and correctness
- Start MATLAB in `/home/username/myproject` and run the tests

## Similar
- [repo-intake-and-plan](https://affpapa.org/en/nevibecode/skills/repo-intake-and-plan.md) — skill · 476200 installs
- [explore-code](https://affpapa.org/en/nevibecode/skills/explore-code.md) — skill · 336700 installs
- [anysearch](https://affpapa.org/en/nevibecode/skills/anysearch.md) — skill · 38500 installs
- [learn](https://affpapa.org/en/nevibecode/skills/learn.md) — skill · 13200 installs
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
