M/M/1 and M/M/c Queue Simulation Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@M/M/1 and M/M/c Queue Simulation Serversimulate a bank with 3 tellers, arrival rate 4 customers/hour, service rate 2 customers/hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server for M/M/1 and M/M/c Queue Simulation
A Model Context Protocol server that provides comprehensive resources, tools, and prompts for M/M/1 and M/M/c queuing system simulation and analysis.
New in v0.2.0: Full M/M/c support with comparison tools!
What is M/M/1 and M/M/c?
M/M/1 and M/M/c are fundamental queuing models in operations research:
First M: Markovian (Poisson) arrivals
Second M: Markovian (exponential) service times
1 or c: Number of servers (1 for M/M/1, c for M/M/c)
This MCP server enables LLMs like Claude to:
Simulate both M/M/1 and M/M/c systems
Compare separate queues vs pooled queue strategies
Validate simulation parameters
Calculate theoretical performance metrics
Generate and execute SimPy simulations
Analyze real-world scenarios (supermarkets, banks, etc.)
Related MCP server: M/M/1 Queue Simulation MCP Server
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 (8)
validate_config- Validate M/M/1 parameters and check stabilitycalculate_metrics- Compute theoretical performance metricsrun_simulation- Execute M/M/1 simulation (legacy)run_mmc_simulation- Execute M/M/c simulation (NEW!)compare_mm1_vs_mmc- Compare separate vs pooled queues (NEW!)analyze_cashier_problem- Supermarket scenario analysis (NEW!)compare_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)
uvx mcp-server-mm1Option 2: Using pip
pip install mcp-server-mm1
mcp-server-mm1Option 3: From Source
git clone https://github.com/yourusername/mcp-server-mm1.git
cd mcp-server-mm1
uv pip install -e .
mcp-server-mm1Usage 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
{
"mcpServers": {
"mm1-simulation": {
"command": "uvx",
"args": ["mcp-server-mm1"]
}
}
}Restart Claude Desktop and the server will be available!
Example Usage in Claude
1. Get M/M/1 Schema
User: Show me the M/M/1 queue schema
Claude uses: mm1://schema resource2. Validate Configuration
User: Is λ=5, μ=8 a valid M/M/1 configuration?
Claude uses: validate_config tool
Result: ā Valid, Ļ=0.6253. Calculate Theoretical Metrics
User: Calculate theoretical metrics for λ=5, μ=8
Claude uses: calculate_metrics tool
Result:
- Utilization: 0.625
- Avg queue length: 1.0417
- Avg waiting time: 0.2083
- Avg system time: 0.33334. Run Simulation
User: Run a simulation with λ=5, μ=8 for 10,000 time units
Claude uses: run_simulation tool
Result: Simulation metrics + theoretical comparison + accuracy analysis5. Generate Code
User: Generate SimPy code for λ=3, μ=10
Claude uses: generate_simulation_code prompt
Result: Complete, production-ready Python codeDevelopment
Setup Development Environment
# Clone repository
git clone https://github.com/yourusername/mcp-server-mm1.git
cd mcp-server-mm1
# Install dependencies
uv pip install -e ".[dev]"Run Tests
pytestCode Quality
# Format code
black src/ tests/
# Lint
ruff check src/ tests/
# Type check
mypy src/Local Testing
Use the MCP Inspector to test the server locally:
# Install MCP inspector (if not already installed)
npm install -g @modelcontextprotocol/inspector
# Run server with inspector
mcp dev src/mcp_server_mm1/server.pyThis opens a web interface where you can:
Browse available resources
Test tool invocations
Try prompt templates
Inspect JSON-RPC communication
Architecture
src/mcp_server_mm1/
āāā server.py # FastMCP server with resources/tools/prompts
āāā schemas/
ā āāā mm1_schema.py # M/M/1 system schema definition
āāā simulations/
ā āāā mm1_queue.py # SimPy simulation implementation
āāā utils/
āāā metrics.py # Theoretical calculationsM/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
This server cannot be deployed
Maintenance
Related MCP Connectors
Run M/M/c queue simulations and four scenarios (call center, ER, coffee shop, single server).
Reliability and bottleneck simulation for manufacturing lines; run experiments, sweep buffers.
Healthcare staffing simulator ā ED, walk-in clinic, and appointment office DES tools.
Agent admission queue with capacity control and priority tiers
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAdvanced server for simulating financial models and stochastic processes, offering tools for generating simulations, calculating financial metrics, and visualizing results with interactive components.-
- AlicenseNot gradedqualityNot gradedmaintenanceEnables LLMs to access M/M/1 queuing theory resources, validate parameters, calculate theoretical metrics, generate and execute SimPy simulations, and compare simulation results with theoretical predictions.MIT
- AlicenseAqualityDmaintenanceGenerates AnyLogic simulation models from natural-language prompts in Claude Code, allowing users to describe queueing systems, factories, or ERs and obtain runnable .alp files.5MIT
- AlicenseBqualityBmaintenanceEnables natural language conversion of production and queueing systems into Petri net models, with simulation and PNML export via MCP tools.66MIT