Skills Plugins MCP Prompt Model 博客 我的中心
开发编程 #ai #agent

matlab-mcp-server

Run and interact with MATLAB using AI applications through the Model Context Protocol, enabling AI agents to execute MATLAB code, manage sessions, and assess code quality.

DeepseekModel 官方收录技能 质量 良好 · 64 v1.0.0

获取

https://deepseekmodel.com/api/download.php?id=aradotso-mcp-skills-skills-matlab-mcp-server-skill-md&format=skill
下载 .skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用
.skill 文件中 system_prompt 字段的实际内容。
name matlab-mcp-server description Run and interact with MATLAB using AI applications through the Model Context Protocol, enabling AI agents to execute MATLAB code, manage sessions, and assess code quality. triggers ["run this matlab code","execute matlab script","start matlab session","analyze matlab code quality","evaluate matlab expression","connect to existing matlab","check matlab code style","run matlab calculations"] MATLAB MCP Server Skill by ara.so — MCP Skills collection. The MATLAB MCP Server is the official MathWorks server that enables AI applications to start MATLAB, execute MATLAB code, and assess code quality through the Model Context Protocol. It supports multiple session modes, custom working directories, and both desktop and headless MATLAB operation. Installation Prerequisites MATLAB R2021a or later installed and added to system PATH The server supports MATLAB releases from the past five years For Claude Code # Basic installation claude mcp add --transport stdio matlab -- /path/to/matlab-mcp-server # With custom working folder claude mcp add --transport stdio matlab -- /path/to/matlab-mcp-server --initial-working-folder=/home/user/project # With nodesktop mode claude mcp add --transport stdio matlab -- /path/to/matlab-mcp-server --matlab-display-mode=nodesktop For Claude Desktop Install the Filesystem extension in Claude Desktop (Settings > Extensions > Browse extensions) Download matlab-mcp-server.mcpb from the latest release Double-click the .mcpb file and click Install For VS Code with GitHub Copilot Create .vscode/mcp.json : { "servers" : { "matlab" : { "type" : "stdio" , "command" : "/path/to/matlab-mcp-server" , "args" : [ "--initial-working-folder=/home/user/project" , "--matlab-display-mode=nodesktop" ] } } } Download Binary Linux/macOS: # macOS Apple Silicon curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-amd64 chmod +x ~/Downloads/matlab-mcp-server # macOS Intel curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-x64 chmod +x ~/Downloads/matlab-mcp-server Windows: Download from releases page : matlab-mcp-server-windows-x64.exe Build from source: go install github.com/matlab/matlab-mcp-server/cmd/matlab-mcp-server@latest Configuration Arguments Command-Line Flags # Specify MATLAB installation --matlab-root=/usr/local/MATLAB/R2026a # Initialize MATLAB immediately on startup --initialize-matlab-on-startup= true # Set working directory --initial-working-folder=/home/user/myproject # Run without MATLAB desktop --matlab-display-mode=nodesktop # Session modes --matlab-session-mode=new # Always start new MATLAB --matlab-session-mode=auto # Connect to existing or start new (default) --matlab-session-mode=existing # Only connect to existing MATLAB Environment Variables # Equivalent to --matlab-root export MW_MCP_SERVER_MATLAB_ROOT=/usr/local/MATLAB/R2026a # Equivalent to --initial-working-folder export MW_MCP_SERVER_INITIAL_WORKING_FOLDER=/home/user/project # Equivalent to --matlab-display-mode export MW_MCP_SERVER_MATLAB_DISPLAY_MODE=nodesktop # Equivalent to --matlab-session-mode export MW_MCP_SERVER_MATLAB_SESSION_MODE=existing Using Existing MATLAB Sessions For MATLAB R2023a and later: First-time setup: ./matlab-mcp-server --setup-matlab This installs the MATLAB MCP Server Toolbox. In MATLAB command window: shareMATLABSession() Add this to your MATLAB startup.m for automatic sharing: % In startup.m shareMATLABSession() Configure MCP server: claude mcp add --transport stdio matlab -- /path/to/matlab-mcp-server --matlab-session-mode=existing MCP Tools Available The server exposes these tools to AI applications: execute_matlab_code Execute MATLAB code and return results. Request: { "name" : "execute_matlab_code" , "arguments" : { "code" : "result = sum([1, 2, 3, 4, 5]); disp(result)" } } Response: { "content" : [ { "type" : "text" , "text" : "15" } ] } evaluate_matlab_expression Evaluate a MATLAB expression and return the result. Request: { "name" : "evaluate_matlab_expression" , "arguments" : { "expression" : "sqrt(144)" } } Response: { "content" : [ { "type" : "text" , "text" : "12" } ] } check_matlab_code Assess MATLAB code for style and correctness using Code Analyzer. Request: { "name" : "check_matlab_code" , "arguments" : { "code" : "function y = myFunc(x)\ny = x * 2\nend" } } Response: { "content" : [ { "type" : "text" , "text" : "Line 2: Add a semicolon after the statement to hide the output (when it is not the intent)." } ] } Common Usage Patterns Basic Script Execution % Simple calculation A = [1 2 3; 4 5 6; 7 8 9]; eigenvalues = eig(A); disp(eigenvalues); Working with Files % Save data to file data = rand(100, 3); save('mydata.mat', 'data'); % Load and process load('mydata.mat'); mean_values = mean(data); writematrix(mean_values, 'results.csv'); Plotting and Visualization % Create and save a plot x = linspace(0, 2*pi, 100); y = sin(x); figure; plot(x, y); title('Sine Wave'); xlabel('x'); ylabel('sin(x)'); saveas(gcf, 'sine_plot.png'); Matrix Operations % Linear algebra operations A = magic(5); b = sum(A, 2); x = A \ b; % Solve Ax = b % Check solution residual = norm(A*x - b); fprintf('Residual: %.2e\n', residual); Signal Processing % Generate and filter signal Fs = 1000; % Sampling frequency t = 0:1/Fs:1-1/Fs; signal = sin(2*pi*50*t) + 0.5*randn(size(t)); % Apply low-pass filter [b, a] = butter(6, 100/(Fs/2)); filtered = filter(b, a, signal); % Compute FFT Y = fft(filtered); P2 = abs(Y/length(filtered)); P1 = P2(1:length(filtered)/2+1); Data Analysis % Statistical analysis data = readtable('data.csv'); summary_stats = grpstats(data, 'Category', {'mean', 'std', 'median'}); % Correlation analysis R = corrcoef(data{:, 2:end}); % Linear regression mdl = fitlm(data, 'ResponseVar ~ Predictor1 + Predictor2'); disp(mdl); Custom Functions % Define reusable function function [mean_val, std_val] = analyzeData(data) mean_val = mean(data, 'omitnan'); std_val = std(data, 'omitnan'); % Visualize figure; histogram(data, 30); title(sprintf('Mean: %.2f, Std: %.2f', mean_val, std_val)); end % Use the function results = rand(1000, 1) * 100; [m, s] = analyzeData(results); Simulink Integration % Load and simulate Simulink model load_system('mymodel'); simOut = sim('mymodel', 'StopTime', '10'); % Extract and plot results time = simOut.tout; output = simOut.yout; plot(time, output); Troubleshooting MATLAB Not Found Problem: Server cannot locate MATLAB installation. Solution: # Explicitly specify MATLAB root --matlab-root=/Applications/MATLAB_R2026a.app # macOS --matlab-root=/usr/local/MATLAB/R2026a # Linux --matlab-root=C:\\Program Files\\MATLAB\\R2026a # Windows # Or set environment variable export MW_MCP_SERVER_MATLAB_ROOT=/usr/local/MATLAB/R2026a Connection to Existing Session Fails Problem: Cannot connect with --matlab-session-mode=existing Solution: Ensure MATLAB MCP Server Toolbox is installed: ./matlab-mcp-server --setup-matlab In MATLAB, run: shareMATLABSession() Verify connection status: status = shareMATLABSession('status') Path Issues Problem: MATLAB cannot find scripts or data files. Solution: % Check current directory pwd % Change directory cd('/path/to/project') % Add to path addpath('/path/to/scripts'); addpath(genpath('/path/to/project')); % Include subdirectories Graphics/Desktop Issues Problem: Commands requiring GUI fail in nodesktop mode. Solution: Graphics commands still work in nodesktop mode, but if issues persist: # Switch to desktop mode --matlab-display-mode=desktop Memory Issues Problem: Out of memory errors with large datasets. Solution: % Clear workspace clear all % Close figures close all % Use memory-efficient operations % Instead of loading entire file: data = load('largefile.mat'); % Use memory mapping: m = memmapfile('largefile.dat', 'Format', 'double'); Code Execution Timeout Problem: Long-running code appears to hang. Solution: % Add progress indicators for i = 1:1000 % Process if mod(i, 100) == 0 fprintf('Progress: %d/1000\n', i); end end % Use parallel processing for large tasks parfor i = 1:1000 % Parallel computation end Version Compatibility Problem: Functions not available in older MATLAB versions. Solution: % Check MATLAB version ver('MATLAB') % Conditional code based on version if verLessThan('matlab', '9.10') % R2021a warning('Some features require R2021a or later'); end Advanced Configuration Custom Tools Extension Create custom MCP tools by providing a JSON extension file: --extension-file=/path/to/my-tools.json For details, see the Custom Tools Guide . Multiple MATLAB Versions # Development with latest MATLAB
Agent 识别该技能的关键词,点击任意一个即可复制。

该技能未提供触发词。

下载的 .skill 包内含以下字段。
字段 说明
format格式标识(skill/v1)
skill_id技能唯一 ID
name技能名称
version版本号
description技能描述
category所属分类(数组)
trigger_words触发词列表
tags标签列表
source来源标识
source_url来源链接(本页地址)
exported_at导出时间(每次下载生成)
system_prompt系统提示词正文
model_config模型参数:provider / model / temperature / max_tokens / top_p
examples示例
install_guide各平台导入说明(Coze / Dify / Claude / 自定义框架)
同一份技能可按不同平台格式导出。
.skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用 下载
.skillpro 增强格式,额外含脚本 / 工具 / 依赖 / 钩子占位 下载
.json 纯 JSON 导出,只含 system_prompt 与模型参数 下载
Coze 带 frontmatter 的 Markdown,Coze 平台导入用 下载
Dify Dify DSL,创建应用后直接导入 下载

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。