Introduction¶
DeepSeek Harness (DSH) adopts a plugin architecture, which means developers can extend Agent capabilities on demand. In math modeling, data analysis, or scientific computing scenarios, an agent often needs to invoke a local MATLAB environment to run code and retrieve results. Manual configuration is tedious and difficult to handle with regard to environment dependencies. The dsh-matlab plugin addresses this pain point by providing a standardized interface that allows the Agent to directly call MATLAB on the host machine to complete tasks.
What is it¶
dsh-matlab is a DSH plugin maintained by weijianguizhou. It runs as a pure host tool plugin and does not modify any official code. Its core value lies in providing a matlab.run tool that allows the Agent to execute MATLAB code directly on the local machine and return the text output, standard error information, and any generated images produced by the code to the Agent.
Core features¶
The plugin mainly includes the following features:
- Code execution and return: Provides the
matlab.runtool, which accepts a MATLAB code string and an optional working directory, executes the script, and returns stdout and stderr. - Automatic image saving: When code is executed, all generated figures are automatically saved as PNG images in the
.dsh-matlab/figures/directory under the workspace, and the image paths are returned. - Safety approval mechanism: Considering that MATLAB can execute arbitrary code and may pose potential risks, the plugin requests user approval before each invocation by default. Users can also disable this option in the configuration.
- Local execution: All code runs in the local host machine’s MATLAB environment rather than remotely.
- Zero intrusion: As a pure host tool plugin, it does not involve modifying DSH official code.
Installation and enablement¶
Install it as a link dependency in the target profile and add it to the bundle layer.
Using the command line:
dsh plugin --profile desktop add link:/path/to/dsh-matlab
Or manually edit profiles/<name>/package.json, add the dependency and declare it in the dsh.profile.bundles list, then restart DSH Desktop.
Typical usage¶
Add the plugin definition to the profile’s combined configuration. If matlabPath is not specified, the plugin will try to automatically detect the local MATLAB path.
- id: matlab
name: dsh-matlab
config:
matlabPath: "D:\\Program Files\\MATLAB 2025\\bin\\matlab.exe"
timeoutMs: 120000
requireApproval: true
When invoking, the Agent calls the tool directly:
// 调用方式示例
matlab.run(code, workdir)
Applicable scenarios and notes¶
This plugin is suitable for Agent scenarios that require local computing capabilities, such as mathematical modeling assistants or data analysis tools.
Before using it, confirm the following:
1. MATLAB is installed on the local machine.
2. The environment meets Node.js >= 18.17.0.
3. You understand the security risks of MATLAB executing arbitrary code. The default approval mechanism is intended to prevent malicious code from causing damage to the local environment.
Conclusion¶
dsh-matlab seamlessly integrates local MATLAB capabilities into the DSH ecosystem through the standardized matlab.run interface. It not only simplifies configuration but also enhances safety through automatic image saving and an approval mechanism. For agent development that requires deep local computation, this is a practical tool.