Introduction¶
In intelligent agent applications built on DeepSeek Harness (DSH), you may sometimes need to introduce randomness or handle rule-based game logic. Implementing dice algorithms directly in code would increase development and maintenance costs. The xby-dice plugin encapsulates an MCP server and provides the model with a direct entry point for invoking dice services, enabling it to perform calculations using standard dice notation.
Plugin Overview¶
xby-dice is a DSH plugin maintained by xby-skill and focuses on dice simulation. It allows agents to invoke it using standard dice notation (such as 1d20) and returns a single result and its total sum. The plugin is licensed under the MIT license, and its source code is hosted on GitHub.
Installation and Activation¶
Installation can be completed using DSH’s command-line tool. The plugin supports direct installation by pulling it from a GitHub repository.
dsh plugin --profile web add github:xby_skill/xby-dice
After installation, the plugin starts with the DSH process, and its provided methods can be invoked directly within the chat context.
Core Features¶
The plugin mainly provides two functional interfaces:
- set_xby_apikey: Sets the API key in the chat.
- roll_dice: Performs a dice roll using standard dice notation.
How to Use¶
Before using it, complete key configuration first, then perform dice calculations.
-
Configure the key:
Invokeset_xby_apikeyin the chat and pass the API key obtained from the official Xiaobenyang website as a parameter. -
Perform a roll:
Invoke theroll_dicefunction and pass a standard dice expression.
Common examples:
- 2d6+3: Roll two six-sided dice (d6) and add 3 to the result.
- 1d20-2: Roll one twenty-sided die (d20) and subtract 2 from the result.
Notes¶
- Key source: To use this feature, you need to register on the official Xiaobenyang website and obtain an API key.
- Persistent storage: The API key is automatically persisted after it is set and remains valid after restarting the DSH process, so it does not need to be configured repeatedly.
Summary¶
xby-dice provides the DSH ecosystem with a lightweight dice calculation tool. In scenarios that require random number generation or rule-based interactions, invoking this plugin through standard notation can simplify the development process.