Logo vun 临床试验 MCP 服务器

临床试验 MCP 服务器

Communautéit
JackKuo666

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

EditeurJackKuo666
RepositoryClinicalTrials-MCP-Server
SproochPython
Forks
7
Stären
16
Disponibel Tools
0
Transporttypstdio
Kategorien
Linken
  • Tools mat KI-Workflows verbannen

    临床试验 MCP 服务器 stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    16 Stären an 7 Forks aus dem verlinkte Repository.

ClinicalTrials MCP Server

smithery badge

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

The ClinicalTrials MCP Server provides a bridge between AI assistants and ClinicalTrials.gov's clinical trial repository through the Model Context Protocol (MCP). It allows AI models to search for clinical trials and access their content in a programmatic way.

🤝 Contribute • 📝 Report Bug

✨ Core Features

  • 🔎 Trial Search: Query clinical trials with custom search strings or advanced search parameters ✅
  • 🚀 Efficient Retrieval: Fast access to trial metadata ✅
  • 📊 Metadata Access: Retrieve detailed metadata for specific trials using NCT ID ✅
  • 📊 Research Support: Facilitate health sciences research and analysis ✅
  • 📋 CSV Management: Save, load, and list CSV files with trial data ✅
  • 🗃️ Local Storage: Trials are saved locally for faster access ✅
  • 📊 Statistics: Get statistics about clinical trials ✅

🚀 Quick Start

Installing via Smithery

To install ClinicalTrials Server for Claude Desktop automatically via Smithery:

Claude

bash
npx -y @smithery/cli@latest install ClinicalTrials-mcp-server --client claude --config "{}"

Cursor

Paste the following into Settings → Cursor Settings → MCP → Add new server:

  • Mac/Linux
s
npx -y @smithery/cli@latest run ClinicalTrials-mcp-server --client cursor --config "{}" 

Windsurf

sh
npx -y @smithery/cli@latest install ClinicalTrials-mcp-server --client windsurf --config "{}"

CLine

sh
npx -y @smithery/cli@latest install ClinicalTrials-mcp-server --client cline --config "{}"

Installing Manually

Install using uv:

bash
uv tool install ClinicalTrials-mcp-server

For development:

bash
# Clone and set up development environment
git clone https://github.com/JackKuo666/ClinicalTrials-MCP-Server.git
cd ClinicalTrials-MCP-Server

# Create and activate virtual environment
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt

📊 Usage

Start the MCP server:

bash
python clinical_trials_server.py

Once the server is running, you can use the provided MCP tools in your AI assistant or application. Here are some examples of how to use the tools:

Example 1: Search for clinical trials using a search expression and save to CSV

python
result = await mcp.use_tool("search_clinical_trials_and_save_studies_to_csv", {
    "search_expr": "COVID-19 vaccine efficacy",
    "max_studies": 5
})
print(result)

Example 2: Get studies by keyword

python
result = await mcp.use_tool("get_studies_by_keyword", {
    "keyword": "diabetes",
    "max_studies": 10
})
print(result)

Example 3: Get full study details for a specific trial

python
result = await mcp.use_tool("get_full_study_details", {
    "nct_id": "NCT04280705"
})
print(result)

Example 4: Search and save studies with custom fields

python
result = await mcp.use_tool("search_clinical_trials_and_save_studies_to_csv", {
    "search_expr": "alzheimer",
    "max_studies": 20,
    "filename": "alzheimer_studies.csv",
    "fields": ["NCT Number", "Study Title", "Brief Summary", "Conditions"]
})
print(result)

These examples demonstrate how to use the main tools provided by the ClinicalTrials MCP Server. Adjust the parameters as needed for your specific use case.

🛠 MCP Tools

The ClinicalTrials MCP Server provides the following tools:

search_clinical_trials_and_save_studies_to_csv

Search for clinical trials using a search expression and save the results to a CSV file.

Parameters:

  • search_expr (str): Search expression (e.g., "Coronavirus+COVID")
  • max_studies (int, optional): Maximum number of studies to return (default: 10)
  • save_csv (bool, optional): Whether to save the results as a CSV file (default: True)
  • filename (str, optional): Name of the CSV file to save (default: corona_fields.csv)
  • fields (list, optional): List of fields to include (default: NCT Number, Conditions, Study Title, Brief Summary)

Returns: String representation of the search results

get_full_study_details

Get detailed information about a specific clinical trial.

Parameters:

  • nct_id (str): The NCT ID of the clinical trial

Returns: String representation of the study details

get_studies_by_keyword

Get studies related to a specific keyword.

Parameters:

  • keyword (str): Keyword to search for
  • max_studies (int, optional): Maximum number of studies to return (default: 20)
  • save_csv (bool, optional): Whether to save the results as a CSV file (default: True)
  • filename (str, optional): Name of the CSV file to save (default: keyword_results_{keyword}.csv)

Returns: String representation of the studies

get_study_statistics

Get statistics about clinical trials.

Parameters:

  • condition (str, optional): Optional condition to filter by

Returns: String representation of the statistics

get_full_studies_and_save

Get full studies data and save to CSV.

Parameters:

  • search_expr (str): Search expression (e.g., "Coronavirus+COVID")
  • max_studies (int, optional): Maximum number of studies to return (default: 20)
  • filename (str, optional): Name of the CSV file to save (default: full_studies.csv)

Returns: Message indicating the results were saved

load_csv_data

Load and display data from a CSV file.

Parameters:

  • filename (str): Name of the CSV file to load

Returns: String representation of the CSV data

list_saved_csv_files

List all available CSV files in the current directory.

Returns: String representation of the available CSV files

🔍 MCP Resources

The ClinicalTrials MCP Server also provides the following resources:

clinicaltrials://corona_fields

Get the corona fields data as a resource.

clinicaltrials://full_studies

Get the full studies data as a resource.

clinicaltrials://csv/{filename}

Get data from a specific CSV file.

Parameters:

  • filename (str): Name of the CSV file

clinicaltrials://available_files

Get a list of all available CSV files.

clinicaltrials://study/{nct_id}

Get a specific study by NCT ID.

Parameters:

  • nct_id (str): The NCT ID of the clinical trial

clinicaltrials://condition/{condition}

Get studies related to a specific condition.

Parameters:

  • condition (str): The condition to search for

Usage with Claude Desktop

Add this configuration to your claude_desktop_config.json:

(Mac OS)

json
{
  "mcpServers": {
    "ClinicalTrials": {
      "command": "python",
      "args": ["-m", "ClinicalTrials-mcp-server"]
      }
  }
}

(Windows version):

json
{
  "mcpServers": {
    "ClinicalTrials": {
      "command": "C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\Python\\Python311\\python.exe",
      "args": [
        "-m",
        "ClinicalTrials-mcp-server"
      ]
    }
  }
}

Using with Cline

json
{
  "mcpServers": {
    "ClinicalTrials": {
      "command": "bash",
      "args": [
        "-c",
        "source /home/YOUR/PATH/ClinicalTrials-MCP-Server/.venv/bin/activate && python /home/YOUR/PATH/ClinicalTrials-MCP-Server/clinical_trials_server.py"
      ],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
  }
}

After restarting Claude Desktop, the following capabilities will be available:

Searching Clinical Trials

You can ask Claude to search for clinical trials using queries like:

Can you search for recent clinical trials about diabetes?

The search will return basic information about matching trials including:

• Trial title

• NCT Number

• Conditions

• Brief Summary

Getting Trial Details

Once you have an NCT ID, you can ask for more details:

Can you show me the details for trial NCT04280705?

This will return:

• Full trial title

• Conditions

• Brief Summary

• Other available details

📁 Project Structure

  • clinical_trials_server.py: The main MCP server implementation using FastMCP
  • clinical_trials.py: Contains helper functions for interacting with the ClinicalTrials.gov API

🔧 Dependencies

  • Python 3.10+
  • FastMCP
  • pytrials
  • pandas

You can install the required dependencies using:

bash
pip install FastMCP pytrials pandas

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License.

⚠️ Disclaimer

This tool is for research purposes only. Please respect ClinicalTrials.gov's terms of service and use this tool responsibly.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "jackkuo666-clinicaltrials-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "ClinicalTrials-MCP-Server"
      ]
    }
  }
}

临床试验 MCP 服务器 MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal 临床试验 MCP 服务器 verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

临床试验 MCP 服务器 als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu 临床试验 MCP 服务器 an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "jackkuo666-clinicaltrials-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "ClinicalTrials-MCP-Server"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu 临床试验 MCP 服务器. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu 临床试验 MCP 服务器.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat 临床试验 MCP 服务器?
临床试验 MCP 服务器
Jo. Ech hunn et gelies.
Dat hunn ech mat 临床试验 MCP 服务器 fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server 临床试验 MCP 服务器 benotzt?

临床试验 MCP 服务器 ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech 临床试验 MCP 服务器 MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir 临床试验 MCP 服务器 mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat 临床试验 MCP 服务器 MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann 临床试验 MCP 服务器 verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech 临床试验 MCP 服务器 MCP mat TypingMind?

临床试验 MCP 服务器 leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt 临床试验 MCP 服务器 MCP an TypingMind zur Verfügung?

临床试验 MCP 服务器 stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir 临床试验 MCP 服务器 MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann 临床试验 MCP 服务器 eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇