Clinical Trials.gov

v2.4.11Search & Data Extractionstable

Empowers AI agents with direct access to the official ClinicalTrials.gov database, enabling programmatic searching, retrieval, and analysis of clinical study data through a Model Context Protocol interface.

ai-agentapi-clientbioinformaticsclinical-trialsclinicaltrials
Share:
74
Stars
0
Downloads
0
Weekly
0/5

What is Clinical Trials.gov?

Clinical Trials.gov is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to empowers ai agents with direct access to the official clinicaltrials.gov database, enabling programmatic searching, retrieval, and analysis of clinical study data through a model context protocol inte...

Empowers AI agents with direct access to the official ClinicalTrials.gov database, enabling programmatic searching, retrieval, and analysis of clinical study data through a Model Context Protocol interface.

This server falls under the Search & Data Extraction category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • clinicaltrials_get_study
  • clinicaltrials_list_studies

Use Cases

Access official clinical trial database programmatically
Search and analyze clinical study data and eligibility criteria
cyanheads

Maintainer

LicenseApache-2.0
Languagetypescript
Versionv2.4.11
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y clinicaltrialsgov-mcp-server

Manual Installation

npx -y clinicaltrialsgov-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Clinical Trials.gov

The ClinicalTrials.gov MCP server gives AI agents direct, programmatic access to the official ClinicalTrials.gov database via its v2 REST API. It exposes seven specialized tools for searching studies by condition, intervention, or sponsor; retrieving full study records by NCT ID; counting matching trials; exploring the data model; extracting results and adverse events from completed studies; and matching patient eligibility profiles to recruiting trials. Researchers, clinicians, and health-tech developers use it to let Claude answer complex clinical trial questions without manual database queries.

Prerequisites

  • Node.js 18 or later, or Bun runtime installed (recommended for npx/bunx execution)
  • An MCP-compatible client such as Claude Desktop or Claude Code
  • No API key required — ClinicalTrials.gov API is publicly accessible
  • Internet access to reach https://clinicaltrials.gov/api/v2
1

Test the server with bunx

The recommended runtime is Bun. Run the server once with bunx to confirm it starts correctly before adding it to your MCP client.

bunx clinicaltrialsgov-mcp-server@latest
2

Add to Claude Desktop configuration (stdio mode)

Add the server to your claude_desktop_config.json using stdio transport, which is the default and most compatible mode.

{
  "mcpServers": {
    "clinicaltrialsgov-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["clinicaltrialsgov-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio"
      }
    }
  }
}
3

Alternative: use the public hosted instance

If you prefer not to run a local process, connect directly to the community-hosted instance at clinicaltrials.caseyjhand.com using streamable-http transport.

{
  "mcpServers": {
    "clinicaltrialsgov-mcp-server": {
      "type": "streamable-http",
      "url": "https://clinicaltrials.caseyjhand.com/mcp"
    }
  }
}
4

Optional: tune API behavior with environment variables

Set optional environment variables to adjust request timeout, page size, or logging verbosity. These are optional — the defaults work well for most use cases.

# Optional tuning variables
# CT_REQUEST_TIMEOUT_MS=30000   (default: 30 seconds)
# CT_MAX_PAGE_SIZE=200           (default: 200 results per page)
# MCP_LOG_LEVEL=info             (default: info)
5

Restart Claude Desktop and verify

Restart your MCP client. The seven clinical trials tools should now be available. Ask Claude to search for a trial to confirm connectivity.

Clinical Trials.gov Examples

Client configuration

Claude Desktop configuration for the ClinicalTrials.gov MCP server in stdio mode using bunx.

{
  "mcpServers": {
    "clinicaltrialsgov-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["clinicaltrialsgov-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio"
      }
    }
  }
}

Prompts to try

Example prompts to search and analyze clinical trial data through the MCP server.

- "Search ClinicalTrials.gov for recruiting Phase 3 trials studying pembrolizumab in non-small cell lung cancer."
- "Get the full study record for NCT04280705 including eligibility criteria and primary endpoints."
- "How many clinical trials for Alzheimer's disease are currently recruiting in the United States?"
- "Find trials I might be eligible for: I'm a 55-year-old with Type 2 diabetes and no prior insulin use."
- "Show me the results and adverse events for completed trial NCT02116777."
- "What fields are available in the ClinicalTrials.gov API for filtering sponsor information?"

Troubleshooting Clinical Trials.gov

bunx command not found when starting the server

Install Bun with: curl -fsSL https://bun.sh/install | bash, then restart your terminal. Alternatively, replace 'bunx' with 'npx' in the config args — the package is also compatible with the Node.js npx runner.

Searches return no results for a condition I know has trials

ClinicalTrials.gov uses specific terminology. Try using MeSH disease names (e.g., 'Carcinoma, Non-Small-Cell Lung' instead of 'lung cancer') or use broader search terms, then filter by status or phase in follow-up queries.

Request timeout errors for large result sets

Increase the timeout by setting CT_REQUEST_TIMEOUT_MS=60000 in the env block of your MCP config. Also consider using clinicaltrials_get_study_count first to gauge result set size before fetching full records.

Frequently Asked Questions about Clinical Trials.gov

What is Clinical Trials.gov?

Clinical Trials.gov is a Model Context Protocol (MCP) server that empowers ai agents with direct access to the official clinicaltrials.gov database, enabling programmatic searching, retrieval, and analysis of clinical study data through a model context protocol interface. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Clinical Trials.gov?

Install via npm with the command: npx -y clinicaltrialsgov-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Clinical Trials.gov?

Clinical Trials.gov works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Clinical Trials.gov free to use?

Yes, Clinical Trials.gov is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Search & Data Extraction MCP Servers

Explore all search & data extraction servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "clinicaltrialsgov": { "command": "npx", "args": ["-y", "clinicaltrialsgov-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Clinical Trials.gov?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides