clinicaltrialsgov-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_LOG_LEVEL | No | The minimum level for logging (debug, info, warn, error) | info |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Use the clinicaltrials_* tools to access the ClinicalTrials.gov registry — public, read-only, 600K+ studies. Studies are addressed by NCT ID (NCT followed by 8 digits). Field names for the fields, advancedFilter, and sort parameters are PascalCase leaves (NCTId, OverallStatus, EnrollmentCount); sort takes only date and numeric fields, or @relevance. Call clinicaltrials_get_field_definitions to discover them and clinicaltrials_get_field_values for valid enum values. Typical workflow: clinicaltrials_search_studies (compact per-study index by default, including hasResults; pass fields for specific leaves) → clinicaltrials_get_study_record → clinicaltrials_get_study_results (only when hasResults=true). Use clinicaltrials_get_study_count for cheap breakdowns and clinicaltrials_find_eligible for patient matching. The clinicaltrialsgov-guide skill (skill://clinicaltrialsgov-guide/SKILL.md) carries the gates for site versus study recruiting status, overlapping phase counts, RANGE and partial-date filters, the status vocabulary, and reading posted results.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": true,
"listChanged": true
} |
| extensions | {
"io.modelcontextprotocol/skills": {
"directoryRead": true
}
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| clinicaltrials_search_studiesA | 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 at full fidelity — full study records are ~70KB each. |
| clinicaltrials_get_study_recordA | 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 trim locations, outcomes, and references — original totals are preserved in |
| clinicaltrials_get_study_countA | 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 recruiting vs completed for a condition). |
| clinicaltrials_get_field_valuesA | 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. |
| clinicaltrials_get_field_definitionsA | 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 |
| clinicaltrials_get_study_resultsA | 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 of contact). Only available for studies where hasResults is true. Use clinicaltrials_search_studies first to find studies with results. Each call fetches up to 20 distinct NCT IDs and returns any further IDs in deferredNctIds for a follow-up call. A results-rich record can exceed 500KB per study in full mode — bound it with summary=true, narrower sections, or the outcomeLimit / adverseEventLimit caps; outcomeLimit / outcomeOffset also page summarized outcomes. A bounded list is resumable: outcomeOffset / seriousEventOffset / otherEventOffset start the next window, and each study's filtersApplied reports what was trimmed and the next offset for every list left short. A previous (alias) NCT ID resolves to its canonical study, named in canonicalNctId. |
| clinicaltrials_find_eligibleA | 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.gov's fuzzy condition search only — inclusion/exclusion criteria are not checked, and a candidate can exclude the requested condition, so review each one's criteria with clinicaltrials_get_study_record before treating it as a match. Results are re-ranked so studies whose own condition matches a requested condition surface above tangential matches from ClinicalTrials.gov's fuzzy condition search. Each candidate returns only the sites matching the requested location (capped by locationLimit), not the study's full registered site list — a large trial can register hundreds of sites worldwide. When none of a candidate's matched sites is recruiting, one recruiting site is added so an enrollable site is never hidden behind a closer closed one: the one nearest the matched sites by their published coordinates, in the requested country whenever a site there recruits, carrying distanceMi, or the first in match order when coordinates are missing. Fetch a study's complete record with clinicaltrials_get_study_record. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| analyze_trial_landscape | Guides analysis of a clinical trial landscape using the ClinicalTrials.gov MCP tools. Adaptable workflow for breakdowns by status, phase, sponsor, geography, etc. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| clinicaltrialsgov-guide | Gates and query syntax for the clinicaltrials_* tools over ClinicalTrials.gov. Covers study versus site recruiting status, SEARCH[Location], RANGE and MISSING in advancedFilter, overlapping phase counts, partial dates, the status vocabulary, and reading posted results (group IDs, the adverse-event threshold, results published elsewhere). Use when finding trials near a place, counting or trending trials, building an advancedFilter, or interpreting a trial's results. |
TDQS
Scored across 7 tools
Each tool targets a distinct operation: aggregate counts, search index retrieval, full single-record fetch, results fetch, valid field values, valid field names, and patient eligibility matching. Descriptions explicitly delineate near-neighbors such as get_study_count vs search_studies and get_field_values vs get_field_definitions.
All names share the clinicaltrials_ prefix and follow a consistent snake_case verb_noun pattern (get_study_count, search_studies, get_study_record, find_eligible). Predictable and uniform throughout the set.
Seven tools is well-scoped for a read-only data API wrapper, with each tool earning its place by covering a distinct query mode. No redundant or filler tools are present.
The surface covers discovery, full records, results data, field metadata introspection, and patient matching, which is the appropriate scope for a read-only public dataset with no write operations. A minor gap is batch full-record fetching—get_study_record accepts only a single NCT ID—though the search index partially mitigates this.