matlab-mcp-tools
by neuromechanist·★ 18·综合分 43
MATLAB 开发的 MCP 服务器,提供脚本执行、工作区管理和图形分析功能。
概述
这个 MCP 服务器通过一套全面的工具实现与 MATLAB 的交互。它允许执行 MATLAB 脚本或代码段,管理工作区变量,并分析图形。服务器支持多种执行模式(完整脚本、按索引/标题/行范围执行的代码段),并提供工作区内省功能。它可以提取绘图数据,生成分析提示,并为基于 LLM 的分析准备图形。该实现包含对 Claude Code 和 Cursor 的自动安装和配置支持。
试试问 AI
装完之后,这里有 7 个你可以让 AI 做的事:
什么时候选它
如果您经常使用 MATLAB,并希望将其集成到 Claude Code 或 Cursor 等 AI 编程助手中,特别是需要按部分执行脚本或以编程方式分析 MATLAB 图形时,请选择此 MCP 服务器。
什么时候不要选它
如果您没有经过许可的 MATLAB 安装,或在受限环境中执行代码(MATLAB Python 引擎有特定要求和依赖项),请避免使用此服务器。
此 server 暴露的工具
从 README 抽取出 12 个工具execute_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
可对比工具
安装
安装
快速开始(推荐)
./install-matlab-mcp.sh手动安装
- 克隆仓库:
git clone [repository-url]
cd matlab-mcp-tools- 如需要,设置 MATLAB 路径:
export MATLAB_PATH=/path/to/matlab/installation- 安装依赖:
./scripts/setup-matlab-mcp.shClaude Desktop 配置
添加到 .mcp.json:
{
"mcpServers": {
"matlab": {
"command": "/path/to/matlab-mcp-tools/.venv/bin/matlab-mcp-server",
"env": {
"MATLAB_PATH": "/Applications/MATLAB_R2024b.app"
}
}
}
}FAQ
- 支持哪些 MATLAB 版本?
- 该服务器支持 MATLAB R2023x 及更高版本。Python 版本会自动与您的 MATLAB 版本匹配(例如,MATLAB R2024b 使用 Python 3.11)。
- 如何执行 MATLAB 脚本的特定部分?
- 使用 `execute_section_by_index` 工具按 0 基索引执行代码段,或使用 `execute_section_by_title` 进行部分标题匹配。您还可以使用 `execute_section` 指定行范围。
- 是否可以编程方式检索绘图数据?
- 是的,使用 `get_plot_data` 工具提取绘图中线条的原始 x/y/z 数据,或使用 `get_figure_metadata` 获取坐标轴信息、标签和图例。
matlab-mcp-tools 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。