Skip to main content

MCP Server for multi-criteria decision analysis (AHP, TOPSIS, Sensitivity, Decision Trees)

Project description

criterium-mcp

Multi-criteria decision analysis tools for LLM agents via the Model Context Protocol (MCP).

Provides four complementary methods that share the same data model (criteria weights + alternative scores), letting the LLM orchestrate cross-validation:

Method What it does
AHP Pairwise comparison → priority weights + consistency ratio (CR)
TOPSIS Distance-to-ideal ranking (Euclidean in weighted space)
Sensitivity Weight perturbation to find critical ranking transitions
Decision Tree Sequential decisions with multi-criteria leaf outcomes

Quick start

# Install from PyPI
uv tool install criterium-mcp

# Or run directly
uvx criterium-mcp

MCP configuration

Add to your MCP client config (e.g. claude_desktop_config.json, roo-code.json, etc.):

{
  "mcpServers": {
    "criterium": {
      "command": "uvx",
      "args": ["criterium-mcp"]
    }
  }
}

Tools

get_saaty_scale()

Returns the Saaty 1-9 scale reference table for pairwise comparisons.

compute_ahp_weights(pairwise_matrix)

Computes priority weights from an n×n pairwise comparison matrix using Saaty's eigenvector method. Reports:

  • Weights: normalized priority vector (sum = 1)
  • λ_max: principal eigenvalue
  • CI: consistency index
  • CR: consistency ratio (Saaty's RI table included)
  • Consistent?: CR < 0.10 verdict

score_alternatives_ahp(weights, criteria_minimize, alternatives)

Scores and ranks alternatives using AHP weights with min-max normalization. Handles both maximize and minimize criteria (e.g. "cost" → minimize, "quality" → maximize).

evaluate_topsis(weights, criteria_minimize, alternatives)

TOPSIS ranking: finds the alternative closest to the ideal solution and farthest from the nadir. Provides an alternative perspective to the AHP weighted sum — if both methods agree, the decision is more robust.

sensitivity_analysis(base_weights, criteria_minimize, alternatives, steps=20)

Systematically varies each criterion weight from 0 to 1 and tracks ranking changes. Reports critical weight thresholds where the top alternative flips — essential for identifying fragile recommendations.

evaluate_decision_tree(tree, weights, criteria_minimize)

Evaluates a sequential decision tree where leaf outcomes are multi-criteria score vectors. Three node types:

  • decision: you choose (maximize utility)
  • chance: nature chooses (expected utility with probabilities)
  • leaf: terminal outcome with per-criterion scores

Returns the optimal path and the full tree annotated with utilities at every node.

Development

git clone https://github.com/yohann/criterium-mcp
cd criterium-mcp
uv venv
source .venv/bin/activate
uv pip install -e .
criterium

License

MIT

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

criterium_mcp-0.1.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

criterium_mcp-0.1.2-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file criterium_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: criterium_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for criterium_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1330f170893aabb684ed4346fb3a229c18267bad3d13365ba9b27987c272ba8a
MD5 d2300597c0c7f3c440296aca022cd26f
BLAKE2b-256 44c8a38b10d03467be241317ff69abb0ae5c778ce8c8c6509fd6a8f285c643a4

See more details on using hashes here.

File details

Details for the file criterium_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: criterium_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for criterium_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d192570fcc87eb2849d8551dee3dbdb7ab7d9f5089dbd07514466ac74727e02
MD5 b0ee791b760ceebfc72266f2f472ed26
BLAKE2b-256 e95f245dc153a5fc5b3958cbeff821aba1c7c65c53a952a4a6ae87d2ec9e6df4

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