MATLAB MCP Core Server
About
Run MATLAB® using AI applications with the official MATLAB MCP Server from MathWorks®.
Details
- Author
- matlab
- Categories
- Productivity
Jump to
Setup
Install MATLAB MCP Core Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/matlab/matlab-mcp-core-server
Follow the installation instructions in the repository README, then restart your MCP client.
Run MATLAB® using AI applications with the official MATLAB MCP Server from MathWorks®.
- Run MATLAB code— Ask your assistant to execute MATLAB statements or scripts viaevaluate_matlab_codeorrun_matlab_fileand get the output back.
- Check code quality— Have your assistant runcheck_matlab_codeon a.mfile to get static analysis warnings about style, errors, and best practices.
- Run unit tests— Ask your assistant to execute MATLAB test files withrun_matlab_test_fileand return comprehensive test results.
- Inspect MATLAB environment— Usedetect_matlab_toolboxesto have your assistant report installed MATLAB version and available toolboxes.
- Follow coding guidelines— Ask your assistant to reference thematlab_coding_guidelinesresource for standards on naming, formatting, and error handling when writing code.
Run MATLAB® using AI applications with the official MATLAB MCP Server from MathWorks®. The MATLAB MCP Server allows your AI applications to:
- Start and quit MATLAB.
- Write and run MATLAB code.
- Assess your MATLAB code for style and correctness.
To assist your agent in using MATLAB and Simulink, you can use skills fromMATLAB Agentic Toolkit (GitHub)andSimulink Agentic Toolkit (GitHub), which can also install this MCP server for you.
- Setup
- Claude Code
- Claude Desktop
- GitHub Copilot in Visual Studio Code
- Codex
-
The server supports any AI application that uses Model Context Protocol. To set up the MATLAB MCP Server for Claude Desktop, skip to the instructions forClaude Desktop. To set up the server for other applications, follow these instructions:
-
For Windows or Linux,Download the Latest Release. (Alternatively, you canbuild from source: installGoand build the binary usinggo install github.com/matlab/matlab-mcp-server/cmd/matlab-mcp-server@latest).
For macOS, first download the latest release by running the following command in your terminal:
- For Apple silicon processors, run:
curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-arm64
curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-x64
Then grant executable permissions to the downloaded binary so you can run the MATLAB MCP Server:
Add the MATLAB MCP Server to your AI application. You can find instructions for adding MCP servers in the documentation of your AI application. For example instructions on using Claude Code®, Claude Desktop®, and GitHub Copilot in Visual Studio® Code, see below. Note that you can customize the server by specifying optionalArguments.
In your terminal, run the following, remembering to insert the full path to the server binary you acquired in the setup:
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary
You can customize the server by specifying optionalArguments. Note the--separator between Claude Code's options and the server arguments:
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary --initial-working-folder=/home/username/myproject
For details on adding MCP servers in Claude Code, seeAdd a local stdio server (Claude Code). To remove the server later, run:
You install the MATLAB MCP Server in Claude Desktop using the MATLAB MCP Server bundle.
-
Install the Filesystem extension in Claude Desktop to allow Claude to read and write files on your system. In Claude Desktop, clickSettings > Extensions > Browse extensions. Search for the Filesystem extension developed by Anthropic and clickInstall. Specify the folders you want to allow the MCP server to access, then toggle theDisabledbutton toEnablethe Filesystem extension.
Download the MATLAB MCP Server bundlematlab-mcp-server.mcpbfrom theLatest Releasepage.
To install the MATLAB MCP Server bundle as a desktop extension, double click the downloadedmatlab-mcp-server.mcpbfile and clickInstallin Claude Desktop. (Alternatively, navigate in Claude toFile menu > Settings > Extensions > Advanced Settings > Install Extensionand select thematlab-mcp-server.mcpbfile. ClickInstall).
To customize the behaviour of the MATLAB MCP Server, navigate toSettings > Extensions > Configure, where you can modify the server'sArguments.
In your VS Code workspace, create a file named.vscode/mcp.json. Insert the following JSON, remembering to specify the full path to the server binary you acquired in the setup, as well as anyArguments. Then save the file. (Note that on Windows, your paths require extra slashes as escape characters).
{ "servers": { "matlab": { "type": "stdio", "command": "C:\\fullpath\\to\\matlab-mcp-server-windows-x64.exe", "args": [] } } }
For more information about using MCP servers in VS Code, seeAdd and Manage MCP servers in VS Code (VS Code).
In your terminal, run the following, remembering to insert the full path to the server binary you acquired in the setup:
codex mcp add matlab -- /fullpath/to/matlab-mcp-server-binary
You can customize the server by specifying optionalArguments. For example:
codex mcp add matlab -- /fullpath/to/matlab-mcp-server-binary --initial-working-folder=/home/username/myproject
[!NOTE]Windows users:Codex does not forward theWINDIRenvironment variable, which you need to run MATLAB and Simulink (see #32).
To add the variable, open your Codex config file atC:\Users\<username>\.codex\config.toml, and addenv_vars = ["WINDIR"]to the[mcp_servers.matlab]section:
[mcp_servers.matlab] command = 'C:\fullpath\to\matlab-mcp-server-windows-x64.exe' args = [] env_vars = ["WINDIR"]
Customize the behavior of the server by specifying arguments in one of these ways:
- Insert the arguments in the configuration settings of your AI application (usually a.jsonfile).
- Enter the arguments as command-line interface (CLI) flags when you start the server.
- Use environment variables, specified either in your CLI or application's configuration settings. To derive the environment variable name from a CLI flag, add the prefixMW_MCP_SERVER_, convert to uppercase, and replace hyphens (-) with underscores (_). For example, the argument--matlab-rootbecomes the environment variableMW_MCP_SERVER_MATLAB_ROOT. CLI flags take precedence over environment variables, if you use both.
- Linux:/home/username
- Windows:C:\Users\username\Documents
- Mac:/Users/username/Documents
- If you are usingexistingmode for the first time, run./matlab-mcp-server --setup-matlab.
This command installs an add-on named MATLAB MCP Server Toolbox in MATLAB. You can customize the command with other arguments from this table. For example, to specify which MATLAB to use to install the toolbox, you can use./matlab-mcp-server --setup-matlab --matlab-root=/home/usr/MATLAB/R2026a.
For Claude Desktop, you must download the MATLAB MCP Server binary using the instructions inSetupbefore you run./matlab-mcp-server --setup-matlab.
- In the command window of a running MATLAB session, runshareMATLABSession(). The MCP server will connect to this MATLAB when you start the server with--matlab-session-mode=existingor--matlab-session-mode=auto. If you are running multiple MATLAB sessions, the server connects to the MATLAB session where you most recently ran the commandshareMATLABSession().
As an alternative to runningshareMATLABSession()manually, you can add the command to your MATLABStartup Script (MathWorks).
- Returns information about installed MATLAB and toolboxes, including version numbers.
- Performs static code analysis on a MATLAB script. Returns warnings about coding style, potential errors, deprecated functions, performance issues, and best practice violations. This is a non-destructive, read-only operation that helps identify code quality issues without executing the script.
- Inputs:
- script_path(string): Absolute path to the MATLAB script file to analyze. Must be a valid.mfile. The file is not modified during analysis. Example:C:\Users\username\matlab\myFunction.mor/home/user/scripts/analysis.m.
- Evaluates a string of MATLAB code and returns the output.
- Inputs:
- code(string): MATLAB code to evaluate.
- project_path(string): Absolute path to your project directory. MATLAB sets this directory as the current working folder. Example:C:\Users\username\matlab-projector/home/user/research.
- Executes a MATLAB script and returns the output. The script must be a valid.m file.
- Inputs:
- script_path(string): Absolute path to the MATLAB script file to execute. Must be a valid.mfile. Example:C:\Users\username\projects\analysis.mor/home/user/matlab/simulation.m.
- Executes a MATLAB test script and returns comprehensive test results. Designed specifically for MATLAB unit test files that follow MATLAB testing framework conventions.
- Inputs:
- script_path(string): Absolute path to the MATLAB test script file. Must be a valid.mfile containing MATLAB unit tests. Example:C:\Users\username\tests\testMyFunction.mor/home/user/matlab/tests/test_analysis.m.
The MCP server providesResources (MCP)to help your AI application write MATLAB code. To see instructions for using this resource, refer to the documentation of your AI application that explains how to use resources.
- Provides comprehensive MATLAB coding standards for improving code readability, maintainability, and collaboration. The guidelines encompass naming conventions, formatting, commenting, performance optimization, and error handling.
- URI:guidelines://coding
- MIME Type:text/markdown
- Source:MATLAB Coding Standards (GitHub)
- Provides rules and guidelines for generating live scripts using the plain text Live Code.mfile format, suitable for version control and AI-assisted development. Note that to run plain text live scripts you need MATLAB R2025a or newer. For details, seeLive Code File Format (MathWorks).
- URI:guidelines://plain-text-live-code
- MIME Type:text/markdown
- Source:Plain Text Live Code Generation (GitHub)
The MATLAB MCP Server may collect fully anonymized information about your usage of the server and send it to MathWorks. This data collection helps MathWorks improve products and is on by default. To opt out of data collection, set the argument--disable-telemetrytotrue.
When using the MATLAB MCP Server, you should thoroughly review and validate all tool calls before you run them. Always keep a human in the loop for important actions and only proceed once you are confident the call will do exactly what you expect. For more information, seeUser Interaction Model (MCP)andSecurity Considerations (MCP).
The license is available in theLICENSE.mdfile in this GitHub repository.
MCP servers are only permitted to be used with MATLAB in accordance with the MathWorks Software License Agreement, and must not be shared by multiple users. Contact MathWorks if you need to support shared or centralized server use.
MathWorks encourages you to use this repository and provide feedback. To request technical support or submit an enhancement request,create a GitHub issueor contactMathWorks Technical Support.
The 1Password MCP server creates a bridge that allows MCP clients such as Codex and Kiro to manage your 1Password Environments with secure authorization prompts.
This is the 1st, easiest, and cheapest PPT, slides, presentation AI generation MCP Server in the world.
Persistent memory for any AI assistant. Zero token cost until recall. Stores memories in local SQLite, ranks by 6-factor scoring, returns results 79% smaller than JSON. Works with Claude, ChatGPT, Grok, Cursor, Windsurf, and any MCP client.
A MCP server that enables AI assistants to interact with Anki, the spaced repetition flashcard application.
Enables LLM clients to interact with macOS applications through AppleScript. Built using the @beyondbetter/bb-mcp-server library, this server provides safe, controlled execution of predefined scripts with optional support for arbitrary script execution.
An MCP server for WordPress plugin audits
Turn your AI assistant into a digital marketing hub that creates, organizes, and analyzes links and QR Codes on demand.
Connect AI clients to Cal.com scheduling through the Model Context Protocol using the hosted server at mcp.cal.com or a local instance.
Sync Calendars, Scheduling Links, AI Executive Scheduling Assistant, Unified Calendar
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



