1
Add it to Claude Code
claude mcp add matlab-mcp -- /path/to/matlab-mcp-tools/.venv/bin/matlab-mcp-serverEnvironment Variables
Set these before running MATLAB MCP Tool.
VariableDescriptionRequired
MATLAB_PATHPath to the MATLAB installation directoryNoAvailable Tools (15)
Once configured, MATLAB MCP Tool gives your AI agent access to:
execute_scriptRun MATLAB code or script fileexecute_sectionExecute by line rangeexecute_section_by_indexExecute by section index (0-based)execute_section_by_titleExecute by section title (partial match)get_script_sectionsList sections with titles and previewscreate_matlab_scriptCreate a new .m fileget_workspaceGet all workspace variablesget_variableGet specific variable with field/depth/size controlget_struct_infoGet struct field metadata without data transferlist_workspace_variablesList/filter variables by name pattern or typeget_figure_metadataExtract axes, labels, legends, subplot infoget_plot_dataGet raw x/y/z data from plot linesanalyze_figurePrepare figure image and metadata for LLM analysisget_analysis_promptGet or customize the figure analysis promptmatlab_lintRun checkcode on code or filesTry It Out
After setup, try these prompts with your AI agent:
→Run the script 'data_analysis.m' and tell me the mean value of the resulting 'results' variable.
→List all variables currently in my MATLAB workspace and identify any that are structs.
→Analyze the current figure and explain what the axes labels and legend indicate about the data.
→Lint my 'process_signal.m' file to check for potential code quality issues.
→Execute the second section of my current script and retrieve the 'final_matrix' variable.
Alternative installation methods
Manual
./scripts/setup-matlab-mcp.shKeep this setup from going cold
Save the docs, env vars, and workflow around MATLAB MCP Tool in Conare so Claude Code, Codex, and Cursor remember it next time.