MATLAB MCP Tool

v1.0.0Data Science & MLstable

Enables interactive MATLAB development by allowing users to execute scripts and specific code sections, manage workspace variables, and capture generated plots. It integrates with the MATLAB Python Engine to provide persistent execution context for M

agentic-workflowmatlabmodel-context-protocolscientific-visualization
Share:
18
Stars
0
Downloads
0
Weekly
0/5

What is MATLAB MCP Tool?

MATLAB MCP Tool is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables interactive matlab development by allowing users to execute scripts and specific code sections, manage workspace variables, and capture generated plots. it integrates with the matlab python en...

Enables interactive MATLAB development by allowing users to execute scripts and specific code sections, manage workspace variables, and capture generated plots. It integrates with the MATLAB Python Engine to provide persistent execution context for M

This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables interactive MATLAB development by allowing users to

Use Cases

Execute MATLAB scripts and code sections interactively. Manage workspace variables and visualize generated plots. Integrate MATLAB workflows with AI assistance.
neuromechanist

Maintainer

LicenseBSD 3-Clause
Languagepython
Versionv1.0.0
UpdatedApr 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx matlab-mcp-tool

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MATLAB MCP Tool

The MATLAB MCP Tool bridges AI assistants and MATLAB by using the MATLAB Python Engine to maintain a persistent execution context across requests. It exposes 15 tools covering script execution, section-level running, workspace variable management, figure capture and analysis, and code linting — enabling iterative, AI-assisted MATLAB development without losing state between interactions. Scientists, engineers, and data analysts can ask Claude to write, run, debug, and visualize MATLAB code as part of a continuous workflow.

Prerequisites

  • MATLAB R2020b or later installed (the Python Engine requires a licensed MATLAB installation)
  • Python 3.9 or later with the matlab.engine Python package accessible
  • uv package manager installed (recommended by the project's installer script)
  • An MCP client such as Claude Desktop or Cursor
  • The MATLAB installation path known (e.g., /Applications/MATLAB_R2024b.app on macOS)
1

Run the automated installer

The project ships an installer script that auto-detects your MATLAB installation, sets up a Python virtual environment with uv, installs all dependencies, and writes the MCP configuration. Run it from the cloned repository root.

git clone https://github.com/neuromechanist/matlab-mcp-tools.git
cd matlab-mcp-tools
./install-matlab-mcp.sh
2

Set the MATLAB_PATH environment variable (if not auto-detected)

If the installer cannot find your MATLAB installation, set the MATLAB_PATH variable to point to the app bundle or directory before running the installer.

export MATLAB_PATH=/Applications/MATLAB_R2024b.app
./install-matlab-mcp.sh
3

Test the installation

Run the provided test script to verify that the Python Engine can start MATLAB and that all 15 MCP tools are available.

./scripts/test-matlab-mcp.sh
4

Copy the generated configuration to your MCP client

The installer generates an MCP config snippet. Copy it into your client's config file. For Claude Desktop on macOS, the config is at ~/Library/Application Support/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "matlab-mcp": {
      "command": "python",
      "args": ["-m", "matlab_mcp.server"],
      "env": {
        "MATLAB_PATH": "/Applications/MATLAB_R2024b.app"
      }
    }
  }
}
5

Restart your MCP client

Restart Claude Desktop or Cursor to load the new MCP server configuration. MATLAB will start in the background the first time a tool is called, which may take 15-30 seconds.

MATLAB MCP Tool Examples

Client configuration

Claude Desktop configuration for the MATLAB MCP Tool using the Python module entry point and MATLAB_PATH environment variable.

{
  "mcpServers": {
    "matlab-mcp": {
      "command": "python",
      "args": ["-m", "matlab_mcp.server"],
      "env": {
        "MATLAB_PATH": "/Applications/MATLAB_R2024b.app"
      }
    }
  }
}

Prompts to try

Example prompts for interactive MATLAB development through Claude.

- "Create a MATLAB script that generates a sine wave and plots it, then execute it and show me the figure."
- "List all variables currently in the MATLAB workspace."
- "Run only the 'Data Preprocessing' section of my analysis.m script."
- "Get the value of the variable 'results' from the workspace and explain what it contains."
- "Lint my script.m file and tell me about any code quality issues."

Troubleshooting MATLAB MCP Tool

MATLAB Python Engine fails to start with 'No module named matlab' error

The MATLAB Python Engine must be installed from your MATLAB installation, not from PyPI. Navigate to your MATLAB root (e.g., /Applications/MATLAB_R2024b.app/extern/engines/python) and run 'python setup.py install' or follow MathWorks documentation for your version.

The installer script cannot find MATLAB automatically

Set the MATLAB_PATH environment variable to the full path of your MATLAB application bundle before running the installer, e.g., 'export MATLAB_PATH=/Applications/MATLAB_R2024b.app'. On Linux, this is typically /usr/local/MATLAB/R2024b.

MATLAB takes too long to start and the MCP client times out

MATLAB startup can take 15-60 seconds on first use. Increase your MCP client's tool timeout if configurable. Once MATLAB is running, subsequent tool calls will respond quickly since the session is persistent.

Frequently Asked Questions about MATLAB MCP Tool

What is MATLAB MCP Tool?

MATLAB MCP Tool is a Model Context Protocol (MCP) server that enables interactive matlab development by allowing users to execute scripts and specific code sections, manage workspace variables, and capture generated plots. it integrates with the matlab python engine to provide persistent execution context for m It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MATLAB MCP Tool?

Follow the installation instructions on the MATLAB MCP Tool GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MATLAB MCP Tool?

MATLAB MCP Tool works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MATLAB MCP Tool free to use?

Yes, MATLAB MCP Tool is open source and available under the BSD 3-Clause license. You can use it freely in both personal and commercial projects.

Browse More Data Science & ML MCP Servers

Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "matlab-mcp-tool": { "command": "npx", "args": ["-y", "matlab-mcp-tool"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MATLAB MCP Tool?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides