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 .m files 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:

  1. MATLAB version: R2021a or later (using Simulink model_* tools requires R2023a or later).
  2. MATLAB Agentic Toolkit: Must be installed. Run setupAgenticToolkit("install") in MATLAB to install it.
  3. pnpm: The dsh plugin tool depends on pnpm.
  4. DSH launcher: The dsh command must be available in PATH, or use npx.

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

  1. Restart the GUI: The dsh GUI must be restarted after installation.
  2. Start MATLAB: Ensure MATLAB is already running. The server attaches to an existing session using --matlab-session-mode=existing and will not automatically start MATLAB.
  3. 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 !!js expressions, so manual path changes are not needed for each machine.
  • Windows dependency: The Windows environment requires the WINDIR environment 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