
一个MCP, 逐个开发 MATLAB 管道并一次读取一个维度
概览
一个模式背景协议(MCP)服务器,为开发和运行MATLAB文件提供工具. 与克洛德代码(Claude Code),Cursor(Cursor)以及其他MCP兼容客户端融合. - Python 3.10+ - 安装了Python引擎的MATLAB - uv包管理器(需要) 1. 运行完整的脚本,单个段落(按索引,标题,或行行范围),在行执行间保持工作空间上下文,抓图 2. 获得完整的工作空间,用字段/深度/大小控制检索特定变量,按名称模式或类型检查结构元数据,列表和过滤变量 3. 提取图元数据(轴,标签,图例),获取原始地块数据,用自定义提示为基于LLM的分析准备数字. 4.- Lint MATLAB代码通过重度过滤的检查码,支持内置代码和文件路径 5. 创建脚本,列表部分并预览,通过MCP资源读取脚本内容. 就这样!
概述(AI 翻译)
一个模式背景协议(MCP)服务器,为开发和运行MATLAB文件提供工具. 与克洛德代码(Claude Code),Cursor(Cursor)以及其他MCP兼容客户端融合.
□ 先决条件
- 第3.10号线+
- 安装了Python引擎的MATLAB
- uv 包管理器(需要)
□ 特性
- 脚本执行 - 运行完整脚本,单个段落(按索引,标题,或行范围),在处决之间保持工作空间上下文,抓图.
- 工作空间管理 - 获得完整的工作空间,取回具体变量并进行字段/深度/大小控制,按名称模式或类型检查结构元数据、列表和过滤变量
- ** 图解** - 提取出图元数据(轴,标签,图例),得到原始图解数据,用自定义提示为基于LLM的分析准备数字.
- 代码质量 - Lint MATLAB代码通过
checkcode并带有重度过滤,支持内置代码和文件路径 - 脚本管理 - 创建脚本,列表部分并有预览,通过MCP资源读取脚本内容
□ 安装
QQ 快速启动( 建议)
** 安装自动探测器的一号命令:**
就这样! 安装器会:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MATLAB MCP Tool
A Model Context Protocol (MCP) server that provides tools for developing and running MATLAB files. Integrates with Claude Code, Cursor, and other MCP-compatible clients.
Prerequisites
- Python 3.10+
- MATLAB with Python Engine installed
- uv package manager (required)
Features
- Script Execution - Run complete scripts, individual sections (by index, title, or line range), maintain workspace context between executions, capture plots
- Workspace Management - Get full workspace, retrieve specific variables with field/depth/size control, inspect struct metadata, list and filter variables by name pattern or type
- Figure Analysis - Extract figure metadata (axes, labels, legends), get raw plot data, prepare figures for LLM-based analysis with custom prompts
- Code Quality - Lint MATLAB code via
checkcodewith severity filtering, supports inline code and file paths - Script Management - Create scripts, list sections with previews, read script content via MCP resource
Installation
Quick Start (Recommended)
One-command installation with auto-detection:
./install-matlab-mcp.sh
That’s it! The installer will:
- ✅ Auto-detect MATLAB installations (including external volumes like
/Volumes/S1/) - ✅ Auto-install UV package manager if needed
- ✅ Create optimized virtual environment with MATLAB-compatible Python version
- ✅ Install all dependencies including MATLAB Python engine
- ✅ Generate MCP configuration ready for Cursor/Claude Code
- ✅ Verify installation works correctly
- ✅ Optionally configure Cursor automatically
Reduces installation time from 15+ minutes to ~2 minutes!
Advanced Installation
If you need custom configuration:
- Clone this repository:
git clone [repository-url]
cd matlab-mcp-tools
- Set custom MATLAB path (optional - installer auto-detects):
# Only needed if MATLAB is in unusual location
export MATLAB_PATH=/path/to/your/matlab/installation
- Run installer:
./install-matlab-mcp.sh
Legacy Installation (Manual)
Testing Installation
Test your installation:
./scripts/test-matlab-mcp.sh
Installation complete! The MATLAB MCP server is now ready to use with Cursor/Claude Code.
Usage
- Start the MCP server:
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"matlab": {
"command": "/path/to/matlab-mcp-tools/.venv/bin/matlab-mcp-server",
"env": {
"MATLAB_PATH": "/Applications/MATLAB_R2024b.app"
}
}
}
}