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
Available components
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
- Source repository is publicly reachable at the declared URL. View diagnostics → Pass
- Provenance check failed: no build-provenance attestation is published. See how to fix → View diagnostics → Fail
- Clear OSI-approved license (Apache-2.0).Pass
- Actively maintained (last published 91 days ago).Pass
- Disclosure check failed: no security disclosure policy was found in the source repository. See how to fix → Fail
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
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
claude mcp add wei-ai-lab-clinical-trial-design -- npx -y clinical-trial-design
codex mcp add wei-ai-lab-clinical-trial-design -- npx -y clinical-trial-design
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"wei-ai-lab-clinical-trial-design": {
"type": "local",
"command": [
"npx",
"-y",
"clinical-trial-design"
],
"enabled": true
}
}
} openclaw mcp add wei-ai-lab-clinical-trial-design --command npx --arg -y --arg clinical-trial-design
mcp_servers:
wei-ai-lab-clinical-trial-design:
command: "npx"
args: ["-y", "clinical-trial-design"] {
"mcpServers": {
"wei-ai-lab-clinical-trial-design": {
"command": "npx",
"args": [
"-y",
"clinical-trial-design"
]
}
}
} 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.
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.
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.
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.
| Name | Type | Req | Description |
|---|---|---|---|
| allocation_ratio | number | — | Treatment / control allocation ratio. 1 = balanced 1:1. |
| alpha | number | — | Type I error rate. For a standard two-sided 0.05 test use 0.025 with sided = 2. |
| comparison | string | — | Hypothesis type. 'superiority' (default) tests for a difference; 'non-inferiority' requires ni_margin; 'equivalence' requires equiv_margin. |
| design_class | string | — | Design 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_margin | number | — | Two-sided equivalence margin (TOST). Required when comparison='equivalence'. Fixed-sample only. |
| k | integer | — | Number of planned analyses including the final one. Integer in [2, 10]. |
| ni_margin | number | — | Non-inferiority margin on the risk-difference scale. Required when comparison='non-inferiority'. |
| operational | object | — | Optional 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_control | number | yes | Event rate in the control arm (0,1). |
| p_treatment | number | yes | Event rate in the treatment arm (0,1). |
| power | number | — | 1 - beta. Targeted power of the test (default 0.9). |
| sfl | — | — | Alpha-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)… |
| sflpar | number | — | Numeric parameter for HSD / Power lower sf. |
| sfu | string | — | Alpha-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)… |
| sfupar | number | — | Numeric parameter for HSD / Power upper sf. |
| sided | number | — | 1 = 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_type | integer | — | gsDesign test.type. 1 = efficacy-only, 2 = symmetric efficacy+futility, 3 = non-binding futility, 4 = binding futility, 5/6 = same with lower beta-spending. |
| timing | array | — | Information 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.
| Name | Type | Req | Description |
|---|---|---|---|
| allocation_ratio | number | — | Treatment-to-control allocation ratio, shared across endpoints. |
| alpha | number | — | Family-wise type I error (default 0.025, one-sided). |
| alpha_weights | object | — | For strategy='alpha-split' only. Named numeric vector summing to 1. Default (when omitted with alpha-split): equal weights 1/k. |
| endpoints | object | yes | Named 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… |
| ordering | array | — | For strategy='fixed-sequence' only. Endpoint names in test order. Default: order in which `endpoints` was supplied. |
| power | number | — | Per-endpoint power (default 0.80). |
| reasoning_chain | array | — | Optional structured citation trail. Each entry: {decision, value, justification, source_type, source_ref?}. design_report() renders this inline; sponsor_confidential entries trigger a redaction promp… |
| sided | number | — | Sidedness. |
| strategy | string | — | Multiplicity-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.
| Name | Type | Req | Description |
|---|---|---|---|
| allocation_ratio | number | — | Treatment / control allocation ratio. 1 = balanced 1:1. |
| alpha | number | — | Type I error rate. For a standard two-sided 0.05 test use 0.025 with sided = 2. |
| comparison | string | — | Hypothesis type. 'superiority' (default) tests for a difference; 'non-inferiority' requires ni_margin; 'equivalence' requires equiv_margin. |
| design_class | string | — | Design 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_margin | number | — | Two-sided equivalence margin (TOST). Fixed-sample only. |
| k | integer | — | Number of planned analyses including the final one. Integer in [2, 10]. |
| mean_diff | number | yes | Assumed mean difference (treatment - control). |
| ni_margin | number | — | Non-inferiority margin on the mean-difference scale. |
| operational | object | — | Optional 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 +… |
| power | number | — | 1 - beta. Targeted power of the test (default 0.9). |
| sd | number | yes | Common within-arm SD. |
| sfl | — | — | Alpha-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)… |
| sflpar | number | — | — |
| sfu | string | — | Alpha-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)… |
| sfupar | number | — | — |
| sided | number | — | 1 = 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_type | integer | — | gsDesign test.type. 1 = efficacy-only, 2 = symmetric efficacy+futility, 3 = non-binding futility, 4 = binding futility, 5/6 = same with lower beta-spending. |
| timing | array | — | Information 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.
| Name | Type | Req | Description |
|---|---|---|---|
| allocation_ratio | number | — | — |
| alpha | number | — | — |
| gate_prereqs | object | — | Optional 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… |
| hypotheses | object | yes | Named 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_weights | object | yes | Per-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… |
| power | number | — | — |
| reasoning_chain | array | — | Optional structured citation trail. Each entry: {decision, value, justification, source_type, source_ref?}. design_report() renders this inline; sponsor_confidential entries trigger a redaction promp… |
| sided | number | — | — |
| transition_matrix | array | yes | Square (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_weights | object | — | Optional 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.
| Name | Type | Req | Description |
|---|---|---|---|
| allocation_ratio | number | — | — |
| alpha | number | — | — |
| alpha_weights | object | — | For strategy='alpha-split' only. Names match `populations`; sum to 1. |
| endpoint_args | object | yes | Shared 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_type | string | yes | Endpoint family — selects which design_<type> wrapper handles each population. |
| ordering | array | — | For strategy='fixed-sequence' only. Population names in test order. |
| populations | object | yes | Named map of populations. Each entry has `effect` (and `prevalence` for nested mode). |
| power | number | — | — |
| reasoning_chain | array | — | Optional structured citation trail. Each entry: {decision, value, justification, source_type, source_ref?}. design_report() renders this inline; sponsor_confidential entries trigger a redaction promp… |
| relation | string | — | How 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… |
| sided | number | — | — |
| strategy | string | — | Multiplicity-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.
| Name | Type | Req | Description |
|---|---|---|---|
| format | string | — | Output 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… |
| path | string | — | For format='docx' or 'pdf': output file path. If omitted, a tempfile is created and its path returned in the result. |
| result | object | yes | A 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.
| Name | Type | Req | Description |
|---|---|---|---|
| accrual_duration | number | — | Accrual period (months). |
| accrual_rate | number | — | Enrollment rate (subjects/month). |
| allocation_ratio | number | — | Treatment / control allocation ratio. 1 = balanced 1:1. |
| alpha | number | — | Type I error rate. For a standard two-sided 0.05 test use 0.025 with sided = 2. |
| analysis_times | array | — | Calendar times of k planned analyses (NPH GS); last = study duration. |
| binding | boolean | — | Whether the futility boundary is binding (NPH GS). |
| comparison | string | — | Hypothesis type. 'superiority' (default) tests for a difference; 'non-inferiority' requires ni_margin; 'equivalence' requires equiv_margin. |
| control_median | number | yes | Control-arm median survival (months). |
| delay_months | number | — | Duration of HR=1 period preceding the effect (NPH models). |
| design_class | string | — | Design 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_rate | number | — | Per-month dropout hazard. |
| followup_duration | number | — | Minimum follow-up after last enrollment (months). |
| gamma | array | — | Fleming-Harrington gamma weights (MaxCombo / WLR). |
| hazard_ratio | number | — | Target HR (PH only). < 1 favors treatment. For NI with hr_null > 1, the assumed true HR is often 1. |
| hr_null | number | — | Null-hypothesis HR for non-inferiority (typically > 1, e.g. 1.3). |
| k | integer | — | Number of planned analyses including the final one. Integer in [2, 10]. |
| model | string | — | Survival 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_hr | number | — | Alias for hr_null. |
| operational | object | — | Optional 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_hr | number | — | HR after delay_months (NPH models). |
| power | number | — | 1 - beta. Targeted power of the test (default 0.9). |
| reasoning_chain | array | — | Optional structured citation trail. Each entry: {decision, value, justification, source_type, source_ref?}. design_report() renders this inline; sponsor_confidential entries trigger a redaction promp… |
| rho | array | — | Fleming-Harrington rho weights (MaxCombo / WLR). |
| sfl | — | — | Alpha-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)… |
| sflpar | number | — | — |
| sfu | string | — | Alpha-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)… |
| sfupar | number | — | — |
| sided | number | — | TTE designs are one-sided. |
| tau | number | — | Landmark time for RMST / milestone (months). Defaults to total study duration. |
| tau_fh | — | — | Fleming-Harrington tau (MaxCombo / WLR). |
| test_type | integer | — | gsDesign test.type. 1 = efficacy-only, 2 = symmetric efficacy+futility, 3 = non-binding futility, 4 = binding futility, 5/6 = same with lower beta-spending. |
| timing | array | — | Information 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.
| Name | Type | Req | Description |
|---|---|---|---|
| family | string | yes | Benchmark family directory name under benchmarks/ (e.g. 'fixed-superiority', 'group-sequential', 'tte-nph'). |
| id | string | yes | Case ID = YAML filename without extension, e.g. '1997_CAPTURE_abciximab'. |
| tool | string | — | Override 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.
| Name | Type | Req | Description |
|---|---|---|---|
| n_sim | integer | — | Monte Carlo replicate count. Default 5000. |
| result | object | yes | A designr result object as returned by any design_* tool (the JSON payload, including $method, $inputs, and (for GS) $boundaries / $timing). |
| seed | integer | — | RNG seed for reproducibility. Default 1. |
| tolerance_power_pp | number | — | Allowed deviation from target power, in percentage points. Default 2. |
| tolerance_type_I_pp | number | — | Allowed deviation from target alpha, in percentage points. Default 0.5. |
No output schema declared.
No examples provided.