by cyanheads
Search ClinicalTrials.gov trials, retrieve study details and results, and match patients to eligible trials via MCP. STDIO or Streamable HTTP.
# Add to your Claude Code skills
git clone https://github.com/cyanheads/clinicaltrialsgov-mcp-serverGuides for using ai agents skills like clinicaltrialsgov-mcp-server.
clinicaltrialsgov-mcp-server is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by cyanheads. Search ClinicalTrials.gov trials, retrieve study details and results, and match patients to eligible trials via MCP. STDIO or Streamable HTTP. It has 103 GitHub stars.
clinicaltrialsgov-mcp-server's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/cyanheads/clinicaltrialsgov-mcp-server" and add it to your Claude Code skills directory (see the Installation section above).
clinicaltrialsgov-mcp-server is primarily written in TypeScript. It is open-source under cyanheads on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh clinicaltrialsgov-mcp-server against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Public Hosted Server: https://clinicaltrials.caseyjhand.com/mcp
Search 600K+ studies on ClinicalTrials.gov, the US National Library of Medicine's trial registry. Fetch full study records and posted results, discover fields and valid values, and match a patient's profile to recruiting trials. No API key required.
| Tool | Description |
|---|---|
clinicaltrials_search_studies |
Search studies with full-text and field-specific queries, status/phase/geographic filters, pagination, sorting, and field selection |
clinicaltrials_get_study_record |
Fetch a single study by NCT ID — full protocol record with optional location/outcome/reference caps |
clinicaltrials_get_study_count |
Fast total study count for a query, without fetching data |
clinicaltrials_get_field_values |
Discover valid values for API fields, with per-value study counts |
clinicaltrials_get_field_definitions |
Resolve valid field names — keyword search, path drill-down, or top-level overview |
clinicaltrials_get_study_results |
Fetch posted results — outcomes, adverse events, participant flow, baseline — for completed studies; a study without posted results is answered with the journal articles its record lists as reporting them |
clinicaltrials_find_eligible |
Match patient demographics and conditions to candidate recruiting trials, by place name or by distance from the patient, without checking inclusion/exclusion criteria |
| Resource | Description |
|---|---|
clinicaltrials://{nctId} |
Fetch a single clinical study by NCT ID as JSON, with capped lists and results replaced by counts |
| Prompt | Description |
|---|---|
analyze_trial_landscape |
Guides a data-driven clinical trial landscape analysis using the count and search tools |
| Skill | Description |
|---|---|
clinicaltrialsgov-guide |
Gates and query syntax the tool descriptions don't carry: study versus site recruiting status, overlapping phase counts, RANGE and MISSING with partial dates and open-ended age limits, the status vocabulary, and reading posted results |
Plugin installs load it from skills/; MCP clients that support the Skills extension read it as skill://clinicaltrialsgov-guide/SKILL.md. It also ships in the npm package and Docker image.
clinicaltrials_search_studies toolquery plus field-specific conditionQuery / interventionQuery / locationQuery / sponsorQuery / titleQuery / outcomeQuery, statusFilter / phaseFilter enums (case and spacing variants accepted), advancedFilter (AREA[FieldName]value / RANGE[min, max]), and geoFilter (distance(lat,lon,radius) with a mi/km suffix, numbers in plain decimal digits; a radius past 12,451 mi / 20,039 km is sent at that cap, which reaches the same sites); pageSize (default 10, no upper bound; above the server's per-page cap, 200 by default, a page is served at the cap with truncated / shown / cap), pageToken cursor, sort on up to 2 date or numeric fields (or @relevance)fields list naming ResultsSection, or a module or group under it (OutcomeMeasuresModule, AdverseEventsModule), or one the field metadata cannot check, caps the page at 10 studies (the server's cap when lower), since one record with posted results can run past 1 MB; the same truncated / shown / cap and a notice disclose it. A leaf under results (OutcomeMeasureTitle) keeps the server's capProtocolSection caps the page at 75 studies (the server's cap when lower), since a page of 200 protocol sections runs past 2 MB, with the same disclosure. A module or leaf under it (StatusModule, BriefTitle) keeps the server's cap, and a list takes the lowest cap any of its names earnsquery.cond or query_cond, filter.overallStatus, filter.geo, …), and condition, intervention, sponsor, phase, limit, and max_results work as aliases toonctId, briefTitle, overallStatus, phases, enrollmentCount, hasResults, …); fields (PascalCase piece names, or full paths as clinicaltrials_get_field_definitions prints them) selects a full-fidelity projection — full records run ~70KBnctIds (up to 1000 entries, repeats collapsed) is served up to what fits one ClinicalTrials.gov request beside the other parameters — about 560 IDs on their own — with the rest returned unqueried in deferredNctIds, the same on every page of a walkblank_value, ids_not_found, field_invalid, enum_invalid, query_parse_error, geo_invalid, sort_invalid, page_token_invalid, request_too_long, rate_limited, retry_deadline_exceeded, upstream_timeout, upstream_unavailable, upstream_rejectedclinicaltrials_get_study_record toolnctId, with optional locationLimit, outcomeLimit / referenceLimit, and nearLocation (lat, lon, radiusMi) to bound and sort locations — none has an upper bound; a value past the list returns all of it, and 0 leaves that list outfiltersApplied reports upstream totals when a cap trims a list; resultsSection is replaced by resultsSummary counts. Typed errors: study_not_found, rate_limited, retry_deadline_exceeded, upstream_timeout, upstream_unavailable, upstream_rejectedclinicaltrials_get_study_count toolclinicaltrials_search_studies, returning only totalCount — no study data fetchedblank_value, field_invalid, enum_invalid, query_parse_error, request_too_long, rate_limited, retry_deadline_exceeded, upstream_timeout, upstream_unavailable, upstream_rejectedclinicaltrials_get_field_values toolfields (e.g. OverallStatus, Phase; index-only pieces such as NumLocations and StudyFirstPostYear count too, and so do record alt names such as OVERALL-STATUS; a group such as LeadSponsor is refused with its leaf pieces named, and so is a search area such as ConditionSearch) — returns each field's type and top values with study counts (capped at 250 by the API), or min / max / avg for numeric and date fields and trueCount / falseCount for booleanslongest value; past 2,000 characters it is a preview flagged truncated, with the full length and a notice naming the clinicaltrials_search_studies call that returns the whole text. Free-text fields the API does not count distinct values on carry uniqueValuesCounted: false, marking their uniqueValuesCount of 0 as no countmultiValued flags fields whose per-value counts can sum above the study total, index-only pieces under a repeated node included (LocationCountryCode). When the field metadata is unavailable or does not list a field, the flag is absent and a notice names the field as not determined, to be treated as possibly repeated. Typed errors: blank_value, field_invalid, request_too_long, rate_limited, retry_deadline_exceeded, upstream_timeout, upstream_unavailable, upstream_rejectedclinicaltrials_get_field_definitions toolmode: search (keyword query, limit default 20, no upper bound), drill (dot-notation path), or overview — resolves the PascalCase na