matlab-mcp-tools
by neuromechanist·★ 18·Score 43
MCP server for MATLAB development with script execution, workspace management and figure analysis tools.
Overview
This MCP server enables interaction with MATLAB through a comprehensive set of tools. It allows executing MATLAB scripts or sections, managing workspace variables, and analyzing figures. The server supports various execution modes (complete scripts, sections by index/title/line range) and provides workspace introspection capabilities. It can extract plot data, generate analysis prompts, and prepare figures for LLM-based analysis. The implementation includes automatic installation and configuration support for Claude Code and Cursor.
Try asking AI
After installing, here are 7 things you can ask your AI assistant:
When to choose this
Choose this MCP server if you work with MATLAB regularly and want to integrate it into AI coding assistants like Claude Code or Cursor, particularly if you need to execute scripts section by section or analyze MATLAB figures programmatically.
When NOT to choose this
Avoid this if you don't have a licensed MATLAB installation or need to execute code in a restricted environment (MATLAB Python engine has specific requirements and dependencies).
Tools this server exposes
12 tools extracted from the READMEexecute_scriptRun MATLAB code or script file
execute_sectionExecute MATLAB script by line range
execute_section_by_indexExecute MATLAB script by section index (0-based)
execute_section_by_titleExecute MATLAB script by section title (partial match)
get_script_sectionsList MATLAB script sections with titles and previews
create_matlab_scriptCreate a new MATLAB .m file
get_workspaceGet all MATLAB workspace variables
get_variableGet specific MATLAB variable with field/depth/size control
get_figure_metadataExtract axes, labels, legends, subplot info from figure
get_plot_dataGet raw x/y/z data from MATLAB plot lines
analyze_figurePrepare MATLAB figure image + metadata for LLM analysis
matlab_lintRun checkcode on MATLAB code or files
Comparable tools
Installation
Installation
Quick Start (Recommended)
./install-matlab-mcp.shManual Installation
- Clone the repository:
git clone [repository-url]
cd matlab-mcp-tools- Set MATLAB path if needed:
export MATLAB_PATH=/path/to/matlab/installation- Install dependencies:
./scripts/setup-matlab-mcp.shConfiguration for Claude Desktop
Add to .mcp.json:
{
"mcpServers": {
"matlab": {
"command": "/path/to/matlab-mcp-tools/.venv/bin/matlab-mcp-server",
"env": {
"MATLAB_PATH": "/Applications/MATLAB_R2024b.app"
}
}
}
}FAQ
- What MATLAB versions are supported?
- The server supports MATLAB R2023x and later versions. Python version is automatically matched to your MATLAB version (e.g., MATLAB R2024b uses Python 3.11).
- How can I execute specific sections of a MATLAB script?
- Use the `execute_section_by_index` tool to execute sections by their 0-based index, or `execute_section_by_title` with partial title matching. You can also use `execute_section` to specify a line range.
- Can I retrieve plot data programmatically?
- Yes, use the `get_plot_data` tool to extract raw x/y/z data from plot lines, or `get_figure_metadata` to get axes information, labels, and legends.
Compare matlab-mcp-tools with
Last updated · Auto-generated from public README + GitHub signals.