Introduction

DeepSeek Harness (DSH) adopts an “everything is a plugin” philosophy, allowing developers to mount various model and tool capabilities into workflows. The officially provided Wolfram Wolfram/AgentTools MCP Server is a full-featured mathematical and computation toolkit, but directly integrating it in a DSH environment requires solving intermediate issues such as kernel discovery, process lifecycle management, and permission approval.

dsh-wolfram is an integration bundle designed to fill these gaps. It does not rewrite either side: the underlying protocol is handled by the DSH generic client, while Wolfram tools are provided by the official Paclet. This plugin mainly handles three things: automatic kernel discovery, managing the Wolfram process tree (only the processes it starts), and integrating DSH’s native permission policy.

Core Features

This plugin provides the following capabilities:

  • Kernel discovery: Automatically detects local Wolfram executables (supports registry, standard directories, wolframscript), with explicit override support.
  • Windows transparent stdio supervisor: Starts and manages Wolfram processes. When the plugin shuts down or reloads, it only terminates the process tree it started, without affecting already opened Mathematica frontends or kernels from other clients.
  • DSH native permission policy: Incorporates tool calls into DSH’s approval chain. Unknown tools default to ask; known tools require approval based on configuration.
  • WSL reuse support: Supports reusing Windows-side Mathematica from WSL, configuring POSIX paths to avoid conflicts.
  • Image block forwarding: Supports the image block forwarding mechanism in DSH 0.1.1-rc.2+, preserving original MCP values.
  • Offline dependency builds: Supports offline installation based on docs/offline-dependencies.json.

Prerequisites

Before use, please ensure the following environment requirements are met:

  • DeepSeek Harness: Version must be 0.1.1-rc.2 or 0.1.0-rc.5 or above.
  • Node.js: Version requirement ^22.19 || >=24.
  • Wolfram environment: Wolfram desktop product or Wolfram Engine must be installed, and the Wolfram/AgentTools Paclet must be installed.
    PacletInstall["Wolfram/AgentTools"]

Installation

Install this bundle using DSH’s plugin command:

dsh plugin --profile <你的 profile> add D:\dsh-dev\dsh-wolfram

After installation, dsh plugin initializes dependencies in the profile directory and appends the plugin to the dsh.profile.bundles list. Confirm that the configuration takes effect:

dsh --profile <你的 profile> --dump-config

The output should include id: wolfram and id: wolfram-permission.

Usage and Default Behavior

After installation, DSH connects to the built-in WolframLanguage server by default. The model will see 7 tools, with a unified mcp__wolfram__ prefix namespace.

All tools require approval (ask) by default because these operations have side effects (such as reading/writing files and executing code). New tools not listed also default to ask. Only WolframLanguageContext and SymbolDefinition (read-only metadata) are set to delegate, leaving them directly to subsequent policies.

Note: Wolfram tools are not sandboxed and can execute arbitrary code and read/write files. Configure permission policies carefully in deployments.

Configuration

The configuration file is located at $DSH_HOME/profiles/<profile>/cordis.patch.yml. It mainly contains two configuration lines: id: wolfram and id: wolfram-permission.

1. id: wolfram line

Controls kernel discovery and startup.

Field Default Description
serverName wolfram Tool name namespace
mcpServerName WolframLanguage Name of the built-in Server to start
command Automatically discovered Explicitly specifies the executable file path
graceMs 1000 Time to wait for process exit after stdin is closed
recordDirectory $DSH_HOME/.dsh-wolfram Location where the Supervisor records child processes
reclaimOrphans true Reclaims leftover process trees on load
probeWolframScript true Whether to enable wolframscript probing (slower)

2. id: wolfram-permission line

Controls approval policy.

Field Default Description
unknown ask Decision for unknown tools
delegate [WolframLanguageContext, WolframAlphaContext, SymbolDefinition] Read-only tools delegated to subsequent policies

Configuration example: Specify kernel path and turn off approval for unknown tools

- id: wolfram
  config:
    serverName: wolfram
    mcpServerName: WolframLanguage
    command: 'D:\mathematica\Mathematica 15.0\wolfram.exe'
    graceMs: 1000
    reclaimOrphans: true

- id: wolfram-permission
  config:
    serverName: wolfram
    unknown: deny
    delegate: []

WSL Environment Reuse

If using WSL, explicitly specify paths and disable automatic probing to avoid starting the wrong default server.

- id: wolfram
  config:
    serverName: wolfram
    mcpServerName: WolframLanguage
    command: /mnt/d/mathematica/Mathematica 15.0/wolfram.exe
    probeWolframScript: false
    recordDirectory: /home/<user>/.local/state/dsh-wolfram
    reclaimOrphans: true

Troubleshooting

Kernel Not Found

Startup error no Wolfram kernel found. Check in this order:
1. Confirm Wolfram is installed: wolframscript -code '$InstallationDirectory'.
2. Explicitly specify installationDirectory or command in the configuration.
3. The environment variable DSH_WOLFRAM_COMMAND can also temporarily override it.

Empty Tools

Check whether the Wolfram/AgentTools Paclet is installed and its version. You can manually run supervisor to test:

node D:\dsh-dev\dsh-wolfram\src\supervisor-main.js --command 'D:\mathematica\Mathematica 15.0\wolfram.exe' --arg -run --arg 'PacletSymbol["Wolfram/AgentTools","Wolfram`AgentTools`StartMCPServer"][]' --arg -noinit --arg -noprompt

Or run the repository’s built-in test:

npm run test:live

Leftover Processes

The plugin only manages processes started via the supervisor. When checking, do not batch kill by process name; compare parent process IDs instead. A normal Wolfram process should have node.exe (the process running supervisor-main.js) as its parent.

Summary

The dsh-wolfram plugin provides a standardized integration path for DeepSeek Harness and the official Wolfram toolkit. It addresses the tedious details of process isolation, permission control, and environment configuration, enabling developers to directly use Wolfram’s computational capabilities within the DSH ecosystem.