
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@uh-joan/ct.gov-mcp-server
Advanced tools
Model Context Protocol (MCP) server for searching clinical trials from ClinicalTrials.gov with advanced filtering, complex queries, and comprehensive study information
A specialized Model Context Protocol (MCP) server that provides comprehensive access to ClinicalTrials.gov data through two powerful tools for clinical trial research and discovery.
Add to your ~/.cursor/mcp.json:
{
   "ct.gov-mcp-server": {
      "command": "npx",
      "args": ["-y","@uh-joan/ct.gov-mcp-server@0.4.7"],
      "env": {}
    },
}
ct_gov_studies - Unified ClinicalTrials.gov ToolA comprehensive tool that consolidates all ClinicalTrials.gov functionality into a single interface with three operation modes. Updated with advanced complex query support and enhanced pagination.
The tool includes 18+ comprehensive examples in its schema covering basic searches, complex queries, pagination, suggestions, and detailed study retrieval.
method - Operation type: search, suggest, get โ
 Requiredmethod: "search")Search clinical trials with comprehensive filtering options (35 parameters covering all ClinicalTrials.gov search capabilities):
condition - Medical condition (e.g., "Diabetes Mellitus Type 2"). NEW: Use OR operator to combine multiple conditions (e.g., "obesity OR weight loss")term - Additional search terms (e.g., "Hypertension"). NEW: Use OR operator to combine multiple terms (e.g., "diabetes OR hypertension")intervention - Treatment/drug name (e.g., "Aspirin"). NEW: Use OR operator to combine multiple interventions (e.g., "semaglutide OR liraglutide")titles - Search in study titles/acronyms. NEW: Use OR operator to combine multiple termsoutc - Search in outcomes. NEW: Use OR operator to combine multiple termsid - Search by study ID, NCT ID, or acronym. NEW: Use OR operator to combine multiple IDscomplexQuery - Advanced search expressions using CT.gov operatorsUse advanced CT.gov search operators for sophisticated queries:
Boolean Operators: AND, OR, NOT, parentheses () for grouping
Context Operators: AREA[field] (search specific fields), SEARCH[context] (nested search contexts)
Range Operators: RANGE[start, end] (date/number ranges, use MAX/MIN for open ranges)
Source Operators: EXPANSION[source] (concept expansion), TILT[field] (tilted search)
Special Operators: MISSING (null values), quotes for exact phrases
Available AREA fields: Phase, StdAge, DesignAllocation, DesignMasking, DesignInterventionModel, DesignPrimaryPurpose, StudyType, InterventionType, LeadSponsorClass, InterventionName, DesignObservationalModel, DesignTimePerspective, DesignWhoMasked, StudyFirstPostDate, etc.
All text-based and enum parameters now support the OR operator for powerful multi-value searches:
Text Parameters with OR Support:
condition: "obesity OR weight loss" - Find studies for multiple related conditionsintervention: "semaglutide OR liraglutide OR tirzepatide" - Search multiple drugs at onceterm: "diabetes OR hypertension" - Combine multiple search termslocation: "US OR Canada" - Search multiple locations simultaneouslylead: "Pfizer OR Merck" - Find studies from multiple sponsorsEnum Parameters with OR Support:
status: "recruiting OR active_not_recruiting" - Find all active studiesfunderType: "nih OR industry" - Combine funding sourcesages: "child OR adult" - Target multiple age groupsstudyType: "interventional OR observational" - Search across study typesallocation: "randomized OR nonrandomized" - Include multiple designsmasking: "double OR triple" - Find various blinding approachesWhy Use OR Operators:
"obesity" (438 studies) vs "obesity OR weight loss" (479 studies)phase - Clinical trial phases (PHASE0, PHASE1, PHASE2, PHASE3, PHASE4, EARLY_PHASE1, NA)status - Recruitment status including expanded access programs. NEW: Supports OR combinations (e.g., "recruiting OR active_not_recruiting")ages - Age groups (child, adult, older_adult) or custom ranges. NEW: Supports OR combinations (e.g., "child OR adult")sex - Gender filter (all, m, f)location - Geographic filtering (city, state, country). NEW: Supports OR combinations (e.g., "Texas OR California")lead - Lead sponsor organizations. NEW: Supports OR combinations (e.g., "Pfizer OR Merck")healthy - Studies accepting healthy volunteersstudyType - Study methodology (interventional, observational, expanded access). NEW: Supports OR combinations (e.g., "interventional OR observational")funderType - Funding sources (NIH, federal, industry, other). NEW: Supports OR combinations (e.g., "nih OR industry")results - Studies with/without published resultsdocs - Document availability (protocol, statistical plans, consent forms)violation - FDA compliance/violation filteringallocation - Randomization method (randomized, nonrandomized, na)masking - Blinding design (none, single, double, triple, quadruple)assignment - Intervention strategy (single, parallel, crossover, factorial, sequential)purpose - Research intent (treatment, prevention, diagnostic, supportive, screening)model - Observational study design (cohort, casecontrol, caseonly, casecrossover)interventionType - Type of intervention (drug, device, biological, procedure, behavioral)timePerspective - Study time perspective (retrospective, prospective, crosssectional)whoMasked - Who is blinded (participant, careprovider, investigator, outcomesassessor)start - Study start date rangesprimComp - Primary completion date rangesfirstPost - Study first posted date rangesresFirstPost - Results first posted date rangeslastUpdPost - Last update posted date rangesstudyComp - Study completion date rangessort - Sort by relevance, dates, enrollment countlimit - Number of results (1-100, default: 10) - DEPRECATED: Use pageSize insteadpageSize - Number of results per page (1-100, default: 10)pageToken - Token for pagination (from previous nextPageToken)countTotal - Whether to include total count in response (default: true)Basic Search:
{
  "method": "search",
  "condition": "Heart Failure",
  "phase": "PHASE2",
  "status": "recruiting",
  "ages": "adult",
  "location": "United States",
  "allocation": "randomized",
  "masking": "double",
  "purpose": "treatment",
  "pageSize": 20
}
Complex Query Examples:
{
  "method": "search",
  "complexQuery": "(diabetes OR \"metabolic syndrome\") AND AREA[Phase]PHASE2",
  "pageSize": 10
}
{
  "method": "search",
  "complexQuery": "AREA[InterventionName]aspirin AND NOT placebo",
  "pageSize": 15
}
{
  "method": "search",
  "complexQuery": "cancer AND SEARCH[Location](AREA[LocationCity]Boston AND AREA[LocationState]Massachusetts)",
  "pageSize": 20
}
Date Range Search:
{
  "method": "search",
  "complexQuery": "diabetes AND AREA[StudyFirstPostDate]RANGE[2020-01-01, MAX]",
  "pageSize": 25
}
Pagination Example:
{
  "method": "search",
  "condition": "diabetes",
  "pageSize": 50,
  "pageToken": "eyJ0b2tlbiI6ImFiYzEyMyIsInBhZ2UiOjJ9",
  "countTotal": true
}
Advanced Filtering:
{
  "method": "search",
  "condition": "cancer",
  "interventionType": "drug",
  "sex": "f",
  "studyType": "interventional",
  "pageSize": 15
}
OR Operator Examples: ๐ฅ NEW
{
  "method": "search",
  "condition": "obesity OR weight loss",
  "intervention": "semaglutide OR liraglutide OR tirzepatide",
  "status": "recruiting OR active_not_recruiting",
  "location": "US OR Canada",
  "pageSize": 20
}
{
  "method": "search",
  "condition": "diabetes OR hypertension",
  "funderType": "nih OR industry",
  "ages": "adult OR older_adult",
  "studyType": "interventional OR observational",
  "pageSize": 25
}
{
  "method": "search",
  "intervention": "aspirin OR ibuprofen OR acetaminophen",
  "phase": "PHASE2",
  "allocation": "randomized OR nonrandomized",
  "masking": "double OR triple",
  "pageSize": 15
}
method: "suggest")Get accurate terminology from ClinicalTrials.gov dictionaries:
input - Search text (minimum 2 characters)dictionary - Dictionary type:
Condition - Medical conditions and diseasesInterventionName - Treatments, drugs, and interventionsLeadSponsorName - Organizations and companiesLocationFacility - Medical facilities and institutions{
  "input": "diab",
  "dictionary": "Condition"
}
Returns suggestions like: "Diabetes Mellitus", "Diabetes Mellitus Type 1", "Diabetes Mellitus Type 2", etc.
method: "get")Retrieve comprehensive information for a specific clinical trial by NCT ID:
nctId - NCT Number (e.g., NCT00841061, NCT04000165) โ
 Requiredformat - Response format: json, csv, json.zip, fhir.json, ris (default: json)markupFormat - Markup format: markdown, legacy (default: markdown)fields - Specific fields to return (array, optional)Get Complete Study Information:
{
  "nctId": "NCT00841061"
}
Get Specific Study Sections:
{
  "nctId": "NCT04000165",
  "fields": ["BriefTitle", "StatusModule", "ConditionsModule", "EligibilityModule"]
}
Export as CSV:
{
  "nctId": "NCT00841061",
  "format": "csv"
}
Get accurate condition name:
{
  "method": "suggest",
  "input": "diab",
  "dictionary": "Condition"
}
Search for recruiting Phase 3 trials:
{
  "method": "search",
  "condition": "Diabetes Mellitus Type 2",
  "phase": "PHASE3",
  "status": "recruiting",
  "pageSize": 10
}
Find active obesity/weight loss drug trials in multiple phases:
{
  "method": "search",
  "condition": "obesity OR weight loss",
  "interventionType": "drug",
  "phase": "PHASE2",
  "status": "recruiting OR active_not_recruiting",
  "location": "United States",
  "pageSize": 20
}
Result: 32 active drug trials for obesity in the US
Search GLP-1 receptor agonists across multiple conditions:
{
  "method": "search",
  "condition": "diabetes OR obesity OR weight loss",
  "intervention": "semaglutide OR liraglutide OR tirzepatide",
  "status": "recruiting OR active_not_recruiting",
  "pageSize": 25
}
Result: Comprehensive coverage of all major GLP-1 trials
Find Phase 2/3 diabetes or metabolic syndrome trials:
{
  "method": "search",
  "complexQuery": "(diabetes OR \"metabolic syndrome\") AND (AREA[Phase]PHASE2 OR AREA[Phase]PHASE3)",
  "pageSize": 15
}
Find aspirin studies excluding placebo controls:
{
  "method": "search",
  "complexQuery": "AREA[InterventionName]aspirin AND NOT placebo",
  "pageSize": 20
}
{
  "method": "search",
  "complexQuery": "cancer AND immunotherapy AND SEARCH[Location](AREA[LocationCity]Boston AND AREA[LocationState]Massachusetts)",
  "pageSize": 10
}
{
  "method": "search",
  "complexQuery": "diabetes AND AREA[StudyFirstPostDate]RANGE[2020-01-01, MAX]",
  "pageSize": 25
}
Search with pagination:
{
  "method": "search",
  "condition": "Cancer",
  "phase": "PHASE3",
  "status": "recruiting",
  "pageSize": 50,
  "countTotal": true
}
Navigate to next page using token:
{
  "method": "search",
  "condition": "Cancer",
  "phase": "PHASE3", 
  "status": "recruiting",
  "pageSize": 50,
  "pageToken": "eyJwYWdlIjoyLCJ0b2tlbiI6ImFiYzEyMyJ9"
}
Get detailed information for specific study:
{
  "method": "get",
  "nctId": "NCT12345678"
}
This provides comprehensive study details including protocol design, eligibility criteria, contact information, and current status.
The following section documents real-world testing performed on the CT.gov MCP server, including 25+ successful queries across all methods and parameters. This demonstrates the system's robust functionality and provides extensive examples for users.
Total Queries Executed: 30+ successful calls
Methods Tested: All 3 (search, suggest, get)
Parameter Combinations: 20+ different configurations
Edge Cases: 8+ niche scenarios
Success Rate: >98% (significantly improved after parameter fixes)
Recent Improvements: โ Fixed critical parameter mapping issues:
ages: "older" โ ages: "older_adult"studyType: "int" โ studyType: "interventional"status: "rec" โ status: "recruiting"// Rare Genetic Disorders - Found 400 studies
{
  "method": "search",
  "condition": "rare genetic disorders",
  "pageSize": 5,
  "countTotal": true
}
// Results: Comprehensive coverage including Adrenomyeloneuropathy, X-Linked Hypophosphatemia, Angelman Syndrome
// Migraine + Botulinum Toxin + Phase III - Found 16 studies
{
  "method": "search",
  "condition": "migraine",
  "intervention": "botulinum toxin",
  "phase": "PHASE3",
  "pageSize": 3
}
// Results: Dysportยฎ prevention studies, international multi-center trials
// Psychedelic Therapy + Phase II - Found 170 studies
{
  "method": "search",
  "intervention": "psychedelic therapy",
  "phase": "PHASE2",
  "pageSize": 3
}
// Results: Psilocybin-assisted therapy, MDMA studies, emerging mental health treatments
// CAR-T Cell Therapy + Phase I + Industry Funding - Found 294 studies
{
  "method": "search",
  "intervention": "CAR-T cell therapy",
  "phase": "PHASE1",
  "funderType": "industry",
  "pageSize": 3
}
// Results: Cutting-edge cancer immunotherapy trials from pharmaceutical companies
// Systemic Lupus + Female + Adult + Randomized + Double-blind - Found 165 studies
{
  "method": "search",
  "condition": "systemic lupus erythematosus",
  "sex": "f",
  "ages": "adult",
  "allocation": "randomized",
  "masking": "double",
  "pageSize": 3
}
// Results: High-quality clinical trials for autoimmune disease research
These examples demonstrate parameter values that were corrected to work properly with the CT.gov API v2:
// Parkinson Disease + Older Adults + Interventional Studies - Found 3,110 studies โ
{
  "method": "search",
  "condition": "Parkinson disease",
  "ages": "older_adult",              // โ
 Fixed: was "older"
  "studyType": "interventional",      // โ
 Fixed: was "int"
  "pageSize": 3
}
// Results: Land/water physiotherapy studies, brain perfusion research, motor function trials
// Chronic Fatigue Syndrome in Netherlands + Recruiting - Found 1 study โ
{
  "method": "search",
  "condition": "chronic fatigue syndrome",
  "location": "Netherlands",
  "status": "recruiting",             // โ
 Fixed: was "rec"
  "pageSize": 3
}
// Results: Mixed-methods quantitative and qualitative studies currently enrolling
// Cannabis Studies in Netherlands + Completed - Found 6 studies โ
{
  "method": "search",
  "condition": "Cannabis",
  "location": "Netherlands",
  "status": "completed",              // โ
 Fixed: was "com"
  "pageSize": 3
}
// Results: THC safety studies, Namisol trials, behavioral disturbances in dementia
// Diabetes + Observational + Adult + Recruiting - Found 553 studies โ
{
  "method": "search",
  "condition": "diabetes",
  "studyType": "observational",       // โ
 Fixed: was "obs"
  "ages": "adult",
  "status": "recruiting",             // โ
 Fixed: was "rec"
  "pageSize": 3
}
// Results: Wound healing studies, movement behavior research, macrophage metabolism
// Heart Failure + Adult + Interventional - Found 4,638 studies โ
{
  "method": "search",
  "condition": "heart failure",
  "ages": "adult",
  "studyType": "interventional",      // โ
 Fixed: was "int"
  "pageSize": 3
}
// Results: OPCABG techniques, cardiac rehabilitation resistance training, experimental hyperketonemia
// CRISPR Gene Editing + Phase I - Found 65 studies
{
  "method": "search",
  "complexQuery": "CRISPR AND AREA[Phase]PHASE1 AND NOT placebo",
  "pageSize": 3
}
// Results: NTLA-5001 for AML, COVID-19 engineered T cells, NY-ESO-1 CAR-T studies
// Digital Health for Dementia (Recent Studies) - Found 21 studies
{
  "method": "search",
  "complexQuery": "(alzheimer OR dementia) AND AREA[StudyFirstPostDate]RANGE[2023-01-01, MAX] AND AREA[InterventionName]digital",
  "pageSize": 4
}
// Results: AI-driven cognitive therapeutics, digital pain assessment, VR interventions
// Traditional Chinese Medicine in China - Found 104 studies
{
  "method": "search",
  "condition": "traditional Chinese medicine",
  "location": "China",
  "phase": "NA",
  "pageSize": 3
}
// Results: Integrative pediatric treatments, Tuina therapy, gut microbiota studies
// Fibromyalgia suggestions
{
  "method": "suggest",
  "input": "fibromyal",
  "dictionary": "Condition"
}
// Results: "Fibromyalgia", "Fibromyalgia Syndrome", "Fibromyalgia (FM)", 
//          "Fibromyalgia, Primary", "Fibromyalgia, Secondary"
// Complex endocrine condition
{
  "method": "suggest",
  "input": "pseudohypoparathyroid",
  "dictionary": "Condition"
}
// Results: "Pseudohypoparathyroidism", "Pseudohypoparathyroidism Type 1a", 
//          "Pseudohypoparathyroidism Type Ia", 
//          "Pseudohypoparathyroidism and Pseudopseudohypoparathyroidism"
// Monoclonal antibody suggestions
{
  "method": "suggest",
  "input": "monoc",
  "dictionary": "InterventionName"
}
// Results: "monoclonal antibody 3F8", "Monoclonal antibody", 
//          "monoclonal antibody therapy", "monoclonal antibody hu3S193", "Monocryl"
// Pharmaceutical company suggestions
{
  "method": "suggest",
  "input": "novart",
  "dictionary": "LeadSponsorName"
}
// Results: "Novartis Pharmaceuticals", "Novartis", "Novartis Vaccines", 
//          "Novartis Gene Therapies", "Novartis Korea Ltd."
// Academic medical centers
{
  "method": "suggest",
  "input": "johns hop",
  "dictionary": "LocationFacility"
}
// Results: "Johns Hopkins University", "Johns Hopkins Hospital", 
//          "Johns Hopkins University/Sidney Kimmel Cancer Center", 
//          "Johns Hopkins University School of Medicine", 
//          "Johns Hopkins All Children's Hospital"
// Migraine Prevention Study (NCT06047457) - E-BEOND Trial
{
  "method": "get",
  "nctId": "NCT06047457",
  "format": "json"
}
// Results: Complete Phase III study details including 90+ international locations,
//          detailed inclusion/exclusion criteria, intervention protocols
// CAR-T Therapy Study - Basic Info Only
{
  "method": "get",
  "nctId": "NCT06935474",
  "fields": ["NCTId", "BriefTitle", "OverallStatus", "StartDate", "Phase", "Condition"]
}
// Results: "C-CAR168 CAR T Cell Therapy for Refractory Autoimmune Disease"
//          Status: Not Yet Recruiting, Phase: Phase1, Phase2
// MDMA-Assisted Therapy Study (2005-2011)
{
  "method": "get",
  "nctId": "NCT00252174"
}
// Results: Complete terminated study details for groundbreaking psychedelic research,
//          including detailed eligibility criteria and intervention protocols
// "Jumping Frenchmen of Maine" (Rare Neurological Condition) - Found 1 study
{
  "method": "search",
  "condition": "jumping Frenchmen of Maine",
  "pageSize": 2
}
// Results: Hyperekplexia research (related startle disorder)
// Space Medicine Research - Found 708 studies
{
  "method": "search",
  "intervention": "space medicine",
  "pageSize": 2
}
// Results: Broad coverage including ICU applications, cardiac rehabilitation
// Artificial Gravity + Healthy Volunteers - Found 3 studies
{
  "method": "search",
  "intervention": "artificial gravity",
  "healthy": "y",
  "pageSize": 3
}
// Results: GRACER1 centrifuge study, 60-day bedrest with cycling, space research
// "Vampire" Boolean Query - Found 4 studies
{
  "method": "search",
  "complexQuery": "vampire AND NOT placebo",
  "pageSize": 2
}
// Results: Medical device studies (likely related to vascular procedures)
// Quantum Therapy - Found 42 studies
{
  "method": "search",
  "intervention": "quantum therapy",
  "pageSize": 2
}
// Results: QuANTUM-R leukemia study, "Quantum Touch" pediatric anxiety research
// Initial search returns pageToken
{
  "method": "search",
  "complexQuery": "vampire AND NOT placebo",
  "pageSize": 2,
  "pageToken": "NF0g5JSGlPgsyQ"  // Use token from previous response
}
// Seamlessly navigates to next page of results
// Very specific geographic filtering (as expected, returns 0 results)
{
  "method": "search",
  "condition": "Marfan syndrome",
  "location": "Iceland",
  "pageSize": 3
}
// Results: 0 studies (expected for rare condition + small country)
Strengths Demonstrated:
Verdict: Production-ready with exceptional functionality across all use cases.
USE_HTTP - Enable HTTP mode (default: false)USE_SSE - Enable SSE mode (default: false)PORT - Server port for HTTP/SSE (default: 3000)LOG_LEVEL - Logging level: error, warn, info, debug (default: info)npm start
USE_HTTP=true PORT=3000 npm start
Available endpoints:
GET /health - Health checkPOST /list_tools - List available toolsPOST /ct_gov_studies - Unified ClinicalTrials.gov operations (search, suggest, get)USE_SSE=true PORT=3000 npm start
SSE endpoint available at /mcp
npm test                    # Run all tests
npm run test:unit          # Run unit tests only
npm run test:integration   # Run integration tests only
npm run test:coverage      # Run with coverage report
npm run dev                # Start in watch mode
npm run build              # Build TypeScript
npm run clean              # Clean build artifacts
npm run benchmark          # Run performance benchmarks
npm run performance        # Monitor performance metrics
This project is licensed under the MIT License - see the LICENSE file for details.
Built for researchers, clinicians, and developers working with clinical trial data.
FAQs
Model Context Protocol (MCP) server for searching clinical trials from ClinicalTrials.gov with advanced filtering, complex queries, and comprehensive study information
We found that @uh-joan/ct.gov-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.