Unofficial Clinical Trials MCP Server
Click on "Deploy 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., "@Unofficial Clinical Trials MCP Server search for phase 3 breast cancer trials"
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.

Unofficial Clinical Trials MCP Server
A comprehensive Model Context Protocol (MCP) server that provides access to the ClinicalTrials.gov API, enabling researchers, clinicians, and developers to access real-time clinical trial data programmatically.
Developed by Augmented Nature
Overview
The Clinical Trials MCP server exposes the full ClinicalTrials.gov API v2.0.4 functionality through 18 specialized MCP tools, allowing you to search, analyze, and retrieve detailed information about clinical trials worldwide directly from your MCP-enabled environment.
Related MCP server: ClinicalTrials-MCP
Features
Core Search Tools
search_studies - General search with comprehensive filters (condition, intervention, location, phase, status, age, sex)
get_study_details - Detailed study information by NCT ID with complete metadata
search_by_condition - Condition-focused search with eligibility criteria
search_by_location - Geographic-based search with distance radius filtering
search_by_sponsor - Organization and sponsor-based search with sponsor type filtering
search_by_intervention - Treatment, drug, and intervention-focused search
Specialized Search Tools
get_recruiting_studies - Currently recruiting trials with active contact information
search_by_date_range - Temporal search by study start and completion dates
get_studies_with_results - Completed trials with published results
search_rare_diseases - Specialized search for rare diseases and orphan conditions
get_pediatric_studies - Pediatric-specific trials for children and adolescents
search_international_studies - Multi-country international trials
Advanced Analysis Tools
get_similar_studies - Find studies similar to a reference NCT ID by condition, sponsor, or phase
search_by_primary_outcome - Search by primary outcome measures and endpoints
search_by_eligibility_criteria - Advanced eligibility filtering with inclusion/exclusion keywords
get_study_timeline - Timeline analysis with current, completed, and upcoming studies
get_trial_statistics - Aggregate statistics and analytics with grouping capabilities
Data Quality Features
Real-time data access (updated daily Monday-Friday)
NCT ID validation with regex patterns
Comprehensive JSON Schema validation
Geographic coordinate data for study locations
Contact information for recruiting studies
Robust error handling and timeout protection
Installation
Prerequisites
Node.js 16+ (install from nodejs.org)
No API key required (ClinicalTrials.gov API is publicly accessible)
Setup Steps
Navigate to your MCP directory:
cd ~/Documents/Claude/MCP # or your preferred MCP directoryThe server is already built and configured:
ls clinical-trials-server/ # Should show: build/ src/ package.json tsconfig.json README.mdVerify build:
cd clinical-trials-server ls build/ # Should show: index.js (executable)
Configuration
Add this to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"clinical-trials": {
"command": "node",
"args": ["path/to/clinical-trials-server/build/index.js"],
"autoApprove": [
"search_studies",
"get_study_details",
"search_by_condition",
"search_by_location",
"get_recruiting_studies",
"search_by_sponsor",
"search_by_intervention",
"get_trial_statistics"
]
}
}
}Note: Replace path/to/clinical-trials-server with the absolute path to your server directory.
Usage Examples
Search for Cancer Trials
{
"condition": "cancer",
"phase": "PHASE3",
"status": "RECRUITING",
"pageSize": 10
}Get Detailed Study Information
{
"nctId": "NCT05882279"
}Find Trials by Location
{
"country": "United States",
"city": "Boston",
"distance": 50,
"pageSize": 5
}Search for Pediatric Studies
{
"condition": "diabetes",
"ageRange": "CHILD",
"recruitmentStatus": "RECRUITING"
}Get Recruiting Trials with Contacts
{
"condition": "alzheimer",
"location": "California",
"pageSize": 5
}Find Similar Studies
{
"nctId": "NCT12345678",
"similarityType": "CONDITION",
"pageSize": 10
}Advanced Eligibility Search
{
"minAge": "18 Years",
"maxAge": "65 Years",
"sex": "ALL",
"healthyVolunteers": false,
"condition": "hypertension",
"inclusionKeywords": "medication",
"exclusionKeywords": "pregnant"
}Get Trial Statistics
{
"groupBy": "phase",
"filters": {
"condition": "diabetes",
"status": "RECRUITING"
}
}API Reference
Search Parameters
Common Parameters:
pageSize- Number of results (1-100, default: 10)condition- Medical condition or diseasephase- Study phase: PHASE1, PHASE2, PHASE3, PHASE4, NAstatus- Recruitment status: RECRUITING, NOT_YET_RECRUITING, COMPLETED, etc.
Location Parameters:
country- Country namestate- State or provincecity- City namedistance- Search radius in miles (1-500)
Eligibility Parameters:
sex- ALL, FEMALE, MALEage- CHILD, ADULT, OLDER_ADULTminAge/maxAge- Age ranges (e.g., "18 Years", "65 Years")healthyVolunteers- Boolean for healthy volunteer acceptance
Date Parameters:
startDateFrom/startDateTo- Study start date range (YYYY-MM-DD)completionDateFrom/completionDateTo- Completion date range (YYYY-MM-DD)
Response Format
All tools return structured JSON data including:
Study metadata (NCT ID, title, status, phase, sponsor)
Location information with geographic coordinates
Eligibility criteria and contact information
Timeline data and key dates
Comprehensive search criteria documentation
NCT ID Format
All NCT IDs must follow the pattern: NCT######## (NCT followed by 8 digits)
Error Handling
The server includes comprehensive error handling for:
Network Issues: 30-second timeout protection with retry logic
Invalid Parameters: JSON Schema validation with descriptive error messages
API Errors: Proper HTTP status code handling and error reporting
Missing Data: Graceful handling of optional fields and missing information
Rate Limiting: Built-in request throttling and error recovery
Common error responses include:
{
"error": "Clinical Trials API error: Invalid NCT ID format",
"isError": true
}Development
Building from Source
# Install dependencies
npm install
# Build TypeScript to JavaScript
npm run build
# Development with watch mode
npm run watchProject Structure
clinical-trials-server/
├── src/
│ └── index.ts # Main server implementation (all tools)
├── build/
│ └── index.js # Compiled executable
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This fileKey Dependencies
@modelcontextprotocol/sdk- MCP server frameworkaxios- HTTP client for API requestsTypeScript for type safety and development
Data Sources
API Endpoint: https://clinicaltrials.gov/api/v2 Data Updates: Monday through Friday (excluding federal holidays) Coverage: 400,000+ studies from 220+ countries Data Quality: Official FDA/NIH registry with verified information
Troubleshooting
Server Connection Issues:
# Test server manually cd clinical-trials-server node build/index.js # Should show: "Clinical Trials MCP server running on stdio"Invalid NCT ID Errors:
Ensure NCT IDs follow format: NCT########
Example: NCT05882279 ✓, nct123 ✗
No Results Returned:
Check search criteria - try broader terms
Some filters may be too restrictive
Verify spelling of conditions and interventions
Timeout Issues:
Server has 30-second timeout protection
Large result sets may take time to process
Reduce pageSize for faster responses
Clinical Research Use Cases
Patient Recruitment: Find actively recruiting trials for specific conditions
Competitive Analysis: Research similar studies by sponsors or interventions
Site Selection: Identify optimal locations for new studies
Regulatory Research: Access FDA-approved study protocols and outcomes
Academic Research: Analyze clinical trial trends and statistics
Patient Care: Help patients find appropriate treatment options
Compliance & Ethics
This server provides access to publicly available clinical trial data from ClinicalTrials.gov. Users should:
Follow institutional policies for clinical research
Respect patient privacy and confidentiality
Use data for legitimate research and healthcare purposes
Cite ClinicalTrials.gov as the data source in publications
License
MIT License - See LICENSE file for details
Data Source: ClinicalTrials.gov (https://clinicaltrials.gov) API Documentation: https://clinicaltrials.gov/data-api/api Server Version: 0.1.0
Available Tools
17 toolsget_pediatric_studiesB
Find clinical trials specifically designed for children and adolescents
Inputs: condition, ageRange, recruitmentStatus, pageSize.
get_recruiting_studiesB
Get currently recruiting clinical trials with contact information
Inputs: condition, location, ageGroup, pageSize.
get_similar_studiesA
Find clinical trials similar to a specific study by NCT ID
Inputs: nctId (required), similarityType, pageSize.
get_studies_with_resultsA
Find completed clinical trials that have published results
Inputs: condition, intervention, completedAfter, pageSize.
get_study_detailsC
Get detailed information about a specific clinical trial
Inputs: nctId (required).
get_study_timelineC
Get detailed timeline and milestone information for studies
Inputs: condition, sponsor, phase, timelineType, +1 more.
get_trial_statisticsC
Get aggregate statistics about clinical trials
Inputs: groupBy, filters.
search_by_conditionA
Search for clinical trials focusing on specific medical conditions
Inputs: condition (required), phase, recruitmentStatus, pageSize.
search_by_date_rangeA
Search clinical trials by start or completion date range
Inputs: startDateFrom, startDateTo, completionDateFrom, completionDateTo, +2 more.
search_by_eligibility_criteriaC
Advanced search based on detailed eligibility criteria
Inputs: minAge, maxAge, sex, healthyVolunteers, +4 more.
search_by_interventionB
Search clinical trials by intervention or treatment type
Inputs: intervention (required), interventionType, phase, pageSize.
search_by_locationB
Find clinical trials by geographic location
Inputs: country, state, city, facilityName, +2 more.
search_by_primary_outcomeB
Search clinical trials by primary outcome measures or endpoints
Inputs: outcome (required), condition, phase, pageSize.
search_by_sponsorB
Search clinical trials by sponsor or organization
Inputs: sponsor (required), sponsorType, pageSize.
search_international_studiesB
Find multi-country international clinical trials
Inputs: condition, excludeCountry, includeCountry, minCountries, +2 more.
search_rare_diseasesA
Search clinical trials for rare diseases and orphan conditions
Inputs: rareDisease (required), recruitmentStatus, pageSize.
search_studiesC
Search for clinical trials with various filters
Inputs: query, condition, intervention, location, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools have distinct purposes, but 'search_studies' is a general search that may overlap with the more specific search tools (e.g., search_by_condition). However, descriptions help differentiate them.
All tools follow a consistent verb_noun pattern: 'get_' for retrieval and 'search_' for queries. No mixing of conventions.
17 tools cover a broad range of clinical trial queries without being excessive. The count is well-scoped for a query-focused server.
The tool set covers major search dimensions (condition, location, sponsor, etc.) and details. Missing search by phase or combined filters, but overall comprehensive for read-only access.
Maintenance
Related MCP Connectors
Provide structured access to ClinicalTrials.gov data for searching, retrieving, and analyzing clin…
Search ClinicalTrials.gov: find studies, retrieve results, match patients to candidate trials.
Clinical trial search and status from ClinicalTrials.gov
Search and read ClinicalTrials.gov studies, sites and outcomes.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables searching and retrieving detailed clinical trial information from ClinicalTrials.gov via the official API.1-
- FlicenseNot gradedqualityDmaintenanceEnables searching clinical trials, retrieving trial details, matching patient profiles to recruiting trials, and extracting eligibility criteria from ClinicalTrials.gov.-
- AlicenseNot gradedqualityAmaintenanceEnables searching ClinicalTrials.gov studies, retrieving full records and posted results, discovering API fields, and matching patient demographics to candidate recruiting trials via MCP over STDIO or Streamable HTTP.2,484 npmApache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables searching ClinicalTrials.gov studies, retrieving detailed study records and posted results, and matching patient profiles to candidate recruiting trials through MCP over STDIO or Streamable HTTP.2,484 npmApache 2.0