# MATLAB MCP Server [Health: Active]

**Category:** 👨‍💻 Code Execution  
**Repository:** https://github.com/matlab/matlab-mcp-server  
**GitHub Stars:** 1815  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/matlab-mcp-server

## Description
Connect AI coding agents to MATLAB. Run code, tests, and analysis via MCP.

## Tools
Capabilities this server exposes over MCP:

- **script_path**
- **code**
- **project_path**

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/matlab/matlab-mcp-server), copied verbatim. Run them in order; they are not an mcpServers config.

1. Install:

```sh
go install github.com/matlab/matlab-mcp-server/cmd/matlab-mcp-server@latest
```

2. Install:

```sh
curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-arm64
```

3. Install:

```sh
curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-x64
```

4. Run:

```sh
chmod +x ~/Downloads/matlab-mcp-server
```

5. Add to Claude Code:

```sh
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary
```

6. Add to Claude Code:

```sh
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary --initial-working-folder=/home/username/myproject
```

## Documentation

## What MATLAB MCP Server does

MATLAB MCP Server MCP server lets an MCP-compatible AI application control a local MATLAB installation. It supports starting and quitting MATLAB, writing and executing MATLAB code, and assessing MATLAB code for style and correctness. The exposed tools are `script_path`, `code`, and `project_path`, which provide the agent with entry points for working with scripts, code, and project locations.

This server is intended for development and analysis workflows where an AI agent needs MATLAB rather than a general-purpose shell or programming runtime. It can also assist with MATLAB and Simulink work when paired with the MATLAB Agentic Toolkit or Simulink Agentic Toolkit. Those toolkits are separate projects and are not required by the server description itself.

## How it works

The MATLAB MCP Server MCP server runs as a local process using the stdio transport. The AI application starts the server binary and communicates with it through MCP. MATLAB normally starts when the first tool is called, although startup can be changed so MATLAB initializes when the server launches.

The server selects MATLAB from the system PATH by default. A command-line argument or corresponding environment variable can identify a specific MATLAB installation. The initial MATLAB working folder can also be configured; without that setting, the server uses the AI application's first MCP root when available, or a platform-specific default folder.

## Setup and configuration

Install MATLAB R2021a or a later release and add it to the system PATH. For Windows and Linux, download the latest server release or build it from source with Go. On macOS, download the binary matching Apple silicon or Intel hardware and make it executable.

Register the binary with an MCP client. Claude Desktop uses the provided `.mcpb` bundle and requires its Filesystem extension to allow access to selected folders.

Supported configuration includes `--matlab-root`, `--initialize-matlab-on-startup`, `--initial-working-folder`, and `--matlab-display-mode`. Flags can be supplied in the client configuration or on the command line. Environment variable names use the `MW_MCP_SERVER_` prefix, with hyphens converted to underscores; command-line flags take precedence when both forms are supplied.

## Tools and capabilities

The MATLAB MCP Server MCP server exposes three MCP tools:

- `script_path` for workflows involving MATLAB script paths.
- `code` for sending MATLAB code to the connected environment.
- `project_path` for identifying the MATLAB project path used by the workflow.

Together with the server's MATLAB lifecycle and code-assessment functions, these tools let an agent execute MATLAB work and inspect code quality or correctness.

## Limitations and notes

A MATLAB installation is required; the server is not a standalone MATLAB runtime. The documented minimum version is R2021a. MATLAB desktop visibility is configurable, with `desktop` as the default display mode and `nodesktop` available for non-desktop use.

On Windows, Codex does not forward `WINDIR` by default. The README instructs Windows users to add `WINDIR` to the relevant Codex MCP server configuration so MATLAB and Simulink can run.

_Full upstream README: https://allmcps.com/mcp/matlab-mcp-server/readme_

