Skip to main content
MCP server CX Codex

MATLAB MCP Server — Claude Code MCP server: run MATLAB from your agent

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

Open on GitHub

What MATLAB MCP Server 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.

What it helps with

  • 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 for the agent

  • 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

How to install MATLAB MCP Server

Install

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

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about MATLAB MCP Server

How do I install the MATLAB MCP Server in Claude?

Install MATLAB R2021a or later and put it on your PATH, then download the server binary from the latest release. In your terminal run claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary with the full path to that file.

What does the MATLAB MCP Server do?

It gives an agent access to MATLAB: starting and quitting a session, writing and running code, and assessing code for style and correctness.

Why does the server fail to find MATLAB in Codex on Windows?

Codex does not forward WINDIR, which MATLAB and Simulink need to run. Add env_vars = ["WINDIR"] to the [mcp_servers.matlab] section of C:\Users\<username>\.codex\config.toml.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →
repo-intake-and-plan lllllllama Scans a repository through its README and project files, then builds a small reproduction plan. Use it before running experiments. CX Codex +1 476,200installs explore-code lllllllama A skill for cautious code experiments in deep learning repositories: it transplants modules and adapts architectures on an isolated branch, with rollback-aware records. CX Codex +1 336,700installs anysearch anysearch-ai This skill gives an agent web search, domain-specific queries, parallel batch search, and page extraction. Use it when a task needs current information or a claim needs checking. CX Codex +1 38,500installs learn tw93 A six-phase research workflow that turns source material into notes, an outline, or a publish-ready draft. Use it for unfamiliar domains and multi-source work. CX Codex +1 13,200installs REA morluto Analyzes binaries, Electron bundles, and JavaScript runtimes directly from your agent. It inspects compiled apps without source code to recreate specific features. CX Codex +1 ★ 392,262repo stars GitHub official github Wires your AI agent into GitHub: read code, open issues and pull requests, watch Actions runs. Saves a trip to the browser. CX Codex +1 ★ 33,989repo stars Netdata netdata Hands your AI agent live monitoring data: metrics, logs, alerts and anomaly detection. Useful when you need to know what a server is doing without opening the dashboard. CX Codex +1 ★ 81,163repo stars browser-use browser-use Give an agent browser tasks such as finding information, extracting page data, and filling forms. Connect it when those actions need to happen on the web. CX Codex +1 ★ 119,231repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor