cyanheads avatar

Clinicaltrialsgov Mcp Server

cyanheads/clinicaltrialsgov-mcp-server

Connects Claude to the ClinicalTrials.gov v2 REST API with seven tools covering the full research workflow: search studies with complex queries and filters, pull full protocol records by NCT ID, extract posted results from completed trials, and match patient profiles to recruiting studies based on demographics and eligibility criteria. The find_eligible tool is especially practical if you're building patient navigation flows or referral systems. Results can run large (70KB per study), so field selection and the summary mode for outcomes data help keep token usage reasonable. Includes field discovery tools to explore valid values and the API's data model. Public hosted instance available at clinicaltrials.caseyjhand.com/mcp if you want to try it without installing anything locally.

GitHub stars
100
tools
7
transport
STDIO, HTTP
env vars
9
last updated
Nov 9, 2026

Install

From registry metadata
$ npx add-mcp https://clinicaltrials.caseyjhand.com/mcp --name clinicaltrialsgov

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http clinicaltrialsgov https://clinicaltrials.caseyjhand.com/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 7 tools

Verified live against the running server on Nov 13, 2026.

clinicaltrials_search_studiesSearch for clinical trial studies from ClinicalTrials.gov. Supports full-text and field-specific queries, status/phase/geographic filters, pagination, sorting, and field selection. Returns a compact per-study index by default; pass the fields parameter to get specific leaves a...18 params

Search for clinical trial studies from ClinicalTrials.gov. Supports full-text and field-specific queries, status/phase/geographic filters, pagination, sorting, and field selection. Returns a compact per-study index by default; pass the fields parameter to get specific leaves a...

Parameters* required
advancedFilterstring
Advanced filter using AREA[FieldName]value syntax. Examples: "AREA[StudyType]INTERVENTIONAL", "AREA[EnrollmentCount]RANGE[100, 1000]", "AREA[Phase]PHASE2 AND AREA[StudyType]INTERVENTIONAL", "(AREA[...
conditionQuerystring
Condition/disease-specific search. E.g., "Type 2 Diabetes", "non-small cell lung cancer". Matches Condition, BriefTitle, OfficialTitle, ConditionMeshTerm, ConditionAncestorTerm, Keyword, and NCTId....
countTotalboolean
Include total study count in response. Only computed on the first page.default: true
fieldsarray
PascalCase piece names to return, leaves or groups (a group such as StatusModule returns all of its fields); strongly recommended since full records are ~70KB. Omit for the compact index projection...
geoFilterstring
Geographic proximity filter. Format: distance(lat,lon,radius), where radius carries a `mi` or `km` suffix — e.g. "distance(47.6062,-122.3321,50mi)" for studies within 50 miles of Seattle. The suffi...
includeUnknownEnrollmentboolean
Include studies whose EnrollmentCount is the upstream "unknown" sentinel (99999999). Excluded by default — the sentinel pollutes RANGE[N, MAX] queries and EnrollmentCount:desc sorts. Set true for d...default: false
interventionQuerystring
Intervention/treatment search. E.g., "pembrolizumab", "cognitive behavioral therapy". Matches InterventionName, InterventionType, ArmGroupType, InterventionOtherName, BriefTitle, OfficialTitle, Arm...
locationQuerystring
Location search — city, state, country, or facility name. Matches LocationCity, LocationState, LocationCountry, LocationFacility, and LocationZip; a study matches when any of its sites does. Plain...
nctIdsvalue
Filter to specific NCT IDs for batch lookups. Omit to search every study — an empty list is rejected, not treated as "no filter". Repeated IDs collapse to one, first occurrence kept. One request ca...
outcomeQuerystring
Search within outcome measure fields. Matches PrimaryOutcomeMeasure, SecondaryOutcomeMeasure, OtherOutcomeMeasure, and OutcomeMeasureTitle, plus their description counterparts PrimaryOutcomeDescrip...
pageSizeinteger
Results per page. Default 10; a larger value returns at most this server's per-page cap (200 unless the operator changed it) and says so in truncated/shown/cap, with nextPageToken to page the rest....default: 10
pageTokenstring
Pagination cursor: a previous response's nextPageToken, passed back unchanged with the same criteria. Tokens expire when ClinicalTrials.gov refreshes its data.
phaseFiltervalue
Filter by trial phase. Omit to search all phases — an empty list is rejected, not treated as "no filter". Values: EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4, NA. Case and spacing variants ("Phase...
querystring
General free-text search across all fields. Runs the 57-field relevance search ClinicalTrials.gov publishes for this parameter — NCTId, NCTIdAlias, OrgStudyId, SecondaryId, Acronym, BriefTitle, Off...
sortstring
Sort order. Format: FieldName:asc or FieldName:desc. E.g., "LastUpdatePostDate:desc", "EnrollmentCount:desc". Max 2 fields comma-separated. Only date and numeric fields sort — those whose clinicalt...
sponsorQuerystring
Sponsor/collaborator name search. Matches LeadSponsorName, CollaboratorName, and OrgFullName. Plain words plus AND/OR/NOT. `[ ]` are valid only inside an AREA[FieldName]value or RANGE[min, max] exp...
statusFiltervalue
Filter by study status. Omit to search all statuses — an empty list is rejected, not treated as "no filter". Values: RECRUITING, COMPLETED, ACTIVE_NOT_RECRUITING, NOT_YET_RECRUITING, ENROLLING_BY_I...
titleQuerystring
Search within study titles and acronyms only. Matches Acronym, BriefTitle, and OfficialTitle. Plain words plus AND/OR/NOT. `[ ]` are valid only inside an AREA[FieldName]value or RANGE[min, max] exp...
clinicaltrials_get_study_recordFetch a single clinical trial study by NCT ID from ClinicalTrials.gov. Returns the full study record including protocol details, eligibility criteria, outcomes, arms, interventions, contacts, and locations. Optional locationLimit / outcomeLimit / referenceLimit / nearLocation...5 params

Fetch a single clinical trial study by NCT ID from ClinicalTrials.gov. Returns the full study record including protocol details, eligibility criteria, outcomes, arms, interventions, contacts, and locations. Optional locationLimit / outcomeLimit / referenceLimit / nearLocation...

Parameters* required
locationLimitinteger
Optional cap on the number of locations returned. Omit for no cap (full upstream list); 0 leaves the locations out; a value at or past the list length also returns every location. Pairs naturally w...
nctId*string
NCT identifier — format `NCT` followed by 8 digits (e.g., `NCT03722472`).
nearLocationobject
Filter returned locations to those within radius of (lat, lon) and sort by distance. Adds distanceMi to each location. Locations without published coordinates are dropped — most US sites carry them...
outcomeLimitinteger
Optional cap on the number of secondary and other outcomes returned. Omit for no cap (full upstream lists); 0 leaves the secondary and other outcomes out; a value at or past a list length also retu...
referenceLimitinteger
Optional cap on the number of references returned. Omit for no cap (full upstream list); 0 leaves the references out; a value at or past the list length also returns every reference. Original total...
clinicaltrials_get_study_countGet total clinical trial study count from ClinicalTrials.gov matching a query, without fetching study data. Fast and lightweight. Use for quick statistics or to build breakdowns by calling multiple times with different filters (e.g., count by phase, count by status, count recr...11 params

Get total clinical trial study count from ClinicalTrials.gov matching a query, without fetching study data. Fast and lightweight. Use for quick statistics or to build breakdowns by calling multiple times with different filters (e.g., count by phase, count by status, count recr...

Parameters* required
advancedFilterstring
Advanced filter using AREA[FieldName]value syntax. Examples: "AREA[StudyType]INTERVENTIONAL", "AREA[EnrollmentCount]RANGE[100, 1000]", "AREA[Phase]PHASE2 AND AREA[StudyType]INTERVENTIONAL", "(AREA[...
conditionQuerystring
Condition/disease-specific search. E.g., "Type 2 Diabetes", "non-small cell lung cancer". Matches Condition, BriefTitle, OfficialTitle, ConditionMeshTerm, ConditionAncestorTerm, Keyword, and NCTId....
includeUnknownEnrollmentboolean
Include studies whose EnrollmentCount is the upstream "unknown" sentinel (99999999). Excluded by default — the sentinel pollutes RANGE[N, MAX] queries. Set true for data-quality audits.default: false
interventionQuerystring
Intervention/treatment search. E.g., "pembrolizumab", "cognitive behavioral therapy". Matches InterventionName, InterventionType, ArmGroupType, InterventionOtherName, BriefTitle, OfficialTitle, Arm...
locationQuerystring
Location search — city, state, country, or facility name. Matches LocationCity, LocationState, LocationCountry, LocationFacility, and LocationZip; a study matches when any of its sites does. Plain...
outcomeQuerystring
Search within outcome measure fields. Matches PrimaryOutcomeMeasure, SecondaryOutcomeMeasure, OtherOutcomeMeasure, and OutcomeMeasureTitle, plus their description counterparts PrimaryOutcomeDescrip...
phaseFiltervalue
Filter by trial phase. Omit to count all phases — an empty list is rejected, not treated as "no filter". Values: EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4, NA. Case and spacing variants ("Phase...
querystring
General free-text search across all fields. Runs the 57-field relevance search ClinicalTrials.gov publishes for this parameter — NCTId, NCTIdAlias, OrgStudyId, SecondaryId, Acronym, BriefTitle, Off...
sponsorQuerystring
Sponsor/collaborator name search. Matches LeadSponsorName, CollaboratorName, and OrgFullName. Plain words plus AND/OR/NOT. `[ ]` are valid only inside an AREA[FieldName]value or RANGE[min, max] exp...
statusFiltervalue
Filter by study status. Omit to count all statuses — an empty list is rejected, not treated as "no filter". Values: RECRUITING, COMPLETED, ACTIVE_NOT_RECRUITING, NOT_YET_RECRUITING, ENROLLING_BY_IN...
titleQuerystring
Search within study titles and acronyms only. Matches Acronym, BriefTitle, and OfficialTitle. Plain words plus AND/OR/NOT. `[ ]` are valid only inside an AREA[FieldName]value or RANGE[min, max] exp...
clinicaltrials_get_field_valuesDiscover valid values for ClinicalTrials.gov fields with study counts per value. Use to explore available filter options before building a search — e.g., valid OverallStatus, Phase, InterventionType, StudyType, or LeadSponsorClass values.1 params

Discover valid values for ClinicalTrials.gov fields with study counts per value. Use to explore available filter options before building a search — e.g., valid OverallStatus, Phase, InterventionType, StudyType, or LeadSponsorClass values.

Parameters* required
fields*value
PascalCase leaf piece name(s) to get value statistics for — an empty list is rejected, not treated as "every field". A group of fields (LeadSponsor, ConditionMesh) is refused with its leaf pieces n...
clinicaltrials_get_field_definitionsResolve valid field names from the ClinicalTrials.gov data model — the canonical PascalCase identifiers (OverallStatus, EnrollmentCount, LeadSponsorName) the other tools take. Every piece works in clinicaltrials_search_studies `fields`; a leaf piece (sourceType other than STRU...5 params

Resolve valid field names from the ClinicalTrials.gov data model — the canonical PascalCase identifiers (OverallStatus, EnrollmentCount, LeadSponsorName) the other tools take. Every piece works in clinicaltrials_search_studies `fields`; a leaf piece (sourceType other than STRU...

Parameters* required
includeIndexedOnlyboolean
drill mode only. Also list index-only pieces (search-index fields such as StudyFirstPostYear) alongside the record fields. Default: false.
limitinteger
search mode only. Maximum results to return. Default: 20. A value at or past the match count returns every match.default: 20
mode*string
Operation mode. "search" — keyword search (requires `query`); "drill" — drill into a section by path (requires `path`); "overview" — list all top-level sections (no other args needed).one of search · drill · overview
pathstring
drill mode only. Dot-notation path to drill into — e.g., "protocolSection.designModule", "protocolSection.eligibilityModule", "resultsSection". Returns the section's individual fields.
querystring
search mode only. Keyword to search field names by — e.g., "enrollment", "sponsor", "adverse events". Returns matching field names ranked by relevance with their full paths and data types.
clinicaltrials_get_study_resultsFetch clinical trial results data from ClinicalTrials.gov for completed studies — outcome measures with statistics, adverse events, participant flow, baseline characteristics, and results metadata (limitations & caveats, certain-agreement disclosure restrictions, results point...8 params

Fetch clinical trial results data from ClinicalTrials.gov for completed studies — outcome measures with statistics, adverse events, participant flow, baseline characteristics, and results metadata (limitations & caveats, certain-agreement disclosure restrictions, results point...

Parameters* required
adverseEventLimitinteger
Optional cap on the number of serious and other adverse events returned per study, applied to each list separately in upstream order. Omit for no cap (every event); a limit at or past a list’s leng...
nctIds*value
One or more NCT IDs — an empty list is rejected, and a repeated ID collapses to one results entry in first-occurrence order. A call fetches the first 20 distinct IDs; any further distinct IDs come...
otherEventOffsetinteger
Optional index of the first other (non-serious) adverse event to return, in upstream order. Omit or 0 to start at the first. Pages independently of seriousEventOffset and pairs with adverseEventLim...
outcomeLimitinteger
Optional cap on the number of outcome measures returned per study, taken in the order ClinicalTrials.gov publishes them. Omit for no cap (every measure); a limit at or past the list length returns...
outcomeOffsetinteger
Optional index of the first outcome measure to return, in the order ClinicalTrials.gov publishes them. Omit or 0 to start at the first. Pair with outcomeLimit to page a long list: each response rep...
sectionsvalue
Filter which sections to return. Values: outcomes, adverseEvents, participantFlow, baseline, moreInfo. Omit for all sections — an empty list is rejected, not treated as omission.
seriousEventOffsetinteger
Optional index of the first serious adverse event to return, in upstream order. Omit or 0 to start at the first. Pages independently of otherEventOffset — the two lists have uncorrelated lengths —...
summaryboolean
Return condensed summaries instead of full data. Full mode renders every row and field on both output channels, so a large results set can exceed 500KB per study; summary mode typically cuts that t...default: false
clinicaltrials_find_eligibleFind candidate clinical trials for a patient profile. Provide age, sex, conditions, and location to get studies with their demographic limits, contact information, and recruiting locations. Candidates are matched on age, sex, location, recruitment status, and ClinicalTrials.go...9 params

Find candidate clinical trials for a patient profile. Provide age, sex, conditions, and location to get studies with their demographic limits, contact information, and recruiting locations. Candidates are matched on age, sex, location, recruitment status, and ClinicalTrials.go...

Parameters* required
age*integer
Patient age as a whole number in ageUnit (years unless ageUnit says otherwise).
ageUnitstring
Unit age is given in: years (default), months, weeks, or days; case and singular forms are accepted. Use a smaller unit for an infant or young child whose eligibility window is narrower than a year...one of years · months · weeks · days
conditions*array
Medical conditions or diagnoses, e.g. ["Type 2 Diabetes", "Hypertension"]. Each entry is matched as a condition: an entry containing whitespace is quoted and matches as a phrase, and any other entr...
healthyVolunteerboolean
Whether the patient is a healthy volunteer. When true, only studies accepting healthy volunteers are queried.default: false
location*object
Patient location as `{ country (required), state?, city? }`. Country is required; state/city narrow the match. Every part given must hold for the same study site: country and state are compared wit...
locationLimitinteger
Cap on the sites returned per candidate. Each candidate keeps only the sites matching the requested location at the narrowest level that matched (city, else state, else country), capped at this man...default: 10
maxResultsinteger
Maximum candidates to return. Default 10; a larger value returns at most 50 and says so in truncated/shown/cap when more studies match, and the searchCriteria replay through clinicaltrials_search_s...default: 10
recruitingOnlyboolean
Only include actively recruiting studies.default: true
sex*string
Patient's biological sex. Use 'ALL' to include studies regardless of sex restrictions.one of FEMALE · MALE · ALL

Sponsors

Configuration

CT_API_BASE_URLdefault: https://clinicaltrials.gov/api/v2

ClinicalTrials.gov API base URL.

CT_REQUEST_TIMEOUT_MSdefault: 30000

Timeout in milliseconds for each attempt at a ClinicalTrials.gov request; a positive integer. An attempt ends sooner when its tool call or resource read runs out of its 50-second budget, which covers every request, retry, and wait the call makes.

CT_MAX_PAGE_SIZEdefault: 200

Most studies one clinicaltrials_search_studies page returns; an integer of at least 1, values above 1000 clamp to 1000.

MCP_LOG_LEVELdefault: info

Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').

MCP_TRANSPORT_TYPEdefault: http

Selects the HTTP transport.

MCP_HTTP_HOSTdefault: 127.0.0.1

The hostname for the HTTP server.

MCP_HTTP_PORTdefault: 3010

The port to run the HTTP server on.

MCP_HTTP_ENDPOINT_PATHdefault: /mcp

The endpoint path for the MCP server.

MCP_AUTH_MODEdefault: none

Authentication mode to use: 'none', 'jwt', or 'oauth'.

Readme

clinicaltrialsgov-mcp-server

Search ClinicalTrials.gov trials, retrieve study details and results, and match patients to candidate trials via MCP. STDIO or Streamable HTTP.

7 Tools • 1 Resource • 1 Prompt • 1 Skill

Details

Repository
github.com/cyanheads/clinicaltrialsgov-mcp-server
Category
Search & Web Crawling
Package
clinicaltrialsgov-mcp-server
Transport
STDIO, HTTP
Registry
MCP registry, active
Resources
1
Prompts
1
Tools verified
Nov 13, 2026

More from cyanheads

Related Search & Web Crawling MCP servers

View all
1oxylabs avatarOxylabs Oxylabs Mcpoxylabs/oxylabs-mcpFetch and process content from specified URLs using the Oxylabs Web Scraper API.96stars
2bzsasson avatarScreaming Frog SEO Spider MCP Server (headless)bzsasson/screaming-frog-mcpHeadless Screaming Frog SEO Spider via its CLI: run crawls, export and filter data, no GUI needed.94stars
3ilyagusev avatarIlyagusev Academia Mcpilyagusev/academia_mcpSearch arXiv and ACL Anthology, retrieve citations and references, and browse web sources to accel…90stars
4codealive-ai avatarCodealive Mcpcodealive-ai/codealive-mcpSemantic code search and analysis from CodeAlive for AI assistants and agents.90stars
5scrapegraphai avatarScrapegraphai Scrapegraph Mcpscrapegraphai/scrapegraph-mcpEnable language models to perform advanced AI-powered web scraping with enterprise-grade reliabili…82stars
6scrapegraphai avatarScrapegraph Mcpscrapegraphai/scrapegraph-mcpAI-powered web scraping and data extraction capabilities through ScrapeGraph API82stars