Clinical Trial Design logo

Clinical Trial Design

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

Install Clinical Trial Design

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "clinical-trial-design": {
      "command": "npx",
      "args": [
        "-y",
        "clinical-trial-design@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 9 tools correctly (4d ago).

Overview

Tools9

What Clinical Trial Design lets your agent do. Expand a tool for its parameters.

Verified live~9.2k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

9/9 checks healthy over the last 57d

What it can do

From the 9 tools this server returned when we ran it.

Read-only tools · 9
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age187 days
Maintainers1

Observed 2026-10-30 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 5d ago via OSV.dev · clinical-trial-design@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
npm downloads144Package downloads in the last 30 days.
Last commit6mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed9Callable tools this server registers over MCP.

From the project README

clinical-trial-design

A Claude Code plugin and MCP server for end-to-end clinical trial design.

clinical-trial-design helps biostatisticians and clinical trialists design Phase 2 and Phase 3 confirmatory studies through a conversational interface, backed by validated R packages (gsDesign, gsDesign2, graphicalMCP).

v0.0.13 — pre-beta. Nine MCP tools across single-primary endpoint design (binary, continuous, time-to-event under PH and four NPH frameworks), multi-hypothesis design (co-primary, multi-population, graphical multiplicity / Maurer-Bretz), Monte-Carlo verification, and Word/PDF reporting. Reasoning-chain schema with sponsor-confidential redaction. Operational kernel solves accrual ↔ duration ↔ N, plus optional max_n / max_duration feasibility warnings. 288/288 R tests, 18/18 MCP smoke. Published to npm (clinical-trial-design) and the official MCP registry (io.github.wei-ai-lab/clinical-trial-design). Full change history in CHANGELOG.md; API contract in API_STABILITY.md.

What it is

clinical-trial-design has four layers:

LayerRole
R package (r-package/ClinicalTrialDesign)Pure R statistical computation engine. Wraps and extends established packages (gsDesign, gsDesign2, graphicalMCP, simtrial) behind a unified result schema.
MCP server (mcp-server/)Exposes the R functions as typed tools over the Model Context Protocol so Claude Code — or any MCP client — can call them.
Skill (skills/clinical-trial-design/)Domain-expert prompt. Translates a user's design brief into the right tool calls and interprets results in clinical-trial terms; includes a 9-step Phase 3 orchestration workflow with waypoints.
Benchmark corpus (benchmarks/)176 curated public-trial designs across 21 family directories. Each case is human-readable Markdown plus machine-readable YAML with expected outputs and tolerances.

Plus an eval harness under eval/ (11 reproducible scenarios × six scoring dimensions × multi-vendor Claude family) and an examples gallery under examples/ (5 published trials reproduced end-to-end).

What clinical-trial-design actually computes

FamilyStatus
Fixed-sample binary✅ super / NI / equivalence
Fixed-sample continuous✅ super / NI / equivalence
Fixed-sample TTE — PH log-rank✅ super / NI
Fixed-sample TTE — NPH MaxCombo / RMST / milestone✅ superiority
Group-sequential binary / continuous✅ super / NI; futility via test.type
Group-sequential TTE — PH✅ super / NI; events via Schoenfeld + OBF inflation by default (regulatory-defensible; events_calc selector)
Group-sequential TTE — NPH (MaxCombo / WLR / AHR)✅ superiority
Multi-hypothesis — co-primary endpoints✅ fixed-sequence / alpha-split / Bonferroni
Multi-hypothesis — multi-population (subgroup + ITT)✅ nested or disjoint relations
Multi-hypothesis — graphical (Maurer-Bretz)✅ initial weights + transition matrix + Rule-3 validator
Adaptive (SSR, enrichment, selection)⏳ corpus has cases; wrappers are roadmap
MAMS / platform / basket / umbrella⏳ corpus has cases; wrappers are roadmap

Status

LayerState
R package✅ 288/288 testthat
MCP server✅ 9 tools over stdio, esbuild bundle, 18/18 smoke
Skill✅ 9-step Phase 3 orchestration workflow + waypoints
Benchmark corpus✅ 176 curated public-trial cases / 21 families
Plugin manifest✅ .claude-plugin/plugin.json + marketplace.json
npm package✅ clinical-trial-design@0.0.13 published 2026-04-29
Official MCP registry✅ io.github.wei-ai-lab/clinical-trial-design
CI release-gate✅ .github/workflows/release-gate.yml (R tests + R CMD check + MCP build/smoke + scenario validation)
LLM benchmark harness✅ 11 scenarios × 6-dimension rubric (eval/)
Pre-beta hand-off✅ items tracked in BETA_HANDOFF.md

Tool surface

Nine MCP tools — three single-primary design tools, three multi-hypothesis design tools, three meta tools. Same unified result schema across families.

Single-primary design tools (3)

ToolEndpointSelectorsR backend
design_binaryevent / no-eventdesign_class ∈ {"fixed", "group-sequential"}gsDesign::nBinomial, gsDesign::gsDesign
design_continuousmean differencedesign_class ∈ {"fixed", "group-sequential"}gsDesign::nNormal, gsDesign::gsDesign
design_survivaltime-to-eventdesign_class × model ∈ {"ph", "maxcombo", "rmst", "milestone", "wlr", "ahr"}gsDesign::nSurv/gsSurv (PH); gsDesign2::fixed_design_* and gs_design_* (NPH)

All three accept comparison ∈ {"superiority", "non-inferiority", "equivalence"} (equivalence on fixed-sample binary / continuous only), alpha, power, sided, allocation_ratio, GS parameters (k, timing, sfu, sfl, test.type), an optional operational block, and an optional reasoning_chain array (citation trail with source_type tags).

design_survival adds events_calc ∈ {"schoenfeld" (default), "lachin-foulkes", "freedman"} for PH GS designs and accepts control_hazard_rate (events per patient-year) as an alternative to control_median.

Multi-hypothesis design tools (3)

ToolWhen to useStrategiesR backend
design_co_primaryTwo or more co-primary endpoints (PFS+OS, CV death+HHF, mixed binary+continuous)fixed-sequence (hierarchical, default), alpha-split (weighted), bonferroniPer-endpoint dispatch to single-primary tools at the appropriate effective alpha; total N = max across endpoints
design_multi_populationSame endpoint tested across multiple populations (biomarker subgroup + ITT, nested PD-L1 strata)Same three strategies; relation ∈ {"nested", "disjoint"}Same per-population dispatch; for nested, total N driven by largest implied-enrolled-N (events / prevalence); for disjoint, total N is the sum
design_graphical_multiplicityMulti-hypothesis with alpha recycling (Maurer-Bretz) — mixed primary+secondary, dose-responseGraphical procedure with user-supplied initial weights and transition matrix; built-in Rule-3 validatorgraphicalMCP::graph_create; per-hypothesis sample-size at worst-case alpha

Meta tools (3)

ToolPurpose
validate_against_benchmarkReplay a benchmark case through its matching design tool and diff against expected values within tolerance.
verify_designMonte Carlo cross-check of any result. Closed-form simulation under H0 and H1; ±2 pp power / ±0.5 pp Type I tolerance gate. Supports fixed and GS designs on binary, continuous, and PH-survival endpoints.
design_reportRender a clinician-readable design summary in markdown (default), Word (format="docx" via officer), or PDF (format="pdf" via rmarkdown + Pandoc). Reasoning chain rendered as a Word table; sponsor-confidential entries surface a redaction warning at the top of the document.

Operational kernel

Every endpoint design tool accepts an operational block that solves the simple relations accrual_rate × accrual_duration = sample_size_total and total_trial_duration = accrual_duration + follow_up_duration (plus target_events = sample_size_total × cumulative_event_rate(...) for survival, via uniroot over the closed-form pooled exponential-PH event probability — same kernel gsDesign::nSurv uses internally).

Supply any 0–4 of {accrual_rate, accrual_duration, follow_up_duration, total_trial_duration} plus optional caps {max_n, max_duration}. The solver fills in the missing values with an audit trail (given, derived); cap violations surface as structured feasibility_warnings rather than silent over-cap designs.

Quick start

Prerequisites: R ≥ 4.2, Node ≥ 18. No npm install step (the MCP server ships pre-bundled in mcp-server/dist/index.js) and no remotes::install_local step (the launcher sources r-package/ClinicalTrialDesign/R/*.R directly out of the plugin cache).

1. Install CRAN dependencies (one-time)

bash
R -e 'install.packages(c("gsDesign","gsDesign2","graphicalMCP","jsonlite","officer","rmarkdown"))'

The first four are runtime imports; officer and rmarkdown are Suggests: and only needed for design_report(format="docx") / format="pdf".

Tested dependency versions

clinical-trial-design v0.0.13 was developed and tested against the versions below. CRAN's latest is usually fine; pin to these floors only if you hit a version-skew issue.

LayerDependencyTested version
R runtimeR4.5.3 (works on R ≥ 4.2)
R importsgsDesign3.9.0
gsDesign21.1.8
graphicalMCP0.2.9
jsonlite2.0.0
R suggestsofficer0.6.x (for design_report(format="docx"))
rmarkdown2.20+ (for design_report(format="pdf"); Pandoc system dep)
simtrial1.0.2 (for verify_design Monte Carlo)
rpact4.4.0
yaml2.3.12
testthat3.3.2
Node runtimeNode22.22.1 (works on Node ≥ 18)
Node bundled@modelcontextprotocol/sdk^1.0.0 (inlined in dist/index.js)
zod^3.23.0 (inlined)

2. Install the plugin

Method A — slash commands (recommended, inside Claude Code)

text
/plugin marketplace add wei-ai-lab/clinical-trial-design
/plugin install clinical-trial-design@wei-ai-lab

After install, restart Claude Code so it loads the bundled MCP server. Confirm with /plugin (clinical-trial-design should be listed and enabled at version 0.0.13).

Method B — host shell (equivalent, scriptable)

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Clinical Trial Design

clinical-trial-design is an MCP server that helps biostatisticians and clinical trialists design Phase 2 and Phase 3 confirmatory studies through typed tools backed by gsDesign, gsDesign2, and graphicalMCP. It computes sample sizes, group-sequential boundaries, time-to-event designs, multiplicity strategies, Monte Carlo verification, and Word/PDF reports.

It supports fixed-sample and group-sequential designs for binary, continuous, and time-to-event endpoints. Supported time-to-event approaches include proportional-hazards log-rank designs, nonproportional-hazards MaxCombo, weighted log-rank, average-hazard-ratio, RMST, and milestone methods.

Yes, it supports co-primary endpoints, multi-population designs, and graphical multiplicity using Maurer-Bretz methods. Available approaches include fixed-sequence, alpha-split, Bonferroni, nested or disjoint population relationships, initial weights, transition matrices, and Rule-3 validation.

No, adaptive sample-size re-estimation, enrichment, selection, MAMS, platform, basket, and umbrella designs are listed as roadmap areas rather than implemented wrappers. The project is currently pre-beta, while its documented supported design families include fixed-sample, group-sequential, and multi-hypothesis designs.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewClinical Trial Design AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/clinical-trial-design?style=directory)](https://allmcps.com/mcp/clinical-trial-design)
HTML Embed
<a href="https://allmcps.com/mcp/clinical-trial-design"><img src="https://allmcps.com/api/badge/clinical-trial-design?style=directory" alt="Clinical Trial Design on AllMCPs" /></a>