Skip to content
verify mcp Beta VerifyMCP is currently in beta. If you notice any issues, email [email protected] and we’ll put it right.

io.github.wei-ai-lab/clinical-trial-design

NPM · CLINICAL-TRIAL-DESIGN · SCANNED AUG 3

Phase 2/3 clinical trial design via gsDesign / gsDesign2: sample size, GS boundaries, multiplicity

+23 this week 63 Trust /100
Trust breakdown (6 categories)

How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. How we score →

Supply Chain Security87
  • No malware found by supply-chain analysis.Pass
  • Only part of the dependency tree could be resolved (95 of 99), so this covers what we could see, not the whole tree.Partial
  • No install/post-install scripts declared.Pass
  • Only part of the dependency tree could be resolved (95 of 99), so this covers what we could see, not the whole tree. View diagnostics → Partial
Provenance & Transparency45
Schema Quality & AI Usability47
  • AI-judged instruction clarity (good).Pass
  • Context-footprint check failed: tool/resource definitions use about 4977 tokens (~553/item across 9 items; 9 tools + 0 resources), over budget; trim descriptions and params. See how to fix → Fail
  • Usage-examples check failed: none of the tools include examples. See how to fix → Fail
Stability & Change Management23
  • Stability observed for 7 of 30 days with no destabilising changes; credit accrues until the full window elapses.Partial
Tool Coverage96
  • 100% of tools have a non-trivial description (not blank, and not just the tool's name).Pass
  • 89% of tool parameters carry a description.Partial
Capabilities100
  • Implements a supported MCP spec version (2025-11-25); the latest is 2026-07-28.Pass
Install

Add this component to your MCP client. Where a client-specific snippet is available, pick your client below and copy it straight into your config; otherwise use the connection detail shown.

npm · clinical-trial-design

# add to Claude Code
claude mcp add wei-ai-lab-clinical-trial-design -- npx -y clinical-trial-design
# add to Codex CLI
codex mcp add wei-ai-lab-clinical-trial-design -- npx -y clinical-trial-design
// opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "wei-ai-lab-clinical-trial-design": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "clinical-trial-design"
      ],
      "enabled": true
    }
  }
}
# add to OpenClaw
openclaw mcp add wei-ai-lab-clinical-trial-design --command npx --arg -y --arg clinical-trial-design
# ~/.hermes/config.yaml
mcp_servers:
  wei-ai-lab-clinical-trial-design:
    command: "npx"
    args: ["-y", "clinical-trial-design"]
// mcp.json
{
  "mcpServers": {
    "wei-ai-lab-clinical-trial-design": {
      "command": "npx",
      "args": [
        "-y",
        "clinical-trial-design"
      ]
    }
  }
}
Changelog

Every change we have recorded for this component, newest first. Security-relevant changes are always shown. ▲ marks a change for the better, ▼ a change for the worse; unmarked changes are neutral.

  • 3 Aug 26 +1

    No change was recorded against any check on this day. Stability & Change Management went from 20 to 23. That category is still filling its 30-day observation window: 6 days of observed history at the previous scan, 7 at this one. The score rises as the window fills, whether or not the server changes.

  • 2 Aug 26 +57
    • Provenance: unverified → fail security
    • Known CVEs: unverified → partial security
    • Install scripts: unverified → pass security
    • Malware scan: unverified → pass security
    • Security disclosure: unverified → fail functional
    • Dependency health: unverified → partial functional
    • Stability: unverified → 0.20 functional
    • Maintenance: unverified → pass functional
    • MCP protocol: unverified → pass functional
    • Schema quality: unverified → good functional
    • License: unverified → pass functional
    • Tool coverage: unverified → 100 functional
    • Licence: Apache-2.0 functional
  • 1 Aug 26 0
    • Security disclosure: fail → unverified functional
  • 31 Jul 26 −35
    • We updated how we score, so this day's move reflects our rubric, not a change to the server See what changed → functional
  • 27 Jul 26 40

    First indexed and scored.

Diagnostics

Diagnostic detail from the automated scan of this channel: what the scanner observed at each step, so you can see exactly where a check passed or failed. It is informational only and never changes the trust score.

Captured 3 Aug 2026 · Analysed npm/[email protected]

Provenance none

Ecosystem: npm · Outcome: none

Dependencies 95 packages

95 packages in the resolved dependency tree · 95 deprecated · 29 stale.

The dependency tree was only partially resolved, so these counts may be incomplete.

MCP tools — 9 exposed · ~4,977 tokens

The tools this component advertises to a client, with an estimated token cost for each. Expand a tool to see its parameters and schema. The per-tool counts are indicative and are not scored directly; the schema's total context footprint is one signal in Schema Quality & AI Usability.

Tool Tokens
design_binary ~868

Use when the user wants two-arm Phase 2/3 sample size with a BINARY primary endpoint — responder rate, fixed-time mortality, ORR, ACR20, remission/cure, anything that resolves to event-or-no-event per subject. Set comparison='superiority' (default), 'non-inferiority' (then provide ni_margin), or 'equivalence' (then provide equiv_margin; fixed-sample only). Set design_class='group-sequential' for interim analyses with alpha-spending. Supply an optional `operational` block (any 0–4 of accrual_rate, accrual_duration, follow_up_duration, total_trial_duration) and the kernel fills in the rest. For two or more co-primary binary endpoints with multiplicity control, use design_co_primary instead.

NameTypeReqDescription
allocation_rationumberTreatment / control allocation ratio. 1 = balanced 1:1.
alphanumberType I error rate. For a standard two-sided 0.05 test use 0.025 with sided = 2.
comparisonstringHypothesis type. 'superiority' (default) tests for a difference; 'non-inferiority' requires ni_margin; 'equivalence' requires equiv_margin.
design_classstringDesign class. 'fixed' = single final analysis; 'group-sequential' = interim looks with alpha-spending. Group-sequential params (k, timing, sfu/sfl, test_type) are ignored when design_class = 'fixed'.
equiv_marginnumberTwo-sided equivalence margin (TOST). Required when comparison='equivalence'. Fixed-sample only.
kintegerNumber of planned analyses including the final one. Integer in [2, 10].
ni_marginnumberNon-inferiority margin on the risk-difference scale. Required when comparison='non-inferiority'.
operationalobjectOptional operational kernel inputs. Supply any 0-4 of {accrual_rate, accrual_duration, follow_up_duration, total_trial_duration}; the solver fills in the missing values from rate*duration = N and A +…
p_controlnumberyesEvent rate in the control arm (0,1).
p_treatmentnumberyesEvent rate in the treatment arm (0,1).
powernumber1 - beta. Targeted power of the test (default 0.9).
sflAlpha-spending function. OF = O'Brien-Fleming, Pocock = Pocock, HSD = Hwang-Shih-DeCani (needs sfupar), Power = power family (needs sfupar), LDOF / LDPocock = Lan-DeMets approximations (the standard)…
sflparnumberNumeric parameter for HSD / Power lower sf.
sfustringAlpha-spending function. OF = O'Brien-Fleming, Pocock = Pocock, HSD = Hwang-Shih-DeCani (needs sfupar), Power = power family (needs sfupar), LDOF / LDPocock = Lan-DeMets approximations (the standard)…
sfuparnumberNumeric parameter for HSD / Power upper sf.
sidednumber1 = one-sided test (default), 2 = two-sided. Many modern designs use sided = 1 with alpha = 0.025 to match the two-sided 0.05 convention.
test_typeintegergsDesign test.type. 1 = efficacy-only, 2 = symmetric efficacy+futility, 3 = non-binding futility, 4 = binding futility, 5/6 = same with lower beta-spending.
timingarrayInformation fractions at each analysis, length k, strictly increasing in (0,1], last = 1. Defaults to equal spacing 1/k, 2/k, ..., 1.

No output schema declared.

No examples provided.

design_co_primary ~455

Multi-endpoint co-primary trial design with multiplicity control. Use when a confirmatory trial requires positive results on two or more primary endpoints (oncology PFS+OS, CV death+HHF, etc.). Strategies: fixed-sequence (hierarchical, full alpha per test, the canonical approach for ordered co-primary), alpha-split (partition alpha by weights), bonferroni (equal alpha-split). Each endpoint is sized at its effective alpha via the matching design_<type> wrapper; total N is the max across endpoints. For graphical multiplicity (Maurer-Bretz with alpha recycling), use `design_graphical_multiplicity` instead.

NameTypeReqDescription
allocation_rationumberTreatment-to-control allocation ratio, shared across endpoints.
alphanumberFamily-wise type I error (default 0.025, one-sided).
alpha_weightsobjectFor strategy='alpha-split' only. Named numeric vector summing to 1. Default (when omitted with alpha-split): equal weights 1/k.
endpointsobjectyesNamed map of co-primary endpoints. Each entry has `type` plus the parameters the matching design_<type> wrapper accepts (e.g., for survival: model, design_class, control_median, hazard_ratio, accrual…
orderingarrayFor strategy='fixed-sequence' only. Endpoint names in test order. Default: order in which `endpoints` was supplied.
powernumberPer-endpoint power (default 0.80).
reasoning_chainarrayOptional structured citation trail. Each entry: {decision, value, justification, source_type, source_ref?}. design_report() renders this inline; sponsor_confidential entries trigger a redaction promp…
sidednumberSidedness.
strategystringMultiplicity-control strategy. `fixed-sequence` (hierarchical) tests each endpoint at the full family alpha conditional on prior rejection — preserves alpha by closed testing, no per-test discount. `…

No output schema declared.

No examples provided.

design_continuous ~821

Use when the user wants two-arm Phase 2/3 sample size with a CONTINUOUS primary endpoint — change from baseline in a measured score (HAM-D-17, PANSS, HbA1c reduction, eGFR slope, BP), QoL scale, biomarker level. Provide mean_diff (assumed treatment - control mean) and the common within-arm sd. Set comparison='superiority' (default), 'non-inferiority' (provide ni_margin), or 'equivalence' (provide equiv_margin; fixed-sample only). Set design_class='group-sequential' for interim analyses with alpha-spending. Supports the same `operational` block as design_binary and design_survival. For multi-endpoint designs, use design_co_primary.

NameTypeReqDescription
allocation_rationumberTreatment / control allocation ratio. 1 = balanced 1:1.
alphanumberType I error rate. For a standard two-sided 0.05 test use 0.025 with sided = 2.
comparisonstringHypothesis type. 'superiority' (default) tests for a difference; 'non-inferiority' requires ni_margin; 'equivalence' requires equiv_margin.
design_classstringDesign class. 'fixed' = single final analysis; 'group-sequential' = interim looks with alpha-spending. Group-sequential params (k, timing, sfu/sfl, test_type) are ignored when design_class = 'fixed'.
equiv_marginnumberTwo-sided equivalence margin (TOST). Fixed-sample only.
kintegerNumber of planned analyses including the final one. Integer in [2, 10].
mean_diffnumberyesAssumed mean difference (treatment - control).
ni_marginnumberNon-inferiority margin on the mean-difference scale.
operationalobjectOptional operational kernel inputs. Supply any 0-4 of {accrual_rate, accrual_duration, follow_up_duration, total_trial_duration}; the solver fills in the missing values from rate*duration = N and A +…
powernumber1 - beta. Targeted power of the test (default 0.9).
sdnumberyesCommon within-arm SD.
sflAlpha-spending function. OF = O'Brien-Fleming, Pocock = Pocock, HSD = Hwang-Shih-DeCani (needs sfupar), Power = power family (needs sfupar), LDOF / LDPocock = Lan-DeMets approximations (the standard)…
sflparnumber
sfustringAlpha-spending function. OF = O'Brien-Fleming, Pocock = Pocock, HSD = Hwang-Shih-DeCani (needs sfupar), Power = power family (needs sfupar), LDOF / LDPocock = Lan-DeMets approximations (the standard)…
sfuparnumber
sidednumber1 = one-sided test (default), 2 = two-sided. Many modern designs use sided = 1 with alpha = 0.025 to match the two-sided 0.05 convention.
test_typeintegergsDesign test.type. 1 = efficacy-only, 2 = symmetric efficacy+futility, 3 = non-binding futility, 4 = binding futility, 5/6 = same with lower beta-spending.
timingarrayInformation fractions at each analysis, length k, strictly increasing in (0,1], last = 1. Defaults to equal spacing 1/k, 2/k, ..., 1.

No output schema declared.

No examples provided.

design_graphical_multiplicity ~478

Graphical multiplicity (Maurer-Bretz) trial design with alpha recycling. Use when a confirmatory trial has 2+ hypotheses (mixed primary + secondary, dose-response, parent + derived endpoints) where a graph-based procedure preserves family-wise alpha better than Bonferroni. Validates the transition matrix (Rule-3 + row sums) and constructs a graphicalMCP graph object. Sizes each hypothesis at its worst-case alpha; total N is the max across hypotheses. For simpler co-primary or multi-population designs use design_co_primary or design_multi_population instead.

NameTypeReqDescription
allocation_rationumber
alphanumber
gate_prereqsobjectOptional per-hypothesis prerequisite map. Each entry is the list of hypothesis names that must be rejected before this one can be tested. Used by the Rule-3 validator: every prerequisite must have a…
hypothesesobjectyesNamed map of hypotheses. Each entry has `type` plus the parameters the matching design_<type> wrapper accepts. Continuous uses `mean_diff`, binary uses `p_treatment`, survival uses `hazard_ratio`.
initial_weightsobjectyesPer-hypothesis initial alpha weights. Names match `hypotheses`; sum to <= 1. Hypotheses with weight 0 start un-testable and become testable only after alpha is recycled to them through the transition…
powernumber
reasoning_chainarrayOptional structured citation trail. Each entry: {decision, value, justification, source_type, source_ref?}. design_report() renders this inline; sponsor_confidential entries trigger a redaction promp…
sidednumber
transition_matrixarrayyesSquare (k x k) transition matrix. Row i column j = weight of alpha re-allocated from hypothesis i to hypothesis j upon rejection of i. Each row sums to <= 1; diagonal must be 0 (no self-loops). Order…
worst_case_weightsobjectOptional override of the per-hypothesis worst-case weight used for sample-size sizing. Default: max(initial_weight_i, fallback) where fallback = smallest non-zero initial weight.

No output schema declared.

No examples provided.

design_multi_population ~477

Multi-population (subgroup) trial design with multiplicity control. Use when a confirmatory trial tests the same endpoint in multiple populations — biomarker-positive subgroup + ITT, nested PD-L1 strata, etc. Pick relation='nested' (the canonical case: TPS≥50 ⊂ TPS≥20 ⊂ ITT, all patients enroll into the broadest, total N driven by largest implied-enrolled across strata) or 'disjoint' (strata enrolled separately, total N = sum). Strategies: fixed-sequence (hierarchical), alpha-split, bonferroni. For graphical multiplicity (Maurer-Bretz with alpha recycling between populations), use design_graphical_multiplicity.

NameTypeReqDescription
allocation_rationumber
alphanumber
alpha_weightsobjectFor strategy='alpha-split' only. Names match `populations`; sum to 1.
endpoint_argsobjectyesShared endpoint design parameters (e.g., for survival: model, design_class, control_median, accrual_duration, followup_duration, dropout_rate). The effect parameter (hazard_ratio / p_treatment / delt…
endpoint_typestringyesEndpoint family — selects which design_<type> wrapper handles each population.
orderingarrayFor strategy='fixed-sequence' only. Population names in test order.
populationsobjectyesNamed map of populations. Each entry has `effect` (and `prevalence` for nested mode).
powernumber
reasoning_chainarrayOptional structured citation trail. Each entry: {decision, value, justification, source_type, source_ref?}. design_report() renders this inline; sponsor_confidential entries trigger a redaction promp…
relationstringHow populations relate. `nested` (default): subgroups overlap, all patients enroll into the broadest, total N = max of implied-enrolled-N. `disjoint`: separate strata enrolled, total N = sum of per-p…
sidednumber
strategystringMultiplicity-control strategy across populations. `fixed-sequence` is the canonical biomarker pattern (test strongest-effect subgroup first, gate broader strata on rejection).

No output schema declared.

No examples provided.

design_report ~261

Render a clinician-readable design summary in markdown, Word, or PDF. Reasoning chain (when populated on the result) appears as a table; sponsor_confidential entries trigger a redaction warning at the top. Sections: title, design overview, key inputs, headline output, GS analysis plan, reasoning chain, method + version. Default output is markdown text; format='docx' returns a native Word file path (officer); format='pdf' renders via rmarkdown + Pandoc.

NameTypeReqDescription
formatstringOutput format. 'markdown' (default) returns the report as text. 'docx' writes a native Word document via the officer R package; 'pdf' renders via rmarkdown + Pandoc (requires Pandoc + a TeX engine on…
pathstringFor format='docx' or 'pdf': output file path. If omitted, a tempfile is created and its path returned in the result.
resultobjectyesA designr result object as returned by any design_* tool (the JSON payload, including $method, $inputs, and (for GS) $boundaries / $timing).

No output schema declared.

No examples provided.

design_survival ~1,277

Use when the user wants Phase 2/3 sample size with a TIME-TO-EVENT primary endpoint — overall survival, PFS, time to first hospitalization, time to progression, time to a CV composite, etc. Choose the test statistic via `model`: 'ph' (default — log-rank under proportional hazards, gsDesign::nSurv / gsSurv), 'maxcombo' (delayed effect / non-proportional hazards via Fleming-Harrington combo), 'rmst' (restricted mean survival to landmark tau), 'milestone' (survival probability at landmark t*), 'wlr' / 'ahr' (weighted log-rank / average HR for GS NPH). Set design_class='group-sequential' for interim analyses with alpha-spending. Always provide control_median + the relevant effect parameter (hazard_ratio for PH; delay_months + post_delay_hr for NPH models). The `operational` block can solve any 0–4 of {accrual_rate, accrual_duration, followup_duration, total_trial_duration} via the events-tied uniroot. For two co-primary TTE endpoints (PFS+OS) use design_co_primary; for nested PD-L1 strata or biomarker subgroup + ITT use design_multi_population.

NameTypeReqDescription
accrual_durationnumberAccrual period (months).
accrual_ratenumberEnrollment rate (subjects/month).
allocation_rationumberTreatment / control allocation ratio. 1 = balanced 1:1.
alphanumberType I error rate. For a standard two-sided 0.05 test use 0.025 with sided = 2.
analysis_timesarrayCalendar times of k planned analyses (NPH GS); last = study duration.
bindingbooleanWhether the futility boundary is binding (NPH GS).
comparisonstringHypothesis type. 'superiority' (default) tests for a difference; 'non-inferiority' requires ni_margin; 'equivalence' requires equiv_margin.
control_mediannumberyesControl-arm median survival (months).
delay_monthsnumberDuration of HR=1 period preceding the effect (NPH models).
design_classstringDesign class. 'fixed' = single final analysis; 'group-sequential' = interim looks with alpha-spending. Group-sequential params (k, timing, sfu/sfl, test_type) are ignored when design_class = 'fixed'.
dropout_ratenumberPer-month dropout hazard.
followup_durationnumberMinimum follow-up after last enrollment (months).
gammaarrayFleming-Harrington gamma weights (MaxCombo / WLR).
hazard_rationumberTarget HR (PH only). < 1 favors treatment. For NI with hr_null > 1, the assumed true HR is often 1.
hr_nullnumberNull-hypothesis HR for non-inferiority (typically > 1, e.g. 1.3).
kintegerNumber of planned analyses including the final one. Integer in [2, 10].
modelstringSurvival statistical model. 'ph' = log-rank under proportional hazards (gsDesign::nSurv / gsSurv). 'maxcombo' / 'rmst' / 'milestone' are NPH fixed-sample (gsDesign2::fixed_design_*). 'wlr' / 'ahr' ar…
ni_hrnumberAlias for hr_null.
operationalobjectOptional operational kernel inputs. Supply any 0-4 of {accrual_rate, accrual_duration, follow_up_duration, total_trial_duration}; the solver fills in the missing values from rate*duration = N and A +…
post_delay_hrnumberHR after delay_months (NPH models).
powernumber1 - beta. Targeted power of the test (default 0.9).
reasoning_chainarrayOptional structured citation trail. Each entry: {decision, value, justification, source_type, source_ref?}. design_report() renders this inline; sponsor_confidential entries trigger a redaction promp…
rhoarrayFleming-Harrington rho weights (MaxCombo / WLR).
sflAlpha-spending function. OF = O'Brien-Fleming, Pocock = Pocock, HSD = Hwang-Shih-DeCani (needs sfupar), Power = power family (needs sfupar), LDOF / LDPocock = Lan-DeMets approximations (the standard)…
sflparnumber
sfustringAlpha-spending function. OF = O'Brien-Fleming, Pocock = Pocock, HSD = Hwang-Shih-DeCani (needs sfupar), Power = power family (needs sfupar), LDOF / LDPocock = Lan-DeMets approximations (the standard)…
sfuparnumber
sidednumberTTE designs are one-sided.
taunumberLandmark time for RMST / milestone (months). Defaults to total study duration.
tau_fhFleming-Harrington tau (MaxCombo / WLR).
test_typeintegergsDesign test.type. 1 = efficacy-only, 2 = symmetric efficacy+futility, 3 = non-binding futility, 4 = binding futility, 5/6 = same with lower beta-spending.
timingarrayInformation fractions at each analysis, length k, strictly increasing in (0,1], last = 1. Defaults to equal spacing 1/k, 2/k, ..., 1.

No output schema declared.

No examples provided.

validate_against_benchmark ~124

Load a benchmark corpus case, re-run the matching design wrapper with its inputs, and diff computed sample_size_total / events_total against expected within the case's tolerance.

NameTypeReqDescription
familystringyesBenchmark family directory name under benchmarks/ (e.g. 'fixed-superiority', 'group-sequential', 'tte-nph').
idstringyesCase ID = YAML filename without extension, e.g. '1997_CAPTURE_abciximab'.
toolstringOverride the design tool to dispatch. If omitted, inferred from case metadata.

No output schema declared.

No examples provided.

verify_design ~216

Monte Carlo simulation cross-check for a designr result. Closed-form simulation (rbinom / rnorm / rexp) drives empirical power and Type I error estimates against the design's target alpha and power. Supports fixed and group-sequential families on binary, continuous, and PH survival endpoints. NPH families (MaxCombo, RMST, milestone) and equivalence designs are not yet supported and return a clean error.

NameTypeReqDescription
n_simintegerMonte Carlo replicate count. Default 5000.
resultobjectyesA designr result object as returned by any design_* tool (the JSON payload, including $method, $inputs, and (for GS) $boundaries / $timing).
seedintegerRNG seed for reproducibility. Default 1.
tolerance_power_ppnumberAllowed deviation from target power, in percentage points. Default 2.
tolerance_type_I_ppnumberAllowed deviation from target alpha, in percentage points. Default 0.5.

No output schema declared.

No examples provided.