Skip to content
github-actions[bot] edited this page Mar 18, 2026 · 21 revisions
# MATLAB MCP Server Wiki

Welcome to the **MATLAB MCP Server** wiki! This server connects any AI agent to a shared MATLAB installation via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/).

## Quick Navigation

- **[[Installation]]** — Prerequisites, MATLAB Engine API, server setup
- **[[Configuration]]** — Full YAML config reference with all options
- **[[MCP Tools Reference]]** — All built-in tools with parameters and examples
- **[[Custom Tools]]** — Expose your own `.m` functions as AI-callable tools
- **[[Examples]]** — Ready-to-run MATLAB examples for common tasks
- **[[Architecture]]** — System design, engine pool, async jobs, session model
- **[[Async Jobs]]** — Long-running jobs, progress reporting, job lifecycle
- **[[Security]]** — Function blocklist, workspace isolation, upload limits
- **[[Plotting]]** — MATLAB figure conversion to interactive Plotly charts
- **[[Troubleshooting]]** — Common issues and solutions
- **[[FAQ]]** — Frequently asked questions

## What is this?

A Python MCP server that gives AI agents (Claude, Cursor, Copilot, custom agents) the ability to:

- **Execute MATLAB code** — sync for fast commands, async for long-running jobs
- **Discover toolboxes** — browse installed toolboxes, functions, and help text
- **Check code quality** — run `checkcode`/`mlint` before execution
- **Get interactive plots** — figures auto-converted to interactive Plotly JSON
- **Use custom libraries** — expose your `.m`/`.mex` functions as first-class MCP tools
- **Monitor jobs** — track progress, get metrics, cancel long-running simulations

## Key Features

| Feature | Details |
|---------|---------|
| Elastic engine pool | Scales 2-10+ engines based on demand |
| Multi-user support (SSE) | Session isolation with per-user workspaces |
| Auto-async execution | Long jobs automatically promoted to async with progress reporting |
| Plot conversion | Every MATLAB figure → interactive Plotly charts with full style preservation |
| Code checking | Pre-flight validation with `checkcode`/`mlint` |
| Custom tools | Expose your own MATLAB functions via simple YAML config |
| Cross-platform | Windows + macOS, MATLAB 2020b+ |

## Quick Start

### Prerequisites

- **Python 3.10+**
- **MATLAB 2020b+** with MATLAB Engine API for Python installed

### Install

```bash
pip install matlab-mcp-python

Run

# Single user (stdio)
matlab-mcp

# Multi-user (SSE)
matlab-mcp --transport sse

Connect to Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "matlab": {
      "command": "matlab-mcp"
    }
  }
}

Supported Platforms

Platform MATLAB Version Transport
macOS 2020b+ stdio, SSE
Windows 2020b+ stdio, SSE
Docker 2020b+ SSE (mount your MATLAB)

Getting Help

Clone this wiki locally