Matlab MCP Server Python logo

Matlab MCP Server Python

by HanSur94

Connects AI agents to MATLAB for code execution, file access, toolbox discovery, plotting, and asynchronous job management.

Install Matlab MCP Server Python

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "hansur94-matlab-mcp-server-python": {
      "command": "uvx",
      "args": [
        "matlab-mcp-python"
      ],
      "env": {
        "MATLAB_MCP_POOL_MATLAB_ROOT": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings β†’ Developer β†’ Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-testedβ€” we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

HanSur94/matlab-mcp-server-python MCP server connects MCP-compatible AI clients to a local MATLAB installation through Python and the MATLAB Engine API. It executes MATLAB code synchronously for short tasks and promotes longer work to asynchronous jobs with status, progress, results, and cancellation tools. The server also exposes workspace, toolbox, help, code-checking, file, image, plotting, and operational monitoring capabilities. Reach for it when an agent needs to run MATLAB analysis, inspect MATLAB data, or manage simulations without manually switching between the agent and MATLAB.

Use cases

  • Run MATLAB simulations and numerical analysis
  • Check MATLAB scripts before execution
  • Inspect workspaces, toolboxes, and function help
  • Read MATLAB data files and images
  • Track long-running MATLAB jobs

Key features

  • Synchronous and asynchronous MATLAB code execution
  • Job progress, cancellation, and result retrieval
  • MATLAB toolbox and function discovery
  • Plotly conversion for MATLAB figures
  • Session file and data access
  • Engine-pool and server health monitoring

Tools20

What Matlab MCP Server Python lets your agent do. Expand a tool for its parameters.

Self-reported~284 tokens of context

Security & health

What it can reach and how reliably it runs β€” from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

6/6 checks healthy over the last 80d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev Β· matlab-mcp-python (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars4Stargazers on the source repository.
Last commit3mo agoMost recent push to the default branch.
Tools exposed20Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Matlab MCP Server Python works

What HanSur94/matlab-mcp-server-python MCP server does

HanSur94/matlab-mcp-server-python MCP server gives an MCP client access to a shared MATLAB installation. Agents can submit MATLAB code, inspect the current workspace, discover installed toolboxes and their functions, request MATLAB help text, and run checkcode/mlint to find warnings or errors before execution.

The server also handles session files and common data formats. Agents can upload and delete files, list the session directory, read MATLAB scripts, and load .mat, .csv, .json, .txt, or .xlsx content in summary or raw form. PNG, JPG, and GIF files can be read for inline rendering in supported agent interfaces.

MATLAB figures are converted to Plotly JSON, with a static PNG and thumbnail available as a fallback for clients that do not render interactive charts. The documented conversion covers line, scatter, bar, area, subplot or tiled layouts, multiple axes, and linear or logarithmic scales.

How it works

HanSur94/matlab-mcp-server-python MCP server uses Python and the MATLAB Engine API for Python to communicate with MATLAB R2022b or newer. Fast calls return directly. Work that exceeds the synchronous threshold is represented by a job ID, allowing the agent to check progress, retrieve the completed result, cancel the work, or list jobs in the session.

A MATLAB engine pool tracks available and busy engines and can scale across multiple engines. The server supports single-user stdio mode and HTTP-based operation with streamable HTTP as the preferred transport. SSE remains available as a legacy transport for existing clients, and sessions are isolated in the multi-user mode described by the project.

Custom MATLAB .m functions can also be exposed as MCP tools through YAML configuration, allowing existing MATLAB libraries to be used without rewriting them as MCP implementations.

Setup and configuration

Python 3.10 or newer and MATLAB R2022b or newer are required, along with the MATLAB Engine API for Python. The project supports installation from PyPI or source. Its Pixi tasks can start the server, install an engine package matched to the detected MATLAB release, and run stdio, streamable HTTP, or SSE transports. The repository also provides a Windows installer for supported Windows 10 and 11 systems.

Start a single-user server with matlab-mcp. For multi-user HTTP operation, use matlab-mcp --transport streamablehttp; use --transport sse when an existing SSE client requires it. Docker is supported, but the image does not contain MATLAB, so a local MATLAB installation must be mounted. When using the documented Docker setup, MATLAB_MCP_POOL_MATLAB_ROOT points to the mounted MATLAB directory.

Claude Desktop, Claude Code, and Cursor connection examples are provided in the project documentation. Cursor uses a project .cursor/mcp.json file, while Claude Code registers the command with claude mcp add.

Tools and capabilities

The exposed tools include:

  • execute_code for MATLAB commands, with automatic synchronous or asynchronous handling.
  • check_code, get_workspace, list_toolboxes, list_functions, and get_help for inspection and code quality checks.
  • get_job_status, get_job_result, cancel_job, and list_jobs for asynchronous work.
  • upload_data, delete_file, list_files, read_script, read_data, and read_image for session file operations.
  • get_pool_status, get_server_metrics, get_server_health, and get_error_log for server and engine-pool monitoring.

Limitations and notes

MATLAB is not bundled with the Docker image or the Python package, and the MATLAB Engine installation must match the local MATLAB release. Interactive plots depend on the client being able to render Plotly JSON; other clients can use the generated static image fallback. The project documents Windows and macOS support in its feature list, while Pixi instructions also describe a cross-platform workflow.

Reviews

No reviews yet β€” be the first to share how it worked for you.

Frequently Asked Questions about Matlab MCP Server Python

HanSur94/matlab-mcp-server-python is an MCP server that connects AI agents to a local MATLAB installation through Python and the MATLAB Engine API. Its main tools execute MATLAB code, check scripts, inspect workspaces, manage asynchronous jobs, read session files, discover toolboxes, and retrieve MATLAB help and results.

Install it from PyPI with `pip install matlab-mcp-python`, install the MATLAB Engine API for Python from your MATLAB installation, then run `matlab-mcp`. The repository also supports source installation, Pixi tasks, and a Windows `install.bat` workflow.

Yes, HanSur94/matlab-mcp-server-python works with Cursor. Add an `mcpServers` entry using the `matlab-mcp` command to `.cursor/mcp.json` in the project, then start the server and connect from Cursor.

Long MATLAB jobs are promoted to asynchronous work and return a job ID instead of waiting for an inline result. Use the status tool to view progress, retrieve the completed result with the result tool, cancel pending or running work, or list jobs in the session.

Related MCP servers

Add a badge to your READMEShow it’s listed β€” live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMatlab MCP Server Python AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/hansur94-matlab-mcp-server-python?style=directory)](https://allmcps.com/mcp/hansur94-matlab-mcp-server-python)
HTML Embed
<a href="https://allmcps.com/mcp/hansur94-matlab-mcp-server-python"><img src="https://allmcps.com/api/badge/hansur94-matlab-mcp-server-python?style=directory" alt="Matlab MCP Server Python on AllMCPs" /></a>