Matlab-MCP-Tools

Matlab-MCP-Tools

An MCP server to develop and run MATLAB scripts with workspace persistence and plotting.

10
Stars
2
Forks
0
Releases

Overview

MATLAB MCP Tool is an MCP server that provides tools for developing and running MATLAB files. This server integrates with Cursor/Claude Code and other MCP-compatible clients to deliver interactive MATLAB development capabilities from any MCP client. It supports executing entire MATLAB scripts or individual sections, including cell-delimited sections (%%). It preserves the MATLAB workspace across executions, enabling iterative analysis without reloading data. The server can capture and save generated plots to the output directory. It exposes MCP tools such as execute_matlab_script, execute_matlab_section, get_script_sections, create_matlab_script, and get_workspace, enabling programmatic control from clients. The installation supports a quick one-command setup that auto-detects MATLAB installations, installs the UV package manager if needed, creates a MATLAB-compatible Python environment, and configures MCP with Cursor. The README also describes a testing script and an example usage showing how to call the tools via JSON payloads. The server is started with matlab-mcp-server or python -m matlab_mcp.server and reports available tools on startup. Output directories include matlab_output and test_output for plots and temporary files.

Details

Owner
neuromechanist
Language
Python
License
BSD 3-Clause "New" or "Revised" License
Updated
2025-12-07

Features

Execute MATLAB Scripts

Run complete MATLAB scripts, execute individual sections, maintain workspace context between executions, and capture/display plots.

Section-based Execution

Execute specific sections of MATLAB files; supports cell mode (%%) and maintains workspace context between sections.

Get Script Sections

Expose a tool to retrieve information about sections within a MATLAB script to guide section-based execution.

Create MATLAB Script

Create a new MATLAB script via MCP tooling.

Get Workspace

Retrieve current MATLAB workspace variables from the MCP client.

One-command Installer

Quick Start installer with auto-detection of MATLAB, UV installation, and automatic environment/configuration setup.

Plot Capture and Display

Capture plots generated during script execution and make them available to clients.

Output Management

Store plots and temporary files in matlab_output and test_output directories for organized access.

Audience

MATLAB developersDevelop MATLAB-based workflows via MCP for script execution and workspace preservation.
Data scientistsData scientists needing interactive MATLAB analysis and plotting via MCP.

Tags

MATLABMCPMATLAB enginescript executionsection executionworkspaceplot capturecell modeCursor/Claude CodeMCP server