Skip to main content

Monte Carlo simulation system for software development effort estimation

Project description

Monte Carlo Project Simulator (mcprojsim)

Category Link
Package PyPI version Python 3.14+
Documentation Documentation
License License: MIT
Release GitHub release
CI/CD CI Doc build Coverage
Code Quality Code style: black Checked with mypy Linting: flake8
Repo URL GitHub

Overview

mcprojsim is a Monte Carlo simulation tool for project with emphasis on agile software project estimation. Instead of producing a single deadline, it models uncertainty in task duration, dependencies, risks, and other schedule drivers to produce confidence-based forecast ranges.

It is intended for teams that want answers such as:

  • What is the likely completion range for this project?
  • What is the $P50$, $P80$, or $P90$ delivery date?
  • Which tasks most often drive schedule risk?
  • How do risks and uncertainty factors change the forecast?

Key features

  • Natural language project input — generate valid project files from plain-text descriptions using mcprojsim generate
  • Monte Carlo schedule simulation with configurable iteration counts
  • Range-based task estimates using triangular and log-normal distributions
  • Unit-aware estimation: supports hours, days, and weeks with automatic conversion to a canonical hours-based internal representation
  • Configurable hours_per_day per project, with working-day and delivery-date reporting
  • Task dependencies and schedule-aware project duration calculation
  • Task-level and project-level risk modeling
  • Configurable uncertainty factors such as team experience and requirements maturity
  • T-shirt size and story point symbolic estimates with configurable unit defaults
  • Exported results in JSON, CSV, and HTML formats
  • Critical path and sensitivity-oriented analysis outputs
  • Sensitivity analysis — Spearman rank correlation identifies which tasks most influence total duration
  • Schedule slack — CPM-based total float calculation highlights critical vs. buffered tasks
  • Risk impact analysis — per-task trigger rates, mean impact, and mean-when-triggered statistics
  • Statistical distribution metrics — skewness, excess kurtosis, and coefficient of variation for the overall schedule distribution
  • Probability-of-date — calculate the likelihood of finishing by a given target date (--target-date)
  • ASCII table output — optional --table flag formats CLI results as bordered tables for easier reading
  • Reproducible runs with explicit random seeds

Recommended installation

For most end users, pipx is the simplest way to install mcprojsim as a CLI tool.

python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install mcprojsim

Then verify the installation:

mcprojsim --help
mcprojsim --version

For a first-run walkthrough, see the 10-min QUICKSTART.md. After this we recommend going through the User Guide

Minimal example

Create a file named project.yaml:

project:
  name: "My Project"
  description: "Sample project for estimation"
  start_date: "2025-11-01"
  confidence_levels: [50, 80, 90]

tasks:
  - id: "task_001"
    name: "Database schema design"
    estimate:
      min: 3
      most_likely: 5
      max: 10
      unit: "days"
    dependencies: []
    uncertainty_factors:
      team_experience: "high"
      requirements_maturity: "medium"
      technical_complexity: "low"

Validate the file:

mcprojsim validate project.yaml

Run a simulation:

mcprojsim simulate project.yaml --seed 12345

Typical outputs (see the --help for how to specify output) include:

  • *_results.json for full machine-readable output
  • *_results.csv for tabular summaries
  • *_results.html for a browsable report

Documentation map

Use the local document that matches your goal:

The full published documentation is also available at https://johan162.github.io/mcprojsim/.

Example commands

# Generate a project file from a natural language description
mcprojsim generate examples/nl_example.txt -o my_project.yaml

# Validate an input file
mcprojsim validate examples/sample_project.yaml

# Run a default simulation
mcprojsim simulate examples/sample_project.yaml

# Use a custom configuration
mcprojsim simulate examples/sample_project.yaml --config examples/sample_config.yaml

# Reproduce a run exactly
mcprojsim simulate examples/sample_project.yaml --seed 42

# Format output as ASCII tables
mcprojsim simulate examples/sample_project.yaml --table

# Calculate probability of meeting a target date
mcprojsim simulate examples/sample_project.yaml --target-date 2026-06-01

# Combine options
mcprojsim simulate examples/sample_project.yaml --config examples/sample_config.yaml --table --verbose --seed 42

MCP server integration

mcprojsim can run as a Model Context Protocol (MCP) server, letting AI assistants such as GitHub Copilot, Claude Desktop, or any MCP-compatible client generate project files, validate descriptions, and run simulations conversationally.

Install with the optional MCP dependency group:

pipx install "mcprojsim[mcp]"

Or, from a source checkout:

poetry install --with mcp

Add the server to your MCP client configuration (e.g. VS Code settings.json or Claude Desktop claude_desktop_config.json):

{
  "mcpServers": {
    "mcprojsim": {
      "command": "mcprojsim-mcp"
    }
  }
}

The server exposes three tools:

Tool Description
generate_project_file Convert a natural-language project description into a valid YAML project file
validate_project_description Check a description for missing data or inconsistencies without generating a file
simulate_project Generate, validate, and simulate in one step — returns full statistical results

For developers

If you want to work from a source checkout, run tests, build docs, or use containers, start with:

The deatiled developer documentation (including how to configure and build the container) is available at

Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Run the test suite
  5. Submit a pull request

Support

Citation

If you use this tool in research or project planning, please cite:

@software{mcprojsim,
  title = {Monte Carlo Project Simulator},
  author = {Johan Persson},
  year = {2026},
  url = {https://github.com/johan162/mcprojsim},
  version = {0.4.6}
}

License

MIT License - see LICENSE.

Acknowledgments

Inspired by the work of:

  • Steve McConnell - Software Estimation: Demystifying the Black Art
  • Frederick Brooks - The Mythical Man-Month
  • Douglas Hubbard - How to Measure Anything in Cybersecurity Risk

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcprojsim-0.4.6.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcprojsim-0.4.6-py3-none-any.whl (58.2 kB view details)

Uploaded Python 3

File details

Details for the file mcprojsim-0.4.6.tar.gz.

File metadata

  • Download URL: mcprojsim-0.4.6.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.14.0-1017-azure

File hashes

Hashes for mcprojsim-0.4.6.tar.gz
Algorithm Hash digest
SHA256 4e950a7f77aa9f8f7f407cad05b18507a615d2a4eff0af4169fd91c9d0d51fce
MD5 03f92438022561a1b55fd6b6bfb79661
BLAKE2b-256 6946789d3543cff4d60413f4521c2f182c323a465d6340ecc40468058c04c770

See more details on using hashes here.

File details

Details for the file mcprojsim-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: mcprojsim-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 58.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.14.0-1017-azure

File hashes

Hashes for mcprojsim-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 615bd65a7a05469e83f3b7a92b4724fd05cda6b11f57345f4c499812a0f0dd80
MD5 21d6025b336ecb2fb3ebd403b62c0f8d
BLAKE2b-256 0d1e75a5b2de455b9a550f9744c922e01500ff70eead4ae926d0642d31dab71c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page