ClinicalTrials.gov MCP Server
Enables searching and retrieving information from the ClinicalTrials.gov database of over 400,000 clinical studies, including trial details, eligibility criteria, locations, and results across 220+ countries.
README
ClinicalTrials.gov MCP Server
A Model Context Protocol (MCP) server that provides access to the ClinicalTrials.gov database, enabling Claude and other AI assistants to search and retrieve information about clinical trials.
Overview
This MCP server implements the ClinicalTrials.gov API v2, providing comprehensive access to information about clinical studies registered in the United States and internationally. The database contains over 400,000 clinical trials from 220+ countries.
Features
-
Comprehensive Search: Search clinical trials by:
- Medical conditions/diseases
- Interventions/treatments
- Sponsors and investigators
- Geographic location
- Study status (recruiting, completed, etc.)
- NCT identifiers
-
Detailed Study Information: Retrieve complete study records including:
- Protocol information
- Eligibility criteria
- Intervention details
- Outcome measures
- Contact information and locations
- Study design and methodology
- Results (when available)
-
Aggregate Statistics: Get summary statistics and trends across clinical trials
Installation
Prerequisites
- Python 3.10 or higher
- pip
Install from source
# 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
pip install -e .
Configuration
For Claude Desktop
Add the server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"clinicaltrials": {
"command": "python",
"args": ["/path/to/clinicaltrials_mcp_server.py"]
}
}
}
For other MCP clients
Use the stdio transport to connect:
import asyncio
from mcp.client.stdio import stdio_client
async def main():
async with stdio_client(
server_params={
"command": "python",
"args": ["/path/to/clinicaltrials_mcp_server.py"]
}
) as (read, write):
# Use the client
pass
asyncio.run(main())
Tools
1. search_clinical_trials
Search for clinical trials using various criteria.
Parameters:
query_cond(string): Search by condition/disease (e.g., "Depression", "Breast Cancer")query_term(string): General keyword search across all fieldsquery_intr(string): Search by intervention/treatment (e.g., "Pembrolizumab", "CBT")query_titles(string): Search in study titlesquery_outc(string): Search in outcome measuresquery_spons(string): Search by sponsor namequery_lead(string): Search by lead sponsorquery_id(string): Search by NCT IDquery_patient(string): Search using patient-friendly languagequery_locn(string): Search by location (e.g., "New York", "Mayo Clinic")filter_overallStatus(array): Filter by recruitment status- Valid values: RECRUITING, NOT_YET_RECRUITING, ACTIVE_NOT_RECRUITING, COMPLETED, SUSPENDED, TERMINATED, WITHDRAWN, ENROLLING_BY_INVITATION, AVAILABLE, NO_LONGER_AVAILABLE, APPROVED_FOR_MARKETING, WITHHELD, TEMPORARILY_NOT_AVAILABLE
filter_geo(string): Geographic filter (e.g., "distance(40.7,-74,50mi)")filter_advanced(string): Advanced filter expressionpage_size(integer): Results per page (default 20, max 1000)page_token(string): Token for paginationcount_total(boolean): Include total count of resultssort(array): Sort order (e.g., ["@relevance"])
Example Usage:
Search for recruiting clinical trials about depression with cognitive behavioral therapy:
- query_cond: "Depression"
- query_intr: "Cognitive Behavioral Therapy"
- filter_overallStatus: ["RECRUITING"]
2. get_clinical_trial
Retrieve detailed information about a specific clinical trial by its NCT ID.
Parameters:
nct_id(string, required): The NCT ID of the study (e.g., "NCT04267848")fields(array, optional): Specific fields to return (returns all if not specified)
Example Usage:
Get details for study NCT04267848:
- nct_id: "NCT04267848"
3. get_trial_statistics
Get aggregate statistics about clinical trials.
Parameters:
filter_overallStatus(array): Filter statistics by recruitment statusfilter_geo(string): Geographic filter for statisticsagg_filters(string): Aggregation filter expression
Example Usage:
Get statistics on recruiting trials:
- filter_overallStatus: ["RECRUITING"]
Common Use Cases
1. Finding trials for a specific condition
Use search_clinical_trials with:
- query_cond: "Type 2 Diabetes"
- filter_overallStatus: ["RECRUITING"]
- page_size: 50
2. Finding trials by a specific sponsor
Use search_clinical_trials with:
- query_spons: "National Institute of Mental Health"
- filter_overallStatus: ["RECRUITING", "ACTIVE_NOT_RECRUITING"]
3. Finding trials in a specific location
Use search_clinical_trials with:
- query_cond: "Alzheimer's Disease"
- query_locn: "Stanford"
4. Finding trials with specific interventions
Use search_clinical_trials with:
- query_intr: "Pembrolizumab"
- query_cond: "Melanoma"
5. Getting detailed information about a trial
First search to find NCT IDs, then use get_clinical_trial:
- nct_id: "NCT04267848"
API Details
This server uses the ClinicalTrials.gov API v2, which is a REST API with OpenAPI 3.0 specification.
Base URL: https://clinicaltrials.gov/api/v2
Key Endpoints:
/studies- Search and list studies/studies/{nctId}- Get specific study details/stats- Get aggregate statistics
Rate Limits: The API does not publish specific rate limits, but reasonable use is expected. The server implements timeout handling (30 seconds per request).
Data Structure
Study records contain multiple modules:
-
protocolSection: Core study information
- identificationModule: NCT ID, title, org info
- statusModule: Recruitment status, dates
- descriptionModule: Brief and detailed descriptions
- conditionsModule: Conditions being studied
- designModule: Study design details
- armsInterventionsModule: Study arms and interventions
- outcomesModule: Primary and secondary outcomes
- eligibilityModule: Inclusion/exclusion criteria
- contactsLocationsModule: Contact info and study sites
- referencesModule: Related publications
-
resultsSection: Study results (when available)
-
derivedSection: Computed/derived information
-
documentSection: Supporting documents
Troubleshooting
Connection Issues
If you encounter connection errors:
- Verify internet connectivity
- Check that the ClinicalTrials.gov API is accessible
- Review proxy settings if behind a corporate firewall
No Results Found
If searches return no results:
- Try broader search terms
- Remove filters to see all results
- Check spelling of medical terms
- Try alternative terminology (e.g., "MI" vs "Myocardial Infarction")
Pagination
For large result sets:
- Use
page_sizeto control results per page (max 1000) - Use
page_tokenfrom response to fetch next page - Set
count_total: trueto see total matching studies
References
License
This MCP server is provided as-is for accessing public data from ClinicalTrials.gov. Users must comply with ClinicalTrials.gov Terms and Conditions.
Support
For issues with:
- This MCP server: Create an issue in the repository
- ClinicalTrials.gov API: Contact register@clinicaltrials.gov
- Study data questions: Contact the study sponsor or principal investigator
Version History
1.0.0 (2025-12-02)
- Initial release
- Support for ClinicalTrials.gov API v2
- Search, retrieve, and statistics tools
- Comprehensive field support
- Pagination support
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。