Are you the author? Sign in to claim
Simulation_by_SimPy_MCP
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!
M/M/1 and M/M/c are fundamental queuing models in operations research:
This MCP server enables LLMs like Claude to:
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 citationsvalidate_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 configurationgenerate_simulation_code - Create production-ready SimPy codeexplain_mm1_theory - Educational content on M/M/1 theoryanalyze_results - Interpret simulation outcomesdebug_simulation - Troubleshoot common issuesuvx (Recommended)uvx mcp-server-mm1
pippip install mcp-server-mm1
mcp-server-mm1
git clone https://github.com/yourusername/mcp-server-mm1.git
cd mcp-server-mm1
uv pip install -e .
mcp-server-mm1
Add to your claude_desktop_config.json:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
Location: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"mm1-simulation": {
"command": "uvx",
"args": ["mcp-server-mm1"]
}
}
}
Restart Claude Desktop and the server will be available!
User: Show me the M/M/1 queue schema
Claude uses: mm1://schema resource
User: Is λ=5, μ=8 a valid M/M/1 configuration?
Claude uses: validate_config tool
Result: ✓ Valid, ρ=0.625
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.3333
User: Run a simulation with λ=5, μ=8 for 10,000 time units
Claude uses: run_simulation tool
Result: Simulation metrics + theoretical comparison + accuracy analysis
User: Generate SimPy code for λ=3, μ=10
Claude uses: generate_simulation_code prompt
Result: Complete, production-ready Python code
# Clone repository
git clone https://github.com/yourusername/mcp-server-mm1.git
cd mcp-server-mm1
# Install dependencies
uv pip install -e ".[dev]"
pytest
# Format code
black src/ tests/
# Lint
ruff check src/ tests/
# Type check
mypy src/
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.py
This opens a web interface where you can:
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 calculations
Given arrival rate λ and service rate μ:
System must satisfy ρ < 1 (λ < μ)
If ρ ≥ 1, the queue grows unbounded!
Contributions are welcome! Please:
MIT License - see LICENSE file for details.
This MCP server was developed as part of research on LLM-assisted simulation code generation for the Winter Simulation Conference (WSC) 2025.
Made with ❤️ for the simulation and LLM communities
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows