Get the FREE Ultimate OpenClaw Setup Guide →

ClinicalTrials

🔍 Enable AI assistants to search and access ClinicalTrials.gov data through a simple MCP interface.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jackkuo666-clinicaltrials-mcp-server python clinical_trials_server.py

How to use

The ClinicalTrials MCP Server provides a bridge between AI assistants and the ClinicalTrials.gov catalog through the Model Context Protocol (MCP). It exposes a set of tools that let you search for clinical trials, fetch detailed study information, and manage results in CSV format. Core tools include: search_clinical_trials_and_save_studies_to_csv for performing a search and persisting results to a CSV file; get_studies_by_keyword to retrieve trials related to a keyword; get_full_study_details to obtain comprehensive information for a specific NCT ID; get_full_studies_and_save to fetch and save full study data based on a search expression; load_csv_data and list_saved_csv_files to inspect saved CSV data and files. These tools can be invoked from an AI agent or client by referencing their tool names and providing the appropriate parameters, enabling workflows such as data collection, analysis, and reporting on ClinicalTrials.gov data.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • Git to clone the repository
  • Optional: a virtual environment tool (venv or uv) for isolating dependencies

Install steps:

  1. Clone the repository: git clone https://github.com/JackKuo666/ClinicalTrials-MCP-Server.git cd ClinicalTrials-MCP-Server

  2. (Recommended) Create and activate a virtual environment: python -m venv .venv source .venv/bin/activate # On Windows use: .venv\Scripts\activate

  3. Install dependencies: pip install -r requirements.txt

  4. Run the server locally: python clinical_trials_server.py

Optional development setup:

  • If you prefer using uv (for a more isolated dev environment), install uv and run accordingly per your setup instructions.
  • Ensure your environment has network access to ClinicalTrials.gov and any required data storage paths for CSVs.

Additional notes

Tips and common considerations:

  • The server stores trial data locally to speed up repeated access; ensure the working directory has write permissions for CSV files.
  • Tools output may be returned as strings representing results; format and parsing may vary based on the client.
  • If you plan to run Claude Desktop or other MCP clients, configure the mcpServers entry to point to the correct Python invocation as shown in the README example.
  • For large query workloads, consider saving results to CSV with a meaningful filename and consider splitting requests to respect any rate limits.
  • Environment-specific paths (like Python executable or virtual environments) may differ; adjust the command and arguments accordingly for your OS.
  • The server also exposes several resources (e.g., clinicaltrials://study/{nct_id}) which can be consumed by MCP clients to fetch targeted data.
  • If you modify code or run in a container, ensure dependencies listed in requirements.txt are installed and that the server has permission to create or read CSV files.

Related MCP Servers

Sponsor this space

Reach thousands of developers