ClinicalTrials.gov MCP Server

ClinicalTrials.gov MCP Server

Enables AI assistants to search and retrieve clinical trial data from ClinicalTrials.gov, supporting filters, study details, metadata, and statistics.

Category
Visit Server

README

ClinicalTrials.gov MCP Server

A Model Context Protocol (MCP) server that provides access to the ClinicalTrials.gov API v2, enabling AI assistants to search and retrieve clinical trial data.

Features

  • Search clinical trials with filters (status, phase, condition, intervention, sponsor, study type)
  • Get detailed study information by NCT ID
  • Retrieve field metadata for available data fields
  • Get search areas and available filters
  • Query dataset statistics
  • API version information

Installation

npm install

Building

npm run build

Running

Local Development (MCP over HTTP)

npm start

The MCP server (Streamable HTTP transport) will be available at:

  • MCP endpoint: http://localhost:3000/mcp
  • Health check: http://localhost:3000/health

Local Development (MCP stdio)

For local MCP client integration via stdio:

npm run start:stdio

Deployment

Vercel (MCP over HTTP)

The server is deployed on Vercel as a remote MCP server (Streamable HTTP transport):

  • MCP endpoint: https://clinicaltrials-mcp-server-three.vercel.app/mcp
  • Health check: https://clinicaltrials-mcp-server-three.vercel.app/health

MCP Configuration

For Remote MCP (Vercel)

Configure your MCP client to use the hosted MCP endpoint:

{
  "mcpServers": {
    "clinicaltrials": {
      "url": "https://clinicaltrials-mcp-server-three.vercel.app/mcp",
      "transport": "http"
    }
  }
}

See MCP_CONFIG_CLAUDE.md, MCP_CONFIG_CURSOR.md, and MCP_CONFIG_DEVIN.md for client-specific setup.

For Local stdio

Add this server to your MCP client configuration:

{
  "mcpServers": {
    "clinicaltrials": {
      "command": "node",
      "args": ["/path/to/clinicaltrials-mcp-server/dist/server.js"]
    }
  }
}

Available Tools

All tools are read-only (annotated readOnlyHint: true) and return both text and structuredContent.

clinicaltrials_search_studies

Search clinical trials with filters. Returns paginated summaries plus an accurate totalCount and hasMore flag.

Parameters:

  • query (string, optional): Full-text search term (maps to query.term)
  • status (enum, optional): Recruitment status (RECRUITING, COMPLETED, ACTIVE_NOT_RECRUITING, etc.)
  • phase (enum, optional): EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4
  • condition (string, optional): Medical condition or disease (maps to query.cond)
  • intervention (string, optional): Intervention or treatment (maps to query.intr)
  • leadSponsor (string, optional): Lead sponsor name (maps to query.spons)
  • studyType (enum, optional): INTERVENTIONAL, OBSERVATIONAL, EXPANDED_ACCESS
  • pageSize (number, optional): Results per page (1-1000, default: 20)
  • pageToken (string, optional): Pagination token for the next page

Example:

{
  "query": "diabetes",
  "status": "RECRUITING",
  "phase": "PHASE2",
  "pageSize": 10
}

clinicaltrials_get_study

Get detailed information about a specific clinical trial by NCT ID.

Parameters:

  • nctId (string, required): ClinicalTrials.gov identifier (e.g., "NCT04000009")

Example:

{
  "nctId": "NCT04000009"
}

clinicaltrials_list_data_fields

List the available data fields in ClinicalTrials.gov study records.

Parameters: None

clinicaltrials_list_search_areas

List available search areas and filters for querying clinical trials.

Parameters: None

clinicaltrials_get_stats

Get statistics about the ClinicalTrials.gov database.

Parameters:

  • query (string, optional): Search term to scope the statistics

clinicaltrials_get_api_version

Get the ClinicalTrials.gov API version information.

Parameters: None

clinicaltrials_search_studies_map

Search trials and render their locations as an interactive world map (an MCP App using @modelcontextprotocol/ext-apps). Markers are colored by recruitment status and clustered; clicking a marker shows trial details and can open the full study. Re-call with refined filters to update the same map. Also returns a text summary as a fallback for clients that don't render MCP Apps.

Parameters:

  • query, condition, intervention, leadSponsor (string, optional): search terms
  • country (string, optional): location term (country/city; maps to query.locn)
  • status (enum, optional), phase (enum, optional), studyType (enum, optional): filters
  • pageSize (number, optional): trials to plot (1-200, default 50)

UI resource: ui://clinicaltrials/map (text/html;profile=mcp-app). Uses each site's geoPoint coordinates from the API. Note: MCP Apps rendering is host-dependent — reliably renders in Goose / VS Code Copilot / Postman / MCPJam; Claude may currently show only the text fallback.

API Reference

This server uses the ClinicalTrials.gov Data API v2, which is a public, unauthenticated REST API.

Base URL: https://clinicaltrials.gov/api/v2

Project Structure

clinicaltrials-mcp-server/
├── src/
│   ├── api-client.ts          # ClinicalTrials.gov API client
│   ├── server.ts              # MCP server setup
│   ├── index.ts               # Main entry point
│   ├── types/
│   │   └── api.ts             # TypeScript type definitions
│   └── tools/
│       ├── search-studies.ts
│       ├── get-study.ts
│       ├── get-study-fields.ts
│       ├── get-search-areas.ts
│       ├── get-dataset-stats.ts
│       └── get-api-version.ts
├── dist/                      # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

Development

This project uses:

  • TypeScript for type safety
  • @modelcontextprotocol/sdk for MCP server implementation
  • Node.js runtime

License

ISC

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured