Research & Data · Developer Tools

Clinicaltrialsgov MCP Server

cyanheads/clinicaltrialsgov-mcp-server

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

Install

bunx clinicaltrialsgov-mcp-server@latest

Client configuration

{
  "mcpServers": {
    "clinicaltrialsgov-mcp-server": {
      "command": "bunx",
      "args": [
        "clinicaltrialsgov-mcp-server@latest"
      ],
      "env": {
        "MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
        "MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>"
      }
    }
  }
}

Environment variables

MCP_TRANSPORT_TYPEMCP_LOG_LEVEL
Category
Research & Data, Developer Tools
License
Apache-2.0
Updated
Oct 6, 2026

Features

  • Type-safe client for the ClinicalTrials.gov REST API v2 — public, no authentication or API keys required

  • Serialized request queue enforcing ClinicalTrials.gov's ~1 req/sec rate limit, with retry and exponential backoff on 429/5xx responses

  • Auto-corrects field names passed to fields/sort — case/whitespace fixes and known legacy aliases (e.g. RecruitmentStatus → OverallStatus) — before validating, logging every correction

  • Detects upstream HTML error pages returned with a JSON content-type and retries rather than parsing them as data

  • Geographic proximity search and nearest-site re-ranking, with no geocoding dependency

  • Excludes ClinicalTrials.gov's "unknown" enrollment sentinel (99999999) from searches and counts by default — includeUnknownEnrollment brings it back, and an nctIds lookup never filters it

  • Provenance — clinicaltrials_search_studies / clinicaltrials_get_study_count / clinicaltrials_find_eligible echo searchCriteria on every call, including sentinelFilterActive when the default…

  • Graceful partial failure — clinicaltrials_get_study_results returns per-study fetchErrors / studiesWithoutResults rows instead of failing the whole batch when one ID is malformed or lacks results

  • Discriminated output — typed error reason codes per tool (study_not_found, blank_value, offset_not_applicable, …), and bounded lists (filtersApplied, locationSummary) carry a next*Offset only when…

  • Response shaping — clinicaltrials_search_studies and clinicaltrials_find_eligible return a compact per-study index or location-bounded set by default instead of the ~70KB full record, escalating to…

Tools (11)

  • 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

  • clinicaltrials_find_eligible

    Match patient demographics and conditions to eligible recruiting trials

  • filtersApplied

    reports upstream totals when a cap trims a list; resultsSection is replaced by resultsSummary counts.

  • multiValued

    flags fields whose per-value counts can sum above the study total.

  • mode

    search (keyword query, limit ≤100, default 20), drill (dot-notation path), or overview — resolves the PascalCase names accepted by fields, advancedFilter,…

  • age

    sex (FEMALE / MALE / ALL), conditions[], location (country required, state / city optional), healthyVolunteer, recruitingOnly (default true), maxResults (≤50),…

Details on this page are taken from the project's README. Open README

Supported clients

Clients mentioned in this server's README:

View all
Claude Desktop logo

Claude Desktop

Desktop · Freemium · Proprietary

Anthropic's official Claude AI desktop application. Supports MCP servers to extend functionality.

WindowsMacOS
Cursor logo

Cursor

Desktop · Freemium · Proprietary

The first agentic IDE. The Cursor editor truly merges how developers and AI work together, delivering a magical coding experience.

WindowsMacOSLinux
VS Code GitHub Copilot logo

VS Code GitHub Copilot

Desktop · Freemium · MIT

VS Code integrates MCP with GitHub Copilot through agent mode, allowing direct interaction with MCP-provided tools in your agentic coding workflow. Configure servers in Claude Desktop, workspace, or user settings, with guided MCP installation and secure handling of secrets in input variables to avoid leaking hardcoded keys.

WindowsMacOSLinuxWeb

Related MCP servers

More servers
Firecrawl MCP Server logo

Firecrawl MCP Server

mendableai/firecrawl-mcp-server

2.8k

A Model Context Protocol (MCP) server that brings Firecrawl to MCP-compatible AI agents — search, scrape, and interact with the live web for clean, agent-ready context.

Research & Data
Exa Web Search logo

Exa Web Search

exa-labs/exa-mcp-server

1.4k

Connect AI agents to Exa for web search, content fetching, and multi-step research.

Research & Data
ArXiv logo

ArXiv

blazickjp/arxiv-mcp-server

1k

A local MCP server for agent literature work. The differentiator is original-LaTeX section reads, BibTeX from arXiv metadata, and topic watches. Papers stay on disk.

Research & Data
sail logo

sail

lakehq/sail

730

Sail is a drop-in Apache Spark replacement written in Rust, unifying batch processing, stream processing, and compute-intensive AI workloads on a distributed, multimodal compute engine.

Research & Data

OpenAPI Proxy

janwilmake/openapi-mcp-server

554

A Model Context Protocol (MCP) server for Claude/Cursor that enables searching and exploring OpenAPI specifications through oapis.org.

Research & Data
Excel MCP Server logo

Excel MCP Server

haris-musa/excel-mcp-server

393

A Model Context Protocol server that lets AI assistants create, read and edit Excel workbooks. It needs no Microsoft Excel installation.

Research & Data