TOXTRUST-MCP
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TOXTRUST-MCP Assess this QSAR Ames-positive evidence and combine it with the in vitro result."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TOXTRUST-MCP
Model Context Protocol server exposing TOXTRUST (Kopańska & Pastor, PharmacoInformatics Lab, Universitat Pompeu Fabra), a Dempster–Shafer theory (DST) tool that turns toxicological evidence pieces (QSAR predictions, structural alerts, in vitro / in vivo results, read-across, expert judgement) into belief masses and combines them for one binary hazard question (for example: "Is the substance mutagenic in the Ames test?").
Upstream pinned: TOXTRUST commit
185b6e8(packagetoxtrust==0.2).Stateless: no endpoint repository or configuration file is written.
Transports: stdio (default) or streamable HTTP.
License: GPL-3.0-only (it imports GPL-3.0 TOXTRUST).
Tools
Tool | Purpose |
| Semantics, relevance scale, rules, decision thresholds, deviations from upstream, caveats |
| One piece → masses {negative, uncertain, positive}, belief, plausibility, decision |
| ≥2 independent pieces for one question → rule (auto/Dempster/Yager/Inagaki), conflict K, fused masses, decision, exact-arithmetic shadow values, upstream cross-check, warnings |
| All rules + Inagaki scale 0–1 + leave-one-out + one piece per independence group → |
| One endpoint question, a target and candidate substitutes → per-substance integration and interval comparison of the hazard (positive) class |
Every response carries inputs_sha256, a UTC timestamp, the server and upstream versions, and methodological caveats,
so results can be archived in an audit trail.
Evidence piece
{"id": "qsar-ames", "source": "in silico", "outcome": "positive",
"probability_positive": 0.82, "reliability_positive": 0.78, "relevance": "probable",
"independence_group": "ames-public-training-set", "provenance": {"model": "...", "applicability_domain": "inside"}}m(pos) = p_pos · rel_pos · relevance, m(neg) = p_neg · rel_neg · relevance, m(Θ) = 1 − m(pos) − m(neg)
(2-decimal rounding as upstream). Relevance: certain 1, probable 0.9, plausible 0.75, equivocal 0.5, doubted 0.25,
improbable 0.1, impossible 0. Reliabilities and probabilities must be in [0, 1].
Comparison relations (toxtrust_compare_substances)
lower_hazard_supported: Pl(pos | candidate) < Bel(pos | target) and the candidate decision isnegativelower_hazard_indicated_weak: interval separation, but the candidate evidence is not decisive → a data gap, not an advantagehigher_hazard_supported: Bel(pos | candidate) > Pl(pos | target)not_distinguishable,unknown(no evidence ≠ negative)
Related MCP server: PADC Evidence Lab
Engine design
The server computes with engine.py, a port of the upstream evidence.py / combination.py /
Endpoint.makeDecision formulas with input validation, and by default re-runs the unmodified upstream package in a
forkserver subprocess (hard timeout, stdout captured), reporting upstream_check.agreement. The test suite asserts
identical negative/positive masses against upstream on random inputs.
Deliberate deviations from upstream
The upstream renormalisation step can fail to terminate when rounded masses do not sum to 1 ± 0.01; here the rounding residual is assigned to the uncertainty mass in one step.
Inputs are validated strictly: reliabilities/probabilities outside [0, 1] are rejected (no silent percentage handling), and outcome
bothrequires both class probabilities and both reliabilities.Reliabilities are given per class (
reliability_positive,reliability_negative) rather than by list position.Upstream reports Pl(c) = 0 whenever Bel(c) = 0; the textbook DST plausibility Pl(c) = Bel(c) + m(Θ) is returned alongside as
plausibility_dstand is the one to use as the hazard upper bound.Source labels: the upstream vocabulary (
in silico,in vitro,expert,alert,read-across) plusin vivo,human data,regulatory,literature,supplier. Labels do not change the arithmetic; extended labels are mapped toexpertfor the upstream cross-check.
Methodological caveats
DST combination assumes independent sources. Tag pieces of shared origin (same study, a study and the classification based on it, QSAR models trained on overlapping data) with the same
independence_group.Weight of evidence (
woe=true) replicates a pieceweighttimes and self-combines it, which inflates certainty; prefer reliability/relevance.Results are integrated weight-of-evidence statements for one binary question, not measurements, potencies or classifications.
uncertainnever meansnegative.Reliability values (PPV/NPV, sensitivity/specificity, expert confidence) are design choices that drive the result; record their origin in
provenance.
Installation
Requires Python ≥ 3.10.
git clone https://github.com/phi-grib/TOXTRUST-MCP.git
cd TOXTRUST-MCP
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python -e ".[test]" # pulls TOXTRUST at the pinned commit(python -m venv .venv && .venv/bin/pip install -e ".[test]" works as well.)
Running
.venv/bin/toxtrust-mcp # stdio
.venv/bin/toxtrust-mcp --transport streamable-http --port 8005 # HTTP on 127.0.0.1:8005/mcpExample MCP client configuration (stdio):
{"mcpServers": {"toxtrust": {"command": "/path/to/TOXTRUST-MCP/.venv/bin/toxtrust-mcp"}}}Environment: TOXTRUST_UPSTREAM_TIMEOUT (seconds, default 8). Pass upstream_check=false to skip the cross-check.
Scripts that import toxtrust_mcp.server and run the cross-check need an if __name__ == "__main__": guard
(the runner uses a multiprocessing forkserver).
Tests
.venv/bin/python -m pytest -q # ~80 s (runs upstream subprocesses)
.venv/bin/python tests/smoke_stdio.py "$PWD/.venv/bin/toxtrust-mcp"
.venv/bin/python scripts/worked_example.py worked_example.json # synthetic substitution exampleAcknowledgements
TOXTRUST was developed at the PharmacoInformatics Lab (http://phi.upf.edu) within eTRANSAFE (IMI2 JU Grant Agreement No. 777365) and RISK-HUNT3R (EU H2020 Grant Agreement No. 964537, ASPIS cluster).
License
GNU General Public License v3.0 only — see LICENSE.
Available Tools
5 toolstoxtrust_assess_evidenceB
Convert ONE evidence piece into DST masses, belief, plausibility and a thresholded decision (upstream Evidence class). Optionally cross-checks with the unmodified upstream package.
Inputs: evidence (required), min_belief, upstream_check, max_uncertainty. Returns: object
toxtrust_combine_evidenceB
Combine >=2 independent evidence pieces answering the SAME binary question (one substance, one endpoint). Returns per-piece masses, the combination (rule, conflict K, masses, belief, plausibility, decision), exact-arithmetic shadow values, an upstream cross-check and warnings.
Inputs: evidence (required), woe, rule, question, +4 more. Returns: object
toxtrust_compare_substancesB
Substitution helper for ONE endpoint: integrate evidence per substance (target + candidates) and compare each candidate with the target by belief/plausibility interval separation on the POSITIVE (hazard) class. 'lower_hazard_supported' requires Pl_dst(pos|candidate) < Bel(pos|target) AND a 'negative' candidate decision (separation without a decisive candidate is 'lower_hazard_indicated_weak'); 'higher_hazard_supported' requires Bel(pos|candidate) > Pl_dst(pos|target); otherwise 'not_distinguishable'. Never aggregates across endpoints.
Inputs: endpoint (required), question (required), substances (required), rule, +4 more. Returns: object
toxtrust_infoA
Describe TOXTRUST semantics, input fields, rules, decision thresholds, known upstream defects and caveats. Call this once before building evidence pieces.
Inputs: no named parameters. Returns: object
toxtrust_rule_sensitivityB
Robustness check: re-run the combination under Dempster, Yager, Inagaki (scale 0-1), leave-one-out and one-piece-per-independence-group. A decision is 'robust' only if every variant agrees.
Inputs: evidence (required), min_belief, max_uncertainty. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool occupies a distinct stage of the workflow: orientation (toxtrust_info), single-piece conversion (toxtrust_assess_evidence), multi-piece fusion (toxtrust_combine_evidence), robustness testing (toxtrust_rule_sensitivity), and cross-substance comparison (toxtrust_compare_substances). The descriptions explicitly constrain scope (ONE evidence piece vs. >=2 pieces vs. ONE endpoint), so an agent can route unambiguously.
All names are snake_case with a uniform toxtrust_ prefix and mostly verb_noun structure (assess_evidence, combine_evidence, compare_substances, rule_sensitivity). The only deviation is toxtrust_info, a bare noun with no verb, but the shared prefix keeps the set predictable.
Five tools map cleanly onto a narrow, specialized pipeline (info -> assess -> combine -> sensitivity -> compare), and each has a clear, non-redundant role. No filler or near-duplicate tools are present.
The surface covers the full Dempster-Shafer workflow: orientation, per-piece mass conversion, combination with conflict handling, robustness variants, and substitution comparison, with explicit upstream cross-checks. Minor gaps remain—no tool to aggregate or summarize results across multiple endpoints (explicitly forbidden by design) or to validate/prepare raw evidence inputs before assessment—but these are workable given the stated scope.
Maintenance
Related MCP Connectors
Multi-expert decision intelligence with transparent synthesis and auditable workflows.
Create and evaluate versioned decision models with reproducible results and declared assumptions.
Read-only US public-data screening tools with free Basic and Evidence tiers.
Bioassay & ecotoxicology calculators: ELISA 4PL/5PL curves, dietary risk, pollution indices.
Related MCP Servers
- AlicenseCqualityBmaintenanceA server for food-mediated oral exposure screening, governed contaminant and pesticide review, and version-pinned dietary evidence handoffs, converting commodity residues and consumption profiles into auditable intake summaries and PBPK-ready exports.491Apache 2.0
- AlicenseAqualityCmaintenanceEnables agents to search and reference trusted, out-of-band ingested source state, run claim-bound document reviews, validate evidence-status proposals against admissibility guards, and build evidence matrices. It keeps proposal, evidence, admissibility, and adjudication separate so agents can propose epistemic statuses without creating the source facts, page locators, provenance, or missingness records that support them.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables evaluation of synthetic tender requirements against supplier evidence by loading tenders, building compliance matrices, flagging unresolved risks, and preparing draft evidence packs with preserved provenance. Finalization stays blocked behind a mandatory human approval gate, so no award decision is made autonomously.MIT
- AlicenseAqualityBmaintenanceEnables relation-guided assessment and reassessment of scientific claims using a five-level rubric and audits of twelve evidence relations across initial, audit, and verification rounds. Computes diagnostics such as graph zigzag H1 persistence to select a relation for focused repair, and supports batch runs, record verification, and evaluation against gold labels.9MIT