Skip to main content

ModelChoice MCP

An open Model Context Protocol server for Vose Software's ModelChoice — the decision-tree add-in for Excel.

A sibling to modelrisk-mcp: where that server brings Monte Carlo risk modelling into a conversation, this one brings decision analysis — building, reading, rolling back, and analysing decision trees in Excel.

Status: 0.0.28 — Phase 3 (build + drive). 24 tools: build_tree / build_mcda / edit_tree (incl. add/remove options & outcomes) / set_input_distribution (put a Vose distribution on an input) / build_control_panel / export_tree_json / import_tree_json / import_precisiontree, read + roll + verify, run_scenarios (what-if comparison), plus run_evpi / run_evii / run_risk_profile / run_robustness / run_sensitivity / run_decision_report (strategy/policy/brief/mcda/force-to-outcome/two-way) / run_analysis / read_sheet over ModelChoice's headless commands.

Tools

Tool What it does
build_tree Build a tree from a structured description and write it into Excel (dry-run by default). Validates + rolls it back so you confirm the recommendation before writing. The build-from-a-prompt path.
build_mcda Build a multi-criteria (MCDA) model — for choices that aren't pure money. Give the tree + criteria (ordinal options, weights, direction), aggregation, and each terminal's option per criterion; the add-in computes the composite scores. Weights can be entered directly or derived from an AHP pairwise-comparison matrix (weight_source="ahp" → eigenvector weights + consistency ratio). Drives MC_ApplyMcda_Auto.
edit_tree Tweak an existing tree — change probabilities, payoffs, labels, or the objective, add or remove whole options/outcomes (add_option / add_branch / remove_branch), then re-roll it (dry-run by default). The "tweak it by talking" path.
set_input_distribution Make a tree input uncertain — put a ModelRisk Vose* distribution on a branch's cash flow or probability (like typing a distribution into the cell in the UI). The decision-tree half of a Monte Carlo: once inputs are distributions, run the simulation with modelrisk-mcp to get the tree's outcome distribution. Pure store-edit + re-render — no add-in command.
build_control_panel Lift the tree's inputs into a control panel at the top of the sheet — every probability and cash flow as a labelled cell, with the tree linked back to it, so you drive the whole model from one input block. Drives MC_BuildControlPanel_Auto.
export_tree_json / import_tree_json Round-trip a tree's raw ModelChoice JSON — export to save/share/version, import (validated) to write it back into a workbook.
import_precisiontree Import a PrecisionTree workbook (.xls/.xlsx) into ModelChoice — converts a copy (original untouched). Drives MC_ImportPrecisionTree_Auto.
open_workbook Open a workbook (.xlsx) from disk in the running Excel so the other tools can act on it. Reports its sheets + any ModelChoice tree sheets; reuses an already-open workbook of the same name.
close_workbook Close an open workbook by file name (counterpart to open_workbook). Discards unsaved changes by default; pass save=True to save first.
list_trees List the decision trees in a workbook with node-type counts.
get_tree Full structure of one tree — decision / chance / terminal nodes, branches, probabilities, values.
roll_up Roll the tree back to its expected values and optimal policy — the decision recommendation, in plain English.
verify_rollback Cross-check our rollback against the MC_V_<id> cells ModelChoice itself wrote — a correctness guarantee when the tree has been rendered.
run_scenarios What-if comparison — give named scenarios (bundles of input changes); each is rolled back and compared to the baseline (EV, optimal decision, Δ, whether the decision flips, which scenario wins). Pure Python, no Excel needed.
run_evpi Expected Value of Perfect Information for the active tree — the most you'd pay for perfect information before deciding. Drives ModelChoice's headless MC_EVPI_Auto.
run_risk_profile The outcome distribution for each decision option — expected value, min, max, std dev, plus the cumulative-probability table. Shows downside/upside, not just the average. Drives MC_RiskProfile_Auto.
run_utility Apply a risk attitude (utility function) — returns the certainty equivalent, risk premium, and the optimal decision under risk aversion (can differ from the EV choice). Drives MC_Utility_Auto.
run_evii Expected Value of Imperfect Information for a specific test — pass the target chance node and a likelihood matrix P(signal|state); returns EVII, its net value after cost (worth running?), and the EVPI ceiling. Drives MC_EVII_Auto.
run_decision_report Run a report — strategy_table, policy_suggestion, decision_brief, mcda_report, or force_to_outcome — and read it back (rows + label→value pairs + sheets) in one call.
run_analysis Run any decision-analysis (robustness, sensitivity, strategy_table, policy_suggestion, decision_brief, mcda_report, risk_profile, evpi) and report the result sheets it produced.
run_robustness Run the robustness ("break the decision") analysis and return a structured read — verdict, score, and the minimum input change that flips the decision.
run_sensitivity Run one-way sensitivity and return the tornado-ordered report (which assumptions the decision is most sensitive to) + baseline EV + sheets.
run_decision_report Run a decision report — strategy_table, policy_suggestion, decision_brief, or mcda_report — and read the primary result sheet back in one call (rows + label→value pairs + related sheets).
read_sheet Read a result sheet's cells back (numbers / text), e.g. the robustness verdict or a sensitivity report.

Prompts: /design-decision-tree walks an analyst through building a tree from a description (or pasted data) and analysing it. /decision-tree-monte-carlo then turns it into a Monte Carlo — put Vose* distributions on the uncertain inputs and run the simulation in modelrisk-mcp to get the distribution of the tree's expected value.

Resources: modelchoice://guide/* — curated decision-analysis guidance (building trees, EVPI vs EVII, which analysis answers which question, common pitfalls) the model can read for grounding.

Install

One-click (Claude Desktop) — recommended:

  1. Download modelchoice-mcp.mcpb from the latest release and open it (or drag it onto Claude Desktop's Settings → Extensions).
  2. Restart Claude Desktop.

The bundle ships the server as a standalone executable — no Python to install, no config to edit. (Excel + the ModelChoice add-in are still required for rendering trees.)

From PyPI / source: pip install modelchoice-mcp, then uv run python -m modelchoice_mcp (stdio), or wire modelchoice-mcp into Claude Desktop like any MCP server.

How it works

ModelChoice is a C# .NET (Excel-DNA) add-in. Unlike ModelRisk it exposes no COM object model and no compute worksheet functions — but it persists the entire decision tree as JSON in a very-hidden worksheet (_MC_Store), and the rollback logic is fully captured in that model. So this server can:

  • Read every tree in a workbook by reassembling the _MC_Store payload (chunked across columns, v2-envelope or v1-legacy format) and parsing the model JSON.
  • Roll back each tree to its expected values and optimal policy in pure Python — reproducing ModelChoice's own rollback (terminal payoff = accumulated branch values; chance = auto-normalized probability-weighted EV; decision = max/min by Maximize). No add-in needs to be loaded — it reads the saved model directly.

The Python roller is validated against ModelChoice's own authoritative C# test (Model_Validate_Compile_Rollback_Works): a decision/chance tree that rolls back to EV 50 with the optimal option selected — and matches exactly.

Roadmap

  • Phase 0 — read + rollback engine (done): parse _MC_Store, reconstruct each tree, roll back to EV + optimal policy. Validated against ModelChoice's own C# rollback test.
  • Phase 1 — the MCP server (done): list_trees, get_tree, roll_up, proven live against a real workbook. verify_rollback cross-checks our EVs against the MC_V_<id> named ranges (live-verified: 4/4 nodes, 0 diff). CI (ruff + mypy + pytest) + a tag-driven PyPI release pipeline.
  • Phase 2 — drive analyses (done): run_analysis + read_sheet drive any headless MC_*_Auto command; structured readers for run_robustness, run_sensitivity, run_risk_profile, and run_decision_report (strategy / policy / brief / mcda / force-to-outcome / two-way), plus standalone run_evpi (AB#2558) and run_evii (AB#2568).
  • Phase 3 — build / edit / extend trees (done): build_tree, edit_tree (incl. add/remove options & outcomes), build_control_panel, export_tree_json / import_tree_json, import_precisiontree (AB#2632), run_utility (risk attitude, AB#2635), build_mcda (multi-criteria, AB#2637), and set_input_distribution (put a Vose* distribution on an input — the decision-tree half of a Monte Carlo). All live-verified against the shipped add-in.

The original phased roadmap is delivered. Candidate next steps (not yet scheduled):

  • Simulation hand-off (cross-server): the decision-tree-monte-carlo prompt guides assigning distributions → wrapping the root EV as a ModelRisk output → running the simulation in modelrisk-mcp → reading the EV's output distribution back. A thin orchestration tool could automate the hand-off end-to-end.
  • AHP weight elicitation for MCDAdone (0.0.25, AB#2646): build_mcda accepts a pairwise-comparison matrix (weight_source="ahp") and derives the weights + consistency ratio via the add-in's AhpCalculator.

Architecture

A separate server that reuses the patterns proven in modelrisk-mcp (xlwings bridge, dry-run-by-default safety on any future writes, packaging, MCP-registry flow). Decision analysis and Monte Carlo are distinct domains, so they ship as distinct servers.

Development

uv sync --extra dev
uv run pytest        # parser/roller + store-format tests (no Excel needed)

MIT licensed.

Download files

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

Source Distribution

modelchoice_mcp-0.0.28.tar.gz (57.6 kB view details)

Uploaded Source

Built Distribution

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

modelchoice_mcp-0.0.28-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file modelchoice_mcp-0.0.28.tar.gz.

File metadata

  • Download URL: modelchoice_mcp-0.0.28.tar.gz
  • Upload date:
  • Size: 57.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for modelchoice_mcp-0.0.28.tar.gz
Algorithm Hash digest
SHA256 19d81656227a0874f10b64ab26700ea0b89977b6cfb7bd73b24c862fc7f26ef5
MD5 3405fb3317092539d3956250782f95bf
BLAKE2b-256 8779c7a6124e6b0f0f1f872fe4cd509c89a21e3c413173f5c4030aa591b57cb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelchoice_mcp-0.0.28.tar.gz:

Publisher: release.yml on vosesoftware/modelchoice-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file modelchoice_mcp-0.0.28-py3-none-any.whl.

File metadata

File hashes

Hashes for modelchoice_mcp-0.0.28-py3-none-any.whl
Algorithm Hash digest
SHA256 f844d5d323b74317d61f46f2bbe2f05bc0de3d166d8829eb7dd19c227e726f18
MD5 571a9a450929aecd85b291086baac817
BLAKE2b-256 b97cb43b01ef1de5008fefcf8f1dfd6bb3aa015cac6a505560393779ae2c1960

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelchoice_mcp-0.0.28-py3-none-any.whl:

Publisher: release.yml on vosesoftware/modelchoice-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.0.31

2 files

This release

0.0.28 This release

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.19

2 files

0.0.13

2 files

0.0.12

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page