← Back to MATLAB MCP Tool

Install MATLAB MCP Tool

Pick your client, copy the command, done.

1

Add it to Claude Code

claude mcp add matlab-mcp -- /path/to/matlab-mcp-tools/.venv/bin/matlab-mcp-server

Environment Variables

Set these before running MATLAB MCP Tool.

VariableDescriptionRequired
MATLAB_PATHPath to the MATLAB installation directoryNo

Available Tools (15)

Once configured, MATLAB MCP Tool gives your AI agent access to:

execute_scriptRun MATLAB code or script file
execute_sectionExecute by line range
execute_section_by_indexExecute by section index (0-based)
execute_section_by_titleExecute by section title (partial match)
get_script_sectionsList sections with titles and previews
create_matlab_scriptCreate a new .m file
get_workspaceGet all workspace variables
get_variableGet specific variable with field/depth/size control
get_struct_infoGet struct field metadata without data transfer
list_workspace_variablesList/filter variables by name pattern or type
get_figure_metadataExtract axes, labels, legends, subplot info
get_plot_dataGet raw x/y/z data from plot lines
analyze_figurePrepare figure image and metadata for LLM analysis
get_analysis_promptGet or customize the figure analysis prompt
matlab_lintRun checkcode on code or files

Try 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.sh

Keep 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.

Remember this setup