Introduction

The design philosophy of DSH Web GUI is “everything is a plugin.” In practice, a locally running aggregated MCP server (such as MCPHub) often contains multiple tools needed by agents, but DSH cannot directly access these tools by default. This usually requires developers to manually configure each tool into DSH one by one, resulting in higher maintenance costs.

What Is This

@dong-victor/dsh-mcphub is a DSH Web GUI plugin. It uses the official MCP SDK as a client, connects to the local MCPHub service (default http://localhost:3000) aggregated endpoint (/mcp or /mcp/<group>), and registers all discovered tools as native DSH agent tools, enabling agents to call them directly in a session.

Core Features

  1. Tool Bridging and Registration
    The plugin connects to the MCPHub endpoint and registers tools as native agent tools. Tool naming follows the convention mcp__mcphub__<server名>-<工具名> (for example mcp__mcphub__cassiopeia-ap-mysql-execute_sql). Parameter schemas are consistent with those published by MCPHub, and invocation results are projected back into the model context as MCP text blocks.

  2. Agent Tools
    The plugin additionally provides two agent tools:
    * mcphub_status: view connection status, endpoint address, server and tool inventory (including DSH callable names), and MCPHub /health status.
    * mcphub_resync: force a resynchronization of the tool set. After servers or tools are added, removed, or modified on the MCPHub side, calling this tool refreshes the locally registered tool list.

  3. Sidebar and Status Panel
    At the bottom of the sidebar (footArea, above the “Settings” button), it provides an “MCPHub” entry. Clicking it opens a status panel, displaying the connection badge, endpoint, health status, last sync time, server-grouped tool inventory (supporting expansion), an external link to open the MCPHub Dashboard, and a manual refresh button.

  4. Robustness and Hot Synchronization
    * Automatic reconnection with exponential backoff on disconnection; tools remain registered during the interruption and are automatically resynchronized after recovery.
    * Listens to notifications/tools/list_changed events, supporting hot synchronization of the tool set.
    * When MCPHub is unreachable, the plugin activates normally, and the status panel faithfully displays the error.

  5. Host Routing
    The plugin provides a loopback route GET /api/dsh-mcphub/status, supporting the ?refresh=1 parameter to bypass the TTL cache.

Installation and Activation

Prerequisites: A local MCPHub service (@samanhappy/mcphub, default port 3000) is running, and at least one server is enabled in it.

Installation command:

dsh plugin --profile web add link:C:\Users\dongz\.dsh\workspace\dsh-mcphub

After installation, you need to restart the dsh web host process to load the new bundle.

Configuration

The plugin supports overriding configuration via cordis.patch.yml. By default, it connects to the global aggregated endpoint /mcp; you can modify it to a specific group:

- id: mcphub
  name: '@dong-victor/dsh-mcphub'
  config:
    baseUrl: http://localhost:3000   # MCPHub 地址
    group: ''                        # 留空=全局聚合 /mcp;填分组名= /mcp/<group>
    serverName: mcphub               # 工具命名空间(mcp__<serverName>__…)
    headers: {}                      # 附加 HTTP 头,如 { Authorization: 'Bearer xxx' }
    announceToAgent: true            # 是否向 agent 公告本插件
    toolCallTimeoutMs: 60000         # 单次 tools/call 超时
    reconnect:
      enabled: true
      initialDelayMs: 500
      maxDelayMs: 30000
      maxAttempts: 10

Typical Usage

When calling tools in MCPHub, use the specified naming format:

mcp__mcphub__<server名>-<工具名>

For example:

mcp__mcphub__cassiopeia-ap-mysql-execute_sql

After enabling announceToAgent in the configuration, agents will automatically recognize these tools. If tools on the MCPHub side change, you can manually call mcphub_resync to refresh.

Applicable Scenarios and Notes

  • Dependency Environment: It must depend on the MCPHub service being online and running.
  • Scope Limitation: Currently only bridges the Tool capability of MCP; MCP Resources / Prompts are not exposed for the time being (consistent with dsh-mcp-client behavior).
  • Tool Name Logic: The <server名> prefix in tool names comes from MCPHub configuration; renaming it in MCPHub will change the tool name.
  • Panel Display: The server grouping in the sidebar panel is heuristically inferred from tool name prefixes, is used for display only, and does not affect actual invocation.
  • Permissions and Security: The plugin runs with the permissions of the current DSH process; ensure that the installed source code is trusted.

Conclusion

This plugin solves the access problem after aggregating multiple local MCP Servers, injecting tool capabilities into DSH agents through standardized interfaces, and using hot synchronization to ensure the timeliness of the tool set. Related directories and source code are located below.