MCP Server for M/M/1 Queue Simulation
A Model Context Protocol server that provides comprehensive resources, tools, and prompts for M/M/1 queuing system simulation and analysis.
What is M/M/1?
M/M/1 is a fundamental queuing model in operations research:
First M: Markovian (Poisson) arrivals
Second M: Markovian (exponential) service times
1: Single server
This MCP server enables LLMs like Claude to:
Access structured M/M/1 theory and formulas
Validate simulation parameters
Calculate theoretical performance metrics
Generate and execute SimPy simulations
Compare simulation results with theory
Features
š Resources (7)
mm1://schema- Complete M/M/1 system schemamm1://parameters- Parameter definitions with constraintsmm1://metrics- Performance metrics catalogmm1://formulas- Theoretical formulasmm1://guidelines- Implementation best practicesmm1://examples- Pre-configured scenariosmm1://literature- References and citations
š§ Tools (5)
validate_config- Validate M/M/1 parameters and check stabilitycalculate_metrics- Compute theoretical performance metricsrun_simulation- Execute SimPy discrete event simulationcompare_results- Analyze simulation accuracyrecommend_parameters- Suggest optimal configuration
š¬ Prompts (4)
generate_simulation_code- Create production-ready SimPy codeexplain_mm1_theory- Educational content on M/M/1 theoryanalyze_results- Interpret simulation outcomesdebug_simulation- Troubleshoot common issues
Installation
Option 1: Using uvx (Recommended)
Option 2: Using pip
Option 3: From Source
Usage with Claude Desktop
Add to your claude_desktop_config.json:
macOS
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows
Location: %APPDATA%\Claude\claude_desktop_config.json
Configuration
Restart Claude Desktop and the server will be available!
Example Usage in Claude
1. Get M/M/1 Schema
2. Validate Configuration
3. Calculate Theoretical Metrics
4. Run Simulation
5. Generate Code
Development
Setup Development Environment
Run Tests
Code Quality
Local Testing
Use the MCP Inspector to test the server locally:
This opens a web interface where you can:
Browse available resources
Test tool invocations
Try prompt templates
Inspect JSON-RPC communication
Architecture
M/M/1 Theory Quick Reference
Key Formulas
Given arrival rate λ and service rate μ:
Utilization: Ļ = Ī»/μ
Avg Queue Length: L_q = ϲ/(1-Ļ)
Avg Time in Queue: W_q = Ļ/(μ(1-Ļ))
Avg Time in System: W = 1/(μ(1-Ļ))
Stability Condition
System must satisfy Ļ < 1 (Ī» < μ)
If Ļ ā„ 1, the queue grows unbounded!
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes with tests
Submit a pull request
License
MIT License - see LICENSE file for details.
Related Work
This MCP server was developed as part of research on LLM-assisted simulation code generation for the Winter Simulation Conference (WSC) 2025.
References
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Made with ā¤ļø for the simulation and LLM communities