Harvard ClinicalTrials MCP Server for Mastra AIGive Mastra AI instant access to 16 tools to Get Api Version, Get Study, Get Study Results, and more
Mastra AI is a TypeScript-native agent framework built for modern web stacks. Connect Harvard ClinicalTrials through Vinkius and Mastra agents discover all tools automatically. type-safe, streaming-ready, and deployable anywhere Node.js runs.
Ask AI about this MCP Server for Mastra AI
The Harvard ClinicalTrials MCP Server for Mastra AI is a standout in the Data Analytics category — giving your AI agent 16 tools to work with, ready to go from day one.
Vinkius delivers Streamable HTTP and SSE to any MCP client
import { Agent } from "@mastra/core/agent";
import { createMCPClient } from "@mastra/mcp";
import { openai } from "@ai-sdk/openai";
async function main() {
// Your Vinkius token. get it at cloud.vinkius.com
const mcpClient = await createMCPClient({
servers: {
"harvard-clinicaltrials": {
url: "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
},
},
});
const tools = await mcpClient.getTools();
const agent = new Agent({
name: "Harvard ClinicalTrials Agent",
instructions:
"You help users interact with Harvard ClinicalTrials " +
"using 16 tools.",
model: openai("gpt-4o"),
tools,
});
const result = await agent.generate(
"What can I do with Harvard ClinicalTrials?"
);
console.log(result.text);
}
main();
* Every MCP server runs on Vinkius-managed infrastructure inside AWS - a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts optimized for native MCP execution. See our infrastructure
About Harvard ClinicalTrials MCP Server
Connect to the ClinicalTrials.gov API v2 — the largest database of clinical studies worldwide, maintained by the U.S. National Library of Medicine.
Mastra's agent abstraction provides a clean separation between LLM logic and Harvard ClinicalTrials tool infrastructure. Connect 16 tools through Vinkius and use Mastra's built-in workflow engine to chain tool calls with conditional logic, retries, and parallel execution. deployable to any Node.js host in one command.
What you can do
- Study Search — Search 400K+ clinical trials from 220+ countries
- Condition Filter — Find trials for specific diseases (cancer, diabetes, Alzheimer's)
- Intervention Filter — Search by drug, device, or therapy name
- Sponsor Search — Find trials by organization (Pfizer, NIH, Roche)
- Phase Filter — Filter by Phase 1-4 to track drug development stages
- Recruiting — Find trials currently enrolling participants
- Location — Search by city or country for accessible trials
- FDA Regulated — Filter for FDA-regulated drug and device trials
- Pediatric — Find trials including children
- Rare Diseases — Discover research for orphan conditions
- Results — Get outcome data from completed studies
The Harvard ClinicalTrials MCP Server exposes 16 tools through the Vinkius. Connect it to Mastra AI in under two minutes — credentials fully managed, no infrastructure to provision, no vendor lock-in. Your configuration, your data, your control.
All 16 Harvard ClinicalTrials tools available for Mastra AI
When Mastra AI connects to Harvard ClinicalTrials through Vinkius, your AI agent gets direct access to every tool listed below — spanning clinical-trials, medical-research, drug-development, and more. Every call runs in a secure, isolated environment with full audit visibility. Beyond a simple connection, you get real-time monitoring of agent activity, enterprise governance, and optimized token usage.
Get api version on Harvard ClinicalTrials
gov API version and the timestamp of the most recent data update. Useful for verifying data currency and API availability. Get API version and data timestamp
Get study on Harvard ClinicalTrials
g. "NCT04368728"). Returns title, status, phase, enrollment, conditions, interventions, eligibility criteria, sponsor, and study locations. Get clinical trial details by NCT ID
Get study results on Harvard ClinicalTrials
Not all trials report results — this is most useful for completed Phase 2-4 studies. Get primary outcome results for a trial
Get study timeline on Harvard ClinicalTrials
Essential for understanding the progress and currency of a study. Get the complete timeline of a clinical trial
Search by condition on Harvard ClinicalTrials
Examples: "diabetes", "breast cancer", "Alzheimer disease", "COVID-19", "depression", "hypertension". Search trials by medical condition
Search by intervention on Harvard ClinicalTrials
Examples: "pembrolizumab", "metformin", "radiation therapy", "cognitive behavioral therapy". Search trials by drug or treatment
Search by location on Harvard ClinicalTrials
Essential for finding trials accessible to patients in a particular area. Search trials by geographic location
Search by phase on Harvard ClinicalTrials
Phase values: "PHASE1", "PHASE2", "PHASE3", "PHASE4", "EARLY_PHASE1". Phase 3 trials are the largest and most definitive, while Phase 1 trials focus on safety. Search trials by study phase
Search by sponsor on Harvard ClinicalTrials
Examples: "Pfizer", "National Cancer Institute", "Roche", "Novartis", "NIH". Search trials by sponsoring organization
Search completed on Harvard ClinicalTrials
Completed trials are more likely to have published results and outcomes data. Search completed clinical trials
Search device trials on Harvard ClinicalTrials
Covers diagnostic devices, surgical tools, implants, and digital health technologies. Search medical device clinical trials
Search fda regulated on Harvard ClinicalTrials
S. Food and Drug Administration. These trials follow the most rigorous regulatory standards. Search FDA-regulated drug trials
Search pediatric on Harvard ClinicalTrials
Essential for pediatricians, child health researchers, and parents seeking trials for children. Search pediatric clinical trials
Search rare diseases on Harvard ClinicalTrials
Examples: "cystic fibrosis", "sickle cell disease", "Huntington disease", "amyotrophic lateral sclerosis". Search rare disease clinical trials
Search recruiting on Harvard ClinicalTrials
Essential for patients seeking to enroll in trials or researchers tracking active studies. Search for currently recruiting studies
Search studies on Harvard ClinicalTrials
gov database of over 400,000 clinical studies from 200+ countries. Returns NCT IDs, titles, status, phases, sponsors, conditions, interventions, and locations. Search 400K+ clinical trials worldwide
Connect Harvard ClinicalTrials to Mastra AI via MCP
Follow these steps to wire Harvard ClinicalTrials into Mastra AI. The entire setup takes under two minutes — your credentials stay safe behind Vinkius.
Install dependencies
npm install @mastra/core @mastra/mcp @ai-sdk/openaiReplace the token
[YOUR_TOKEN_HERE] with your Vinkius tokenRun the agent
agent.ts and run with npx tsx agent.tsExplore tools
Why Use Mastra AI with the Harvard ClinicalTrials MCP Server
Mastra AI provides unique advantages when paired with Harvard ClinicalTrials through the Model Context Protocol.
Mastra's agent abstraction provides a clean separation between LLM logic and tool infrastructure. add Harvard ClinicalTrials without touching business code
Built-in workflow engine chains MCP tool calls with conditional logic, retries, and parallel execution for complex automation
TypeScript-native: full type inference for every Harvard ClinicalTrials tool response with IDE autocomplete and compile-time checks
One-command deployment to any Node.js host. Vercel, Railway, Fly.io, or your own infrastructure
Harvard ClinicalTrials + Mastra AI Use Cases
Practical scenarios where Mastra AI combined with the Harvard ClinicalTrials MCP Server delivers measurable value.
Automated workflows: build multi-step agents that query Harvard ClinicalTrials, process results, and trigger downstream actions in a typed pipeline
SaaS integrations: embed Harvard ClinicalTrials as a first-class tool in your product's AI features with Mastra's clean agent API
Background jobs: schedule Mastra agents to query Harvard ClinicalTrials on a cron and store results in your database automatically
Multi-agent systems: create specialist agents that collaborate using Harvard ClinicalTrials tools alongside other MCP servers
Example Prompts for Harvard ClinicalTrials in Mastra AI
Ready-to-use prompts you can give your Mastra AI agent to start working with Harvard ClinicalTrials immediately.
"Find recruiting Phase 3 trials for breast cancer immunotherapy"
"Search for Alzheimer's disease trials sponsored by NIH in Boston"
"Find pediatric clinical trials for cystic fibrosis"
Troubleshooting Harvard ClinicalTrials MCP Server with Mastra AI
Common issues when connecting Harvard ClinicalTrials to Mastra AI through Vinkius, and how to resolve them.
createMCPClient not exported
npm install @mastra/mcpHarvard ClinicalTrials + Mastra AI FAQ
Common questions about integrating Harvard ClinicalTrials MCP Server with Mastra AI.
How does Mastra AI connect to MCP servers?
MCPClient with the server URL and pass it to your agent. Mastra discovers all tools and makes them available with full TypeScript types.Can Mastra agents use tools from multiple servers?
Does Mastra support workflow orchestration?
Explore More MCP Servers
View all →
Momence
10 toolsManage sessions, members, teachers, memberships, and bookings for your Momence-powered fitness or yoga studio through natural conversation.

Tango
12 toolsDocument any process by recording your screen clicks and turning them into step-by-step guides with annotated screenshots.

SafeGraph
10 toolsIntegrate SafeGraph's premier geospatial dataset into your AI. Discover detailed POIs, analyze foot traffic patterns, and process precise building geometries seamlessly from conversational prompts.

DataRobot
6 toolsManage AutoML via DataRobot — monitor projects and models, track deployments, and audit ML datasets directly from any AI agent.
