home / mcp / clinicaltrials.gov mcp server

ClinicalTrials.gov MCP Server

Provides programmatic access to ClinicalTrials.gov data via API v2 for searching and retrieving trial information.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "aafjes-mcp-clinicaltrials.gov": {
      "command": "python",
      "args": [
        "/path/to/clinicaltrials_mcp_server.py"
      ]
    }
  }
}

You can query and retrieve clinical trial information from ClinicalTrials.gov through a dedicated MCP server. It lets you search by condition, intervention, location, status, and more, and it returns detailed study records and aggregate statistics for research and AI-assisted workflows.

How to use

Connect to the ClinicalTrials MCP server from your MCP client using the local stdio transport. You will run the server locally and communicate with it through standard input and output streams.

Typical workflows you can perform include searching for trials by condition or intervention, retrieving full study details by NCT ID, and getting aggregate statistics across trials. Use search_clinical_trials to filter by criteria like condition, sponsor, location, or status, then use get_clinical_trial with a specific NCT ID to pull all fields for that study.

How to install

Prerequisites ensure you can run the MCP server and Python packages.

Install from source with Python 3.10 or higher and pip.

# Clone or download the server files
git clone <repository-url>
cd clinicaltrials-mcp-server

# Install dependencies
pip install -r requirements.txt

# Or install the package for development
pip install -e .

Additional configuration and usage notes

Configure your client to connect via stdio using the local Python command and the server script path exactly as shown.

# Claude Desktop configuration example (macOS)
#!/usr/bin/env python3
# This is the JSON configuration your client would load for stdio-based access
{"mcpServers": {"clinicaltrials": {"command": "python", "args": ["/path/to/clinicaltrials_mcp_server.py"]}}}

Troubleshooting

Connection issues: ensure you have internet access if the server relies on external data sources and verify the server script path is correct. If you encounter timeouts, adjust client settings to accommodate network latency or increase the per-request timeout on the server side.

Examples of supported tools and endpoints

The server exposes tools to search and retrieve clinical trial data along with statistics.

Available tools

search_clinical_trials

Search for clinical trials using various criteria such as condition, intervention, sponsor, location, status, and NCT identifier, with options for pagination and sorting.

get_clinical_trial

Retrieve detailed information about a specific trial by its NCT ID, with optional field filtering.

get_trial_statistics

Return aggregate statistics about clinical trials with optional filters for status and geography.

ClinicalTrials.gov MCP Server - aafjes/mcp-clinicaltrials.gov