← Back to directory
C

ClinicalTrials.gov MCP Server

Community
Search ClinicalTrials.gov trials, retrieve study details and results, and match patients to eligible trials via MCP.
GitHub source repository ↗
★ 91 Stars Category · Other Popular Source revision 7e3f9127d020
60FMRS · C
Reliability
8/20
Security and permissions
12/20
Maintenance
12/20
Documentation
15/20
Setup experience
13/20

This server provides a comprehensive set of tools to query ClinicalTrials.gov, including advanced search, patient matching, and study results extraction. It is well-designed with clear documentation and supports both transports, making it versatile for various MCP clients.

Read the FMRS scoring method →

clinicaltrialsgov-mcp-server is an MCP server that provides seven tools for searching clinical trials on ClinicalTrials.gov, fetching study records and results, getting study counts, exploring field values, browsing the data model, and matching patients to recruiting trials based on demographics and conditions. It supports both stdio and Streamable HTTP transports and requires no API keys. The server is built on @cyanheads/mcp-ts-core, offering declarative tool definitions, unified error handling, structured logging, and optional observability.

Tools

clinicaltrials_search_studies
Search studies with full-text queries, filters, pagination, sorting, and field selection.
clinicaltrials_get_study_record
Fetch a single study by NCT ID, returning the full record including protocol, eligibility, outcomes, arms, interventions, contacts, and locations.
clinicaltrials_get_study_count
Get the total study count for a query without fetching data, providing fast statistics and breakdowns.
clinicaltrials_get_field_values
Discover valid values for API fields (status, phase, study type, etc.) with per-value counts.
clinicaltrials_get_field_definitions
Browse the study data model field tree — piece names, types, nesting, with subtree navigation and keyword search.
clinicaltrials_get_study_results
Extract outcomes, adverse events, participant flow, and baseline from completed studies. Optional summary mode reduces ~200KB payloads to ~5KB per study.
clinicaltrials_find_eligible
Match patient demographics and conditions to eligible recruiting trials. Provide age, sex, conditions, and location to find studies with matching eligibility criteria, contacts, and recruiting locations.

Setup

  1. Clone the repository: git clone https://github.com/cyanheads/clinicaltrialsgov-mcp-server.git. 2. Navigate into the directory: cd clinicaltrialsgov-mcp-server. 3. Install dependencies: bun install. Then build and run: bun run build && bun run start:stdio (or start:http). Alternatively, use the public hosted instance: https://clinicaltrials.caseyjhand.com/mcp.
claude_desktop_config.json
{
  "mcpServers": {
    "clinicaltrialsgov-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": [
        "clinicaltrialsgov-mcp-server@latest"
      ],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio"
      }
    }
  }
}

Fit and risk

Best for

  • Clinical researchers
  • Healthcare professionals
  • Patient navigators
  • AI agents needing access to clinical trial data

Not for

  • Not an official source for clinical trials; it's a wrapper for ClinicalTrials.gov
  • Does not provide medical advice
  • Not suitable for use with data sources other than ClinicalTrials.gov API

Required permissions

  • No API keys required; uses the public API
  • May require network access to reach the hosted instance or install packages
  • If self-hosting, may require permissions to execute and run on your system

Risks and side effects

  • Reliance on the ClinicalTrials.gov API, which may change or become unavailable
  • Data fetched from the API may be incomplete or outdated
  • Fuzzy matching in search may return irrelevant trials
  • Public hosted instance may be rate-limited or have privacy concerns

Troubleshooting

  1. Ensure you are running the latest version and use bunx to run
  2. Check environment variables like CT_API_BASE_URL (default https://clinicaltrials.gov/api/v2)
  3. Confirm network connectivity; the API should not require authentication
  4. If queries fail, check for rate limiting and retry logic with exponential backoff

Use cases

Search clinical trials for specific conditions or interventions
Fetch full study records including eligibility criteria and locations
Match patient profiles to eligible recruiting trials
Analyze trial landscape with statistics
Extract results data from completed studies

Supported clients

Claude DesktopFull support
CursorFull support
VS CodeFull support