matlab-mcp-server

Execute MATLAB code, manage sessions, and check code quality through the Model Context Protocol.

7|2|Updated May 16, 2026
One-click install
npx skills add https://github.com/reason-machines/mcp-skills --skill matlab-mcp-server-reason-machines
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: matlab-mcp-server
Source: https://github.com/reason-machines/mcp-skills/tree/main/skills/matlab-mcp-server
Command: npx skills add https://github.com/reason-machines/mcp-skills --skill matlab-mcp-server-reason-machines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI assistants cannot natively run MATLAB code or interact with MATLAB sessions, forcing engineers and researchers to manually copy code between their AI tool and MATLAB. This Skill connects AI applications directly to MATLAB via the official MathWorks MCP server, enabling code execution, expression evaluation, and code quality checks from within the AI conversation. ## Core Features & Use Cases - Code Execution: Run MATLAB scripts and evaluate expressions through the execute_matlab_code and evaluate_matlab_expression tools, with results returned directly to the AI. - Session Management: Start new MATLAB sessions, connect to existing shared sessions via shareMATLABSession(), and run in desktop or headless nodesktop mode. - Code Quality Checks: Analyze MATLAB code for style and correctness issues using the built-in Code Analyzer via the check_matlab_code tool. - Use Case: A data scientist asks the AI to load a CSV dataset, compute group statistics and a linear regression model in MATLAB, then save a filtered signal plot as a PNG, all without leaving the chat. ## Quick Start Install the server binary, register it with your AI client using the stdio transport, then ask the AI to run a MATLAB calculation such as computing the eigenvalues of a matrix.

Frequently Asked Questions about matlab-mcp-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run MATLAB code from an AI assistant?▼

Install the MATLAB MCP Server and register it with your AI client using the stdio transport. The server exposes an execute_matlab_code tool that runs MATLAB code and returns the output directly to the AI conversation.

How to connect the MCP server to an existing MATLAB session?▼

Run the server once with --setup-matlab to install the MATLAB MCP Server Toolbox, then call shareMATLABSession() in MATLAB R2023a or later. Start the server with --matlab-session-mode=existing to attach to that shared session.

What MATLAB version does the MCP server require?▼

The server requires MATLAB R2021a or later and supports releases from the past five years. Connecting to an existing shared session requires MATLAB R2023a or later with the MCP Server Toolbox installed.

Can MATLAB MCP server run without the desktop GUI?▼

Yes, pass --matlab-display-mode=nodesktop or set the MW_MCP_SERVER_MATLAB_DISPLAY_MODE environment variable to run MATLAB headlessly. Graphics commands still work in nodesktop mode, so plots can be generated and saved to files.

Why does the server fail to find my MATLAB installation?▼

The server fails when MATLAB is not on the system PATH. Fix it by passing --matlab-root with your installation directory, such as /usr/local/MATLAB/R2026a on Linux, or by setting the MW_MCP_SERVER_MATLAB_ROOT environment variable.