dsh-mcp-cost: MCP Server Cost & Status Panel for DeepSeek Harness

Introduction

After configuring MCP servers in DeepSeek Harness (dsh), every request carries tool definitions, which consume input tokens. For scenarios where you need to frequently debug or toggle multiple MCP services on and off, manually editing cordis.patch.yml and restarting is inconvenient. dsh-mcp-cost provides a sidebar panel listing all MCP servers, allowing you to toggle them with one click (hot-apply, no restart required), view their runtime phase, and estimate the input token cost per request round.

What Is It

dsh-mcp-cost is a client-side plugin for DeepSeek Harness, maintained by LYXDSG. It reads the current profile’s patch layer, lists all MCP servers, performs enable/disable operations through DSH’s pluginManager, and estimates the token footprint of tool definitions and instructions by performing a local MCP handshake and tools/list call over HTTP. The plugin is at version 0.3.1 and is licensed under the MIT License.

Core Features

1. Listing & Identification

Entries are matched by moduleName === '@deepseek-ai/dsh-mcp-client'. Each row displays:

  • serverName
  • patchId
  • Transport method (stdio / streamable-http)
  • Address (endpoint)
  • Invocation timeout
  • Whether a startup failure blocks the overall startup
  • Definition layer (bundle / profile patch / home patch)

2. Hot Toggle & Batch Operations

Enable/disable operations are performed via remote calls to DSH’s pluginManager, sharing the same write path as the plugins page. As a result, behaviors such as layered override, hot reload, rollback, restart-required, and overridden are consistent with DSH. The plugin does not modify YAML directly.

Batch operations are supported:

  • Turn All Off / Turn All On
  • Keep Only Checked (a confirmation prompt is shown when nothing is checked, so it will never silently disable everything)
  • Restore Last State (the snapshot is stored in localStorage and can be recovered after a page refresh)
  • Select All / Deselect All

Batch operations are executed serially, and the count of successes and failures is reported accurately.

3. Runtime Status & Diagnostics

In addition to the configuration state, each row displays fiberPhase (active, failed, etc.). Entries that failed to start will expand to show the error message, making it easier to diagnose issues.

4. Cost Estimation

When you click “Check” or “Check All,” the host initiates a real MCP handshake and tools/list call to the target server, returning the tool count and estimated token count. The estimation formula is:

JSON(tool definitions).length / 1.6 + instructions character count

Results vary across different tokenizers. The numbers are intended for sorting and reference only, and must not be used for billing purposes.

5. Read-Only Protection

Entries that DSH does not allow to be modified via a profile patch are shown with a disabled (grayed-out) toggle in the list, with the reason displayed as a tooltip.

6. Multiple Entry Points & Theming

  • The MCP icon in the sidebar panel bar (click to open directly)
  • Settings → Plugins → dsh-mcp-cost tab
  • Supports bilingual UI (English and Chinese) and adapts to light/dark themes following the host’s design tokens

Installation & Activation

Search for dsh-mcp-cost on the Plugin Marketplace / Discover page and click Install.

Install via CLI

dsh plugin add dsh-mcp-cost

After installation, refresh your browser page. The MCP icon will appear in the sidebar.

Manual Installation (Without dsh plugin)

  1. Copy the package to <DSH_HOME>/profiles/<profile>/node_modules/dsh-mcp-cost
  2. Add the following to the profile’s cordis.patch.yml:
- insert:
    - id: mcp-cost
      name: dsh-mcp-cost
  1. Refresh the page

Typical Usage

  1. After installation, click the MCP icon in the sidebar to open the panel.
  2. For servers you want to temporarily disable, uncheck them and click “Turn All Off” or disable them individually.
  3. For frequently used servers, click “Check” to view the estimated token count and tool count, helping you decide which ones to prioritize for disabling.
  4. To batch-restore the previous state, click “Restore Last.”

Use Cases & Notes

Suitable for developers and scenarios that require frequent toggling, debugging, or controlling the token consumption of MCP servers. The plugin runs with the permissions of the current dsh process. It is recommended to review the source code and license before installation. Known limitations:

  • Estimated token counts are not suitable for direct use as a billing basis.
  • Two HTTP routes are local, unauthenticated endpoints that expose only metadata (no request header values). It is recommended to keep the host listening on loopback only.
  • The plugin does not handle MCP server installation, editing, or hosting — it only manages toggling and measurement.
  • Only stdio and streamable-http transports are recognized.
  • The first check on stdio servers may be slow (it actually spawns a child process).

Ecosystem Context

The philosophy behind DeepSeek Harness is “everything is a plugin.” The community directory SkillHub has no official affiliation with DeepSeek or High-Flyer. This plugin exists solely as a community project.

References

  • Plugin catalog: https://www.skillhub.cn/plugins/LYXDSG/dsh-mcp-cost
  • GitHub: https://github.com/LYXDSG/dsh-mcp-cost
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye