MCP Directory

MATLAB MCP Server

Official

MathWorks' official server that lets agents start MATLAB, write and run code, lint scripts, and execute test files.

Unverified
stdio (local)
No auth
Go

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "matlab-mcp-server": {
      "command": "/fullpath/to/matlab-mcp-server-binary",
      "args": []
    }
  }
}

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

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

About MATLAB MCP Server

This is MathWorks running MATLAB for your agent, not a reimplementation. The server is a standalone Go binary that finds MATLAB on the PATH (or via --matlab-root), starts it lazily on the first tool call, and pipes code and results back over stdio. Because it drives a licensed local install, everything MATLAB can do — toolboxes included — is available, and detect_matlab_toolboxes tells the agent exactly what it has to work with.

The five tools split cleanly between safe and side-effectful. check_matlab_code is explicitly read-only static analysis (style, deprecated functions, performance smells), which gives agents a lint-before-run loop; evaluate_matlab_code, run_matlab_file, and run_matlab_test_file actually execute. Two MCP resources — MATLAB coding standards and plain-text Live Code guidelines — let clients ground code generation in MathWorks' own conventions.

Session handling is the standout for real workflows. Default auto mode attaches to an existing MATLAB session if you have shared one (shareMATLABSession() after installing the toolbox via --setup-matlab, R2023a+), falling back to launching a fresh one; --matlab-display-mode=nodesktop keeps it headless. Arguments can also arrive as env vars with the MW_MCP_SERVER_ prefix, which is handy in JSON configs.

Trade-offs: you need a MATLAB license (there is no free tier of the underlying product), Claude Desktop setup goes through an .mcpb bundle plus the Filesystem extension rather than plain JSON, and telemetry is opt-out. The license is MathWorks' own (not OSI), restricting use to licensed MATLAB and prohibiting shared/centralized server deployments.

Tools & capabilities (5)

detect_matlab_toolboxes

Report installed MATLAB version and toolboxes.

check_matlab_code

Read-only static analysis of a .m file: style, potential errors, deprecated functions, performance issues.

evaluate_matlab_code

Evaluate a string of MATLAB code in a project directory and return the output.

run_matlab_file

Execute a .m script by absolute path and return the output.

run_matlab_test_file

Run a MATLAB unit-test file and return comprehensive results.

When to use it

  • Iterate on MATLAB algorithms from Claude Code: generate, lint with check_matlab_code, then execute and read results
  • Attach to your open MATLAB session so the agent can inspect and manipulate the live workspace you are debugging
  • Run MATLAB unit-test files and have the agent fix failures across the codebase
  • Audit code quality: batch static analysis for deprecated functions and style violations before a release

Quick setup

  1. 1Install MATLAB R2021a+ and ensure it is on the system PATH
  2. 2Download the binary for your OS from the Releases page; on macOS run chmod +x on it
  3. 3Claude Code: `claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary` (append flags like --initial-working-folder after the binary path)
  4. 4Claude Desktop: install the Filesystem extension, then double-click the downloaded matlab-mcp-server.mcpb bundle and click Install
  5. 5Optional: `--matlab-session-mode=existing` after running shareMATLABSession() in MATLAB to reuse your open session

Security notes

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 FAQ

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.

Alternatives to MATLAB MCP Server

Compare all alternatives →

Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).

Featured
Verified
stdio (local)
No auth
TypeScript
12 tools
Updated 26 days agoRepo

Up-to-date, version-specific library documentation injected into your coding agent.

Verified
stdio (local)
API key
TypeScript
2 tools
Updated 1 month agoRepo

Pack any local or remote repository into one AI-ready file your agent can grep and read incrementally.

Unverified
stdio (local)
No auth
TypeScript
6 tools
Updated 5 hours agoRepo