Skip to content

PromtEngineer/clinical_trial_tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clinical Trials Tracker

An MCP server built with Arcade.dev that monitors clinical trials from ClinicalTrials.gov, manages watchlists in Google Sheets, and delivers digest emails via Gmail.

Built with Arcade's three-layer pattern:

  1. Data Source — ClinicalTrials.gov API v2
  2. Memory Layer — Google Sheets via Arcade's GoogleSheets.* integrations
  3. Presentation Layer — Gmail via Gmail.SendEmail + Linear via Linear.CreateIssue

Features

  • Search clinical trials by condition, status, and phase
  • Track trials in a Google Sheets watchlist (auto-created or existing)
  • Monitor watchlisted trials for status changes and new results
  • Digest — generate HTML/text summaries of trial updates
  • Email — send digests via Gmail through Arcade
  • Pipeline — one-click end-to-end: read watchlist, check updates, generate digest, update sheet, send email
  • Linear — create tickets for trials with new results
  • Agent Team — designed for Claude Code multi-agent orchestration (Scout, Memory, Analyst, Dispatcher)

Quick Start

# Install dependencies
cd clinical_trials_tracker
uv sync

# Set up environment
cp src/clinical_trials_tracker/.env.example .env
# Edit .env and add your ARCADE_API_KEY

# Run the UI dashboard
uv run uvicorn ui_server:app --port 5555
# Open http://localhost:5555

# Or run as MCP server (for Claude Code)
uv run src/clinical_trials_tracker/server.py

Dashboard

The browser UI at localhost:5555 has 7 tabs:

Tab Description
Search Find trials by condition with card/JSON view
Details Full trial info by NCT ID
Results Outcome measures + adverse events for completed trials
Updates Batch-check multiple trials for changes
Watchlist Add/load/update a Google Sheets watchlist
Pipeline Run the full monitoring pipeline (sheet + email)
Linear Create tickets via Arcade

MCP Tools

10 tools available via the MCP server:

Data Source

  • search_trials — search by condition, status, phase
  • get_trial_details — comprehensive trial data by NCT ID
  • get_trial_results — outcome measures and adverse events
  • check_trials_for_updates — batch status/results check

Memory (Google Sheets)

  • save_trial_to_watchlist — add trial to a Google Sheets watchlist
  • get_watchlist — read all tracked trials
  • update_watchlist — refresh watchlist against ClinicalTrials.gov

Presentation (Gmail + Linear)

  • generate_digest — format updates as HTML or text
  • send_digest_email — send via Gmail through Arcade

Orchestration

  • run_monitoring_pipeline — full pipeline: read sheet, check CT.gov, generate digest, update sheet, send email

Agent Team Pattern

Designed for Claude Code's multi-agent orchestration:

Claude (team lead)
  +-- Scout      -> search_trials, check_trials_for_updates
  +-- Memory     -> save_trial_to_watchlist, get_watchlist, update_watchlist
  +-- Analyst    -> get_trial_details, get_trial_results, generate_digest
  +-- Dispatcher -> send_digest_email, Linear ticket creation

See CLAUDE.md for detailed agent documentation, tool parameters, and example prompts.

Architecture

Browser (localhost:5555)
    | POST /api/*
    v
FastAPI (ui_server.py) ---- 12 endpoints (1 GET + 11 POST)
    | direct import
    v
MCP Tools (server.py) ---- 10 tools
    |                  \
    | httpx             \ arcadepy
    v                    v
ClinicalTrials.gov    Arcade API
    API v2              |       \
                        v        v
                  Google Sheets  Gmail / Linear

View the interactive architecture diagram at localhost:5555/static/architecture.html.

Environment Variables

Variable Required Default Description
ARCADE_API_KEY Yes Your Arcade API key
ARCADE_USER_ID No support@whryter.com User ID for Arcade OAuth

OAuth

Google Sheets and Gmail require OAuth authorization through Arcade. On first use:

  1. The tool automatically triggers the OAuth flow
  2. Opens a Google authorization URL
  3. Polls for completion (up to 2 minutes)
  4. Retries the tool call after authorization

Tech Stack

  • Backend: Python 3.12, FastAPI, httpx, arcade-mcp-server, arcadepy
  • Frontend: Vanilla HTML/CSS/JS (no build step)
  • APIs: ClinicalTrials.gov v2, Arcade, Google Sheets, Gmail, Linear
  • Tooling: uv, hatchling, ruff, mypy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors