MATLAB MCP Tool
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
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
Maintainer
Works with
Installation
Manual Installation
npx matlab-mcp-toolConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
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.shSet 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.shTest 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.shCopy 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"
}
}
}
}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.
MATLAB MCP Tool Alternatives — Similar Data Science & ML Servers
Looking for alternatives to MATLAB MCP Tool? Here are other popular data science & ml servers you can use with Claude, Cursor, and VS Code.
Ultrarag
★ 5.6kA Low-Code MCP Framework for Building Complex and Innovative RAG Pipelines
RocketRide
★ 3.1k📇 🏠 - MCP server that exposes RocketRide AI pipelines as t
Aix Db
★ 2.1kAix-DB 基于 LangChain/LangGraph 框架,结合 MCP Skills 多智能体协作架构,实现自然语言到数据洞察的端到端转换。
NeMo Data Designer
★ 1.9k🎨 NeMo Data Designer: Generate high-quality synthetic data from scratch or from seed data.
PaperBanana
★ 1.7kOpen source implementation and extension of Google Research’s PaperBanana for automated academic figures, diagrams, and research visuals, expanded to new domains like slide generation.
MiniMax
★ 1.5kBridges MiniMax AI capabilities to the Model Context Protocol, enabling AI agents to perform image understanding, text-to-image generation, and speech synthesis. It provides a standardized interface for accessing MiniMax's core tools via JSON-RPC.
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.
Set Up MATLAB MCP Tool in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.