Clinical Trials MCP Server
This MCP server enables intelligent querying of clinical trials from ClinicalTrials.gov with optimized defaults for finding relevant, currently recruiting trials.
Key Capabilities:
Smart Clinical Trial Search - Search using keywords (e.g., "KRAS G12D"), disease/condition (e.g., "Pancreatic Cancer"), country, or city with automatic filtering for recruiting status and past 3 months
Geographic Search - Find trials near specific coordinates (latitude/longitude) with customizable radius in miles
Comprehensive Trial Details - Retrieve full information using NCT ID including:
Principal investigators and research team
Hospital locations organized by city
Contact information (phone and email)
Eligibility criteria (inclusion/exclusion requirements)
Study descriptions, protocols, and outcome measures
Flexible Filtering - Customize by recruitment status (RECRUITING, COMPLETED, NOT_YET_RECRUITING, etc.), time range (default 3 months), and pagination (up to 100 results per page)
Bilingual Support - Handle queries in both English and Chinese
Structured Output - All responses in JSON format optimized for LLM processing
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Clinical Trials MCP Serverfind recruiting lung cancer trials in New York from the past 3 months"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Clinical Trials MCP Server
English | 简体中文
MCP server for querying clinical trials from ClinicalTrials.gov API v2. Provides intelligent search with defaults optimized for finding relevant, currently recruiting trials.
功能特性 Features
🔍 Smart Search: Keywords, disease type, location-based search
📍 Geographic: Search by country, city, or coordinates
⏰ Time Filters: Default to past 3 months (recruiting trials)
📊 Detailed Info: Complete trial details including PI, contacts, eligibility
🌐 Bilingual: Supports Chinese and English queries
Related MCP server: Clinical Trials MCP Server
Quick Start with npx
No installation required! Run directly:
npx xiaoyibao-clinical-trialsMCP Client Configuration
Add to your MCP client settings:
Using npx (Recommended)
{
"mcpServers": {
"clinical-trials": {
"command": "npx",
"args": ["-y", "xiaoyibao-clinical-trials"]
}
}
}Using local installation
npm install -g xiaoyibao-clinical-trials{
"mcpServers": {
"clinical-trials": {
"command": "xiaoyibao-clinical-trials"
}
}
}Available Tools
1. search_clinical_trials
Search for clinical trials with intelligent defaults.
Default Behavior:
Status:
RECRUITING(currently recruiting)Time: Past 3 months (trials more likely to be open)
Results: 30 most relevant trials, sorted by recent updates
Parameters:
keywords(string): Keywords like "KRAS G12D", "PD-1", "Pembrolizumab"condition(string): Disease/condition like "Pancreatic Cancer", "肠癌"country(string): Country name like "China", "United States", "中国"city(string): City name like "Beijing", "上海", "New York"months(number): Time range in months (default: 3)status(string): Recruitment status (default: "RECRUITING")pageSize(number): Results per page (default: 30, max: 100)pageToken(string): Pagination token
Example:
{
"keywords": "KRAS G12D",
"condition": "Pancreatic Cancer",
"country": "China"
}2. get_trial_details
Get comprehensive trial details including:
Principal Investigators (PI) information
Hospital locations by city
Contact details (phone, email)
Detailed study description
Eligibility criteria (inclusion/exclusion)
Primary/secondary outcomes
Parameters:
nctId(string, required): NCT number like "NCT04852770"
Example:
{
"nctId": "NCT04852770"
}3. search_by_location
Search trials by geographic coordinates.
Parameters:
latitude(number, required): Latitudelongitude(number, required): Longituderadius(number): Search radius in miles (default: 50)condition(string): Disease/condition (optional)keywords(string): Keywords (optional)status(string): Recruitment status (default: "RECRUITING")months(number): Time range (default: 3)pageSize(number): Results per page (default: 30)
Example:
{
"latitude": 39.9042,
"longitude": 116.4074,
"radius": 50,
"condition": "Lung Cancer"
}Output Format
All responses are in JSON format, optimized for LLM processing.
Search Results
{
"totalCount": 13,
"count": 13,
"studies": [
{
"nctId": "NCT06218914",
"title": "Phase 1 Study to Investigate TCRTs KRAS Mutation...",
"status": "RECRUITING",
"conditions": ["Pancreatic Cancer", "KRAS G12D"],
"interventions": [{"type": "Drug", "name": "NT-112"}],
"sponsor": "AstraZeneca",
"studyType": "INTERVENTIONAL",
"phase": ["PHASE1"],
"lastUpdate": "2024-10-15"
}
]
}Trial Details
Includes all search fields plus:
investigators[]- PI and research teamoverallOfficials[]- Study officialscentralContacts[]- Global contact info (phone, email)locations[]- All hospital sites with local contactslocationsSummary- Statistics (countries, cities, total sites)eligibility- Detailed inclusion/exclusion criteriaprimaryOutcomes[],secondaryOutcomes[]- Study endpointsbriefSummary,detailedDescription- Full study description
Toolchain Prompt Guidance
To ensure stability, accuracy, and user experience when calling this MCP service, we provide dedicated toolchain prompt documentation. These prompts are not just optional references—they are essential foundations for using this service effectively.
Why Toolchain Prompts Matter
Stability: Prompts standardize tool-calling sequences (search → details → structured output), preventing LLM from making arbitrary calls that result in low efficiency or messy results.
Accuracy: Clear parameter-selection rules and location-filtering logic ensure search results match patient questions precisely (e.g., drug name + province like GFH276 + Zhejiang hospitals).
User Experience: A unified four-part output structure (conclusion first → evidence & explanation → key tips → risks & channel reminders) helps patients/families understand quickly, avoid risks, and find next-step support.
Prompt Files & Usage Methods
1. Compact Version (Recommended for Production)
Purpose: Use directly as the system prompt / developer prompt for MCP clients (e.g., Claude Desktop).
Benefits: Concise and powerful; contains all core rules and scenarios; minimizes token waste.
How to use:
Copy or reference the file content into your LLM's system prompt.
LLM will automatically call
search_clinical_trialsandget_trial_detailsfollowing the toolchain rules.Output will auto-organize into the four-part structure, optimized for patient/family reading.
2. Full Version (Reference & Documentation)
Purpose: Detailed explanations and additional scenarios for developers to understand or customize.
When to use:
Need to understand the full toolchain design philosophy.
Adding new clinical query scenarios.
Team training or documentation reference.
Typical Usage Scenarios
Scenario 1: Query GFH276 + Zhejiang Hospitals
Patient question → Search GFH276 (keyword) + China (country)
→ Get NCT number (e.g., NCT07198321)
→ Query trial details & hospital locations
→ Filter hospitals in Zhejiang cities (Hangzhou/Ningbo/Wenzhou, etc.)
→ Output in four-part structureScenario 2: Find Trials Near Patient
Patient question (with city or coordinates) → Use search_by_location or search_clinical_trials (city param)
→ List trials in patient's city/nearby
→ Call get_trial_details for key trials
→ Output in four-part structureIntegration Recommendations
Claude Desktop Users: Paste
CLINICAL_TRIALS_PROMPT_REFERENCE_COMPACT.mdcontent into your Claude Desktop custom system prompt, or reference the file at conversation start.Other MCP Clients: Based on your client's system prompt / instruction configuration, integrate the prompt content accordingly.
API Callers: If using this MCP via API, include the compact prompt version in your system prompt parameter to ensure every call follows the standard.
Commitment to Stability
We commit to long-term stability of toolchain prompts. When updating:
Backward compatibility of core rules is maintained.
Breaking changes (if any) are clearly marked in git commits.
Migration guides and version cross-reference docs are provided.
Welcome feedback or improvement suggestions! Contact us via GitHub issue or the "XiaoYiBao Assistant" WeChat official account.
API Reference
Development
# Clone repository
git clone https://github.com/PancrePal-xiaoyibao/xiaoyibao-clinical-trials-mcp-server.git
cd xiaoyibao-clinical-trials-mcp-server
# Install dependencies
npm install
# Run tests
npm test
# Start server
npm startPublishing to npm
# Login to npm
npm login
# Publish package
npm publishLicense
MIT
Contributing
Contributions welcome! Please open an issue or submit a pull request.
Speical thanks to the contribution & development of Xiaoyibao-Pancrepal & xiao-x-bao community to support cancer/rare disease patients and their families with ❤️ & AI!
Available Tools
3 toolsget_trial_detailsC
获取指定临床试验的详细信息,包括:PI研究者信息、各地医院地点、联系方式(电话/邮箱)、详细研究介绍、入选/排除标准、结果指标等全面信息
| Name | Required | Description | Default |
|---|---|---|---|
| nctId | Yes | NCT编号,例如:NCT04852770 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. While it clearly describes what information will be returned, it doesn't address important behavioral aspects: whether this is a read-only operation, potential rate limits, authentication requirements, error conditions, or response format. The description states what data is included but not how the tool behaves operationally.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured as a single sentence that clearly states the purpose and enumerates the specific data fields included. It's appropriately sized for a tool with one parameter and no annotations. While it could be slightly more concise by removing some redundancy in the field list, every element serves a purpose in clarifying what information will be returned.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (retrieving detailed clinical trial information), lack of annotations, and absence of an output schema, the description is minimally adequate. It clearly states what information will be returned but doesn't address behavioral aspects, usage context, or response structure. For a data retrieval tool with no output schema, more detail about the return format would be helpful, but the description covers the essential purpose.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the single parameter 'nctId' well-documented as 'NCT编号,例如:NCT04852770'. The description doesn't add any parameter information beyond what's in the schema - it doesn't explain the NCT ID format further or provide additional context about parameter usage. With complete schema coverage, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '获取指定临床试验的详细信息' (get detailed information for a specified clinical trial). It specifies the verb ('获取' - get) and resource ('临床试验的详细信息' - clinical trial details), and lists specific data fields included (PI researcher info, hospital locations, contact info, study description, criteria, outcome measures). However, it doesn't explicitly distinguish this from sibling tools like 'search_clinical_trials' or 'search_by_location' which likely return different types of results.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling tools at all, nor does it explain that this tool retrieves detailed information for a specific trial (using NCT ID) while the search tools likely return lists of trials based on criteria. There's no context about prerequisites, limitations, or appropriate use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_by_locationB
根据地理坐标搜索附近的临床试验。默认查询招募中且3个月内更新的30个最相关结果。
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | 纬度 | |
| longitude | Yes | 经度 | |
| radius | No | 搜索半径(英里),默认50英里 | |
| condition | No | 疾病或状况(可选) | |
| keywords | No | 关键词(可选) | |
| status | No | 招募状态,默认RECRUITING | RECRUITING |
| months | No | 时间范围(月),默认3个月 | |
| pageSize | No | 每页返回的结果数量,默认30 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: default query settings (recruiting status, 3-month updates, 30 most relevant results), which helps the agent understand the tool's behavior beyond the input schema. However, it lacks details on rate limits, error handling, or output format, leaving gaps in behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose and includes key default behaviors. It avoids unnecessary details, making it appropriately sized for the tool's complexity. However, it could be slightly more structured by separating purpose from default settings for clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (8 parameters, no output schema, no annotations), the description is adequate but has clear gaps. It covers the purpose and default behaviors, but lacks information on output format, error cases, or how results are ranked. Without annotations or output schema, the description should provide more context to be fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds minimal value by implying the tool uses default values for some parameters (e.g., status, months, pageSize), but does not provide additional semantic context beyond what the schema offers. Baseline score of 3 is appropriate given high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '根据地理坐标搜索附近的临床试验' (search for nearby clinical trials based on geographic coordinates). It specifies the verb ('搜索' - search) and resource ('临床试验' - clinical trials), but does not explicitly differentiate from sibling tools like 'search_clinical_trials' or 'get_trial_details', which likely have different search criteria or retrieval methods.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by mentioning default settings (e.g., recruiting status, 3-month updates, 30 results), but does not explicitly state when to use this tool versus alternatives like 'search_clinical_trials' or 'get_trial_details'. It provides some operational context but lacks clear guidance on tool selection among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_clinical_trialsA
搜索临床试验。默认查询招募中且过去3个月内更新的试验,按更新时间降序返回30个最相关结果。支持根据关键词(如KRAS-12D)、疾病类型(如胰腺癌)、地理位置(国家/城市)等条件查询。
| Name | Required | Description | Default |
|---|---|---|---|
| keywords | No | 关键词,例如:KRAS-12D、PD-1、Pembrolizumab等 | |
| condition | No | 疾病或状况,例如:胰腺癌、肺癌、Pancreatic Cancer等 | |
| country | No | 国家,例如:中国、美国、China、United States等 | |
| city | No | 城市名称,例如:北京、上海、Beijing等 | |
| months | No | 查询过去N个月的临床试验,默认3个月(推荐:3个月内的更有可能还在招募) | |
| status | No | 招募状态,默认RECRUITING(招募中)。其他选项:COMPLETED、NOT_YET_RECRUITING等。多个状态用逗号分隔 | RECRUITING |
| pageSize | No | 每页返回的结果数量,默认30,最大100(推荐:20-30个最相关结果已足够) | |
| pageToken | No | 分页令牌,用于获取下一页结果 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: default query scope (recruiting status, past 3 months), sorting order (by update time descending), result limit (30 most relevant), and pagination support. It also mentions practical recommendations (e.g., '3个月内的更有可能还在招募'). However, it doesn't cover error conditions or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured in two sentences: first states purpose and defaults, second lists supported search criteria. Every element adds value with zero waste, making it easy to parse and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a search tool with 8 parameters, 100% schema coverage, but no annotations or output schema, the description provides adequate context about behavior and defaults. However, without an output schema, it doesn't describe the structure or format of returned results, which is a significant gap for a search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds minimal value beyond the schema - it mentions the same search criteria (keywords, disease type, location) but doesn't provide additional semantic context or usage examples not already in the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '搜索临床试验' (search clinical trials) with specific scope (recruiting trials updated in the past 3 months, returning 30 most relevant results). It distinguishes from 'get_trial_details' (which likely retrieves specific trial details) but doesn't explicitly differentiate from 'search_by_location' (which might be a more specialized location search).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context through default behaviors (recruiting status, 3-month timeframe, 30 results) and mentions support for various search criteria. However, it doesn't explicitly state when to use this tool versus 'search_by_location' or provide clear exclusions/alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
The three tools have distinct primary purposes: get_trial_details retrieves comprehensive information for a specific trial, search_by_location focuses on geographic proximity, and search_clinical_trials provides general keyword-based searching. However, there is some overlap between the two search tools, as both can filter by location and return similar result sets, which could cause minor confusion for agents.
All tool names follow a consistent verb_noun pattern using snake_case: get_trial_details, search_by_location, and search_clinical_trials. The naming is predictable and readable, with clear action-object relationships throughout the set.
With only three tools, the server feels thin for a clinical trials domain that typically involves complex queries and data retrieval. While the tools cover key functions, the count is borderline low, as agents might expect additional operations like filtering by status, saving searches, or accessing trial phases and outcomes more granularly.
The tool set covers basic retrieval and searching, but there are notable gaps for a clinical trials server. For example, there are no tools for updating trial information, managing user preferences, accessing historical data, or handling more advanced analytics. The surface is functional but incomplete for comprehensive agent workflows in this domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Clinical trial search and status from ClinicalTrials.gov
Search ClinicalTrials.gov — find studies, retrieve results, match patients to eligible trials.
Search 36M+ PubMed biomedical articles and ClinicalTrials.gov studies.
Provide structured access to ClinicalTrials.gov data for searching, retrieving, and analyzing clin…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables 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.5
- AlicenseBqualityDmaintenanceProvides programmatic access to ClinicalTrials.gov API with 18 specialized tools for searching, analyzing, and retrieving detailed information about 400,000+ clinical trials worldwide, including filtering by condition, location, phase, sponsor, eligibility criteria, and outcomes.17204MIT
- FlicenseBqualityDmaintenanceProvides access to the ClinicalTrials.gov API, enabling search, analysis, and retrieval of clinical trial data through MCP tools.178
- FlicenseNot gradedqualityDmaintenanceEnables searching and retrieving detailed clinical trial information from ClinicalTrials.gov via the official API.1
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PancrePal-xiaoyibao/xiaoyibao-clinical-trials-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server