Preface¶
DeepSeek Harness (DSH) follows the “everything is a plugin” philosophy. When developers need an agent to directly operate MATLAB code or Simulink models, they usually need to write additional control scripts. dsh-matlab-mcp injects MATLAB/Simulink control capabilities into the DSH GUI by registering the MathWorks MCP server, enabling agent sessions to obtain native mcp__matlab__* tools.
Plugin Introduction¶
Name: dsh-matlab-mcp
Owner: James-web11
License: MIT
Positioning: A DeepSeek Harness (dsh) profile bundle used to register the MathWorks MATLAB/Simulink MCP server into the dsh GUI.
Core Features¶
The plugin exposes capabilities through interfaces prefixed with mcp__matlab__*, covering the following scenarios:
- MATLAB code execution: Run arbitrary MATLAB code, execute scripts, or run unit tests.
- Static analysis: Perform static code checks on
.mfiles and retrieve warning information. - Environment detection: Detect the MATLAB version and installed toolboxes.
- Simulink interaction:
- View: Provide hierarchical model views, block topology, and symbolic expression representations.
- Edit: Perform structural editing or parameter modification.
- Validation: Check structural validity (such as unconnected ports).
- Query: Randomly access block/configuration parameters.
- Variable resolution: Resolve workspace variables into Simulink values.
- Testing: Simulink behavioral testing based on Gherkin syntax (requires Simulink Test).
Environment Requirements¶
Before installation, ensure the environment meets the following conditions:
- MATLAB version: R2021a or later (using Simulink
model_*tools requires R2023a or later). - MATLAB Agentic Toolkit: Must be installed. Run
setupAgenticToolkit("install")in MATLAB to install it. - pnpm: The
dsh plugintool depends on pnpm. - DSH launcher: The
dshcommand must be available in PATH, or usenpx.
Installation¶
It is recommended to add the configuration package directly through the dsh plugin command:
dsh plugin --profile web add github:<your-account>/dsh-matlab-mcp
This command adds the plugin configuration to ~/.dsh/profiles/web/cordis.patch.yml. After installation, the GUI must be restarted.
Startup and Usage¶
- Restart the GUI: The dsh GUI must be restarted after installation.
- Start MATLAB: Ensure MATLAB is already running. The server attaches to an existing session using
--matlab-session-mode=existingand will not automatically start MATLAB. - Initialize: Execute the following commands in the MATLAB session to share the session:
addpath('~/.matlab/agentic-toolkits/simulink');
satk_initialize
Verification and Typical Usage¶
After restarting the GUI, the agent can use the related tools. For example:
* Detect the environment: Ask the agent to use mcp__matlab__detect_matlab_toolboxes to list toolboxes.
* View a model: Ask the agent to use mcp__matlab__model_overview to get an overview of a Simulink model.
Notes¶
- Path resolution: Paths in the configuration are resolved at configuration generation time using
!!jsexpressions, so manual path changes are not needed for each machine. - Windows dependency: The Windows environment requires the
WINDIRenvironment variable to be injected. - Timeout settings: For long-running simulations, it may be necessary to increase
toolCallTimeoutMs(default: 600000ms). - Source note: This repository contains only configuration files. The MCP server itself is provided by MathWorks, and the client plugin is
@deepseek-ai/dsh-mcp-client.
Reference Resources¶
- GitHub repository: https://github.com/James-web11/dsh-matlab-mcp
- Ecosystem catalog: https://www.skillhub.cn/plugins/James-web11/dsh-matlab-mcp