An open Model Context Protocol server for Vose Software's ModelChoice decision-tree add-in for Excel.
Project description
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.12— Phase 3 (build + drive). 14 tools: build_tree / edit_tree (incl. add/remove options & outcomes) / build_control_panel, read + roll + verify, plus run_evpi / run_evii / run_robustness / run_sensitivity / run_decision_report / 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. |
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. |
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. |
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_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_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_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. |
Prompt: /design-decision-tree walks an analyst through building a tree from a description (or pasted data) and analysing it.
Run it: 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_Storepayload (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 (done): the read + rollback engine — parse
_MC_Store, reconstruct each tree, roll back to EV + optimal policy. Validated against ModelChoice's own C# rollback test. - Phase 1 (done): the MCP server —
list_trees,get_tree,roll_up, proven live against a real workbook. - Phase 1b (done):
verify_rollbackcross-checks our EVs against theMC_V_<id>named ranges; CI (ruff + mypy + pytest) and a tag-driven PyPI release pipeline; wheel + sdist build. (First publish awaits a PyPI trusted-publisher; the liveMC_V_cross-check awaits a real rendered tree.) - Phase 2 (in progress): drive analyses. ModelChoice already ships headless
MC_*_AutoExcelCommands for most analyses (robustness, sensitivity, strategy table, policy, decision brief, MCDA, risk profile);run_analysis+read_sheetdrive and read any of them. EVPI and EVII had no standalone commands, soMC_EVPI_Auto(AB#2558) andMC_EVII_Auto(AB#2568) were added with therun_evpi/run_eviitools. Live verification + richer per-analysis result parsing are the remaining work. - Phase 3: build/edit trees — write the model JSON into
_MC_Storeand trigger a re-render.
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modelchoice_mcp-0.0.13.tar.gz.
File metadata
- Download URL: modelchoice_mcp-0.0.13.tar.gz
- Upload date:
- Size: 32.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6df6b9f741e956b1fe9900e59b015918cfc07d80a30fcdc61109509f65fede9
|
|
| MD5 |
d3d55873b500e22f703d5f653d06ef55
|
|
| BLAKE2b-256 |
20698430aad26b66941bd9230c4f8ca1aa04667a8b9465d5484f110e88106c37
|
Provenance
The following attestation bundles were made for modelchoice_mcp-0.0.13.tar.gz:
Publisher:
release.yml on vosesoftware/modelchoice-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modelchoice_mcp-0.0.13.tar.gz -
Subject digest:
c6df6b9f741e956b1fe9900e59b015918cfc07d80a30fcdc61109509f65fede9 - Sigstore transparency entry: 1804891760
- Sigstore integration time:
-
Permalink:
vosesoftware/modelchoice-mcp@dfdcfc11032430433db7678431f063dcb1917b9b -
Branch / Tag:
refs/tags/v0.0.13 - Owner: https://github.com/vosesoftware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dfdcfc11032430433db7678431f063dcb1917b9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file modelchoice_mcp-0.0.13-py3-none-any.whl.
File metadata
- Download URL: modelchoice_mcp-0.0.13-py3-none-any.whl
- Upload date:
- Size: 30.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e63ab11b4ddcda99f698757efa25529ee0db132b0b1bf7993cd6a93e5cf5590
|
|
| MD5 |
679d3123ecc01af575c4403c1e283dee
|
|
| BLAKE2b-256 |
4861e785c1cd1b1fb2cdccb631c463eebe30fa9c47242bb0ae62fceefa568b98
|
Provenance
The following attestation bundles were made for modelchoice_mcp-0.0.13-py3-none-any.whl:
Publisher:
release.yml on vosesoftware/modelchoice-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modelchoice_mcp-0.0.13-py3-none-any.whl -
Subject digest:
7e63ab11b4ddcda99f698757efa25529ee0db132b0b1bf7993cd6a93e5cf5590 - Sigstore transparency entry: 1804891896
- Sigstore integration time:
-
Permalink:
vosesoftware/modelchoice-mcp@dfdcfc11032430433db7678431f063dcb1917b9b -
Branch / Tag:
refs/tags/v0.0.13 - Owner: https://github.com/vosesoftware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dfdcfc11032430433db7678431f063dcb1917b9b -
Trigger Event:
push
-
Statement type: