Preface¶
The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When building agents, handling mathematical calculations or system modeling is a common requirement. Queueing theory is the foundation of system performance evaluation, but manual calculations or writing simulation code can be cumbersome. As a Model Context Protocol (MCP) server, xby-mm1-simulation provides the ability to invoke queueing simulation and theoretical calculations directly within the DSH environment, helping developers quickly evaluate system throughput and latency.
Plugin Overview¶
This plugin is maintained by xby-skill and is an open-source MCP server. It focuses on the simulation and analysis of M/M/1 and M/M/c queueing systems, providing a complete toolkit for parameter validation, theoretical metric calculation, discrete-event simulation, and result comparison.
Core Features¶
The plugin provides the following main tool functions:
-
set_xby_apikey
Set the API key in the chat. The key is automatically persisted and remains valid after restarting the DSH process. -
validate_config
Check the validity of M/M/1 configuration parameters and system stability.
- Parameters:arrival_rate(λ),service_rate(μ),simulation_time.
- Returns: A dictionary containingvalid(boolean),errors(list of errors),warnings(list of warnings), andutilization. -
calculate_metrics
Calculate M/M/1 theoretical performance metrics using exact formulas.
- Parameters:arrival_rate(λ),service_rate(μ).
- Returns: A dictionary containing utilization, average queue length, average number of customers in the system, average waiting time, and average time in the system.
- Exception: If the system is unstable (λ >= μ), aValueErroris raised. -
run_simulation
Run an M/M/1 queueing simulation using SimPy.
- Parameters:arrival_rate,service_rate,simulation_time,random_seed.
- Returns: A dictionary containing simulation metrics, theoretical metrics, comparative analysis, and configuration information. -
compare_results
Compare simulation results with theoretical values for analysis.
- Parameters: simulation metrics,arrival_rate,service_rate.
- Returns: Item-by-item comparison, mean absolute error percentage, maximum error percentage, whether the result is within a 10% range, and accuracy level. -
recommend_parameters
Recommend simulation parameters for a specified utilization.
- Parameters:target_utilization(default 0.7),service_rate,min_customers.
- Returns: Recommended parameter configuration and expected metrics.
Installation and Configuration¶
Before use, install the plugin with the following command:
dsh plugin --profile web add github:xby_skill/xby-mm1-simulation
After installation, invoke the set_xby_apikey tool in the conversation and enter the API key obtained from the official XiaoBenYang website.
Notes¶
- System stability check: When calling
calculate_metrics, if the input arrival rate is greater than or equal to the service rate (λ >= μ), the system is considered unstable and the function raises aValueError. - Permission scope: DSH plugins run with the permissions of the current process. Review the source code and license (MIT) before installation.
- Dependencies: The simulation feature depends on the SimPy library.
Conclusion¶
xby-mm1-simulation provides DSH agents with standardized queueing system analysis capabilities. By combining theoretical calculation with discrete-event simulation, developers can more intuitively evaluate system performance. The complete source code and documentation are available at: GitHub repository.