Clinical Trials

Provides a retrieval-augmented clinical trial data agent with SQL and vector search via MCP.
  • python

0

GitHub Stars

python

Language

6 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "tonih23-clinical-trials-mcp-agent": {
      "command": "python",
      "args": [
        "C:\\Users\\YOUR_USER\\Desktop\\clinical-trials-mcp-agent\\mcp_server.py"
      ]
    }
  }
}

You set up and run a retrieval-augmented MCP server that ingests real-world clinical trial data, stores it in a hybrid SQL and vector database, and exposes tools for structured SQL queries and semantic RAG searches to MCP clients. This server lets you autonomously reason over trials and protocols, making it easier to answer complex questions with precise filtering and semantic understanding.

How to use

You interact with the server through an MCP client. The server exposes two primary capabilities you can leverage from your client: structured SQL queries to filter trials and vector-based semantic search to reason over protocol text. Use the SQL tool for precise predicates (status, phase, conditions) and switch to the RAG tool when you need natural-language-style queries over the protocol content. You can issue autonomous tool calls from the client; the MCP server will route each request to the appropriate tool and return the results.

How to install

# Prerequisites
# - Python 3.8+
# - Virtual environment support

# Step 1: Clone the project
git clone https://github.com/tonih23/clinical-trials-mcp-agent.git
cd clinical-trials-mcp-agent

# Step 2: Create and activate a virtual environment
python -m venv venv
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate

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

# Step 4: (Optional) Ingest data via ETL
# This will fetch live trials and populate local databases
python etl_pipeline.py

# Step 5: Run the MCP server in development mode
mcp dev mcp_server.py

Connecting a client to the MCP server

To connect an MCP-compliant client, run the server in development mode as shown above and configure your client to load the MCP server entry. The example below demonstrates a local client configuration that points to the Python server script. Replace the path with the absolute path to your project folder.

{
  "mcpServers": {
    "clinical_trials": {
      "command": "python",
      "args": ["C:\\Users\\YOUR_USER\\Desktop\\clinical-trials-mcp-agent\\mcp_server.py"]
    }
  }
}

Example queries you can perform

Structured Query (SQL): Find active Phase 3 trials for Diabetes. The MCP client will route this query to the SQL tool to filter trials accordingly.

Semantic Query (RAG): For a specific trial, extract kidney-related exclusion criteria from the protocol text. The client will route this to the RAG tool to retrieve the relevant protocol details.

Available tools

search_trials_sql

Query the structured SQL database to filter trials by status, phase, and conditions with precise criteria.

get_protocol_details_rag

Perform semantic search over protocol text to retrieve specific details such as exclusion criteria and protocol sections.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational