ClinicalTrialsGov

MCP server for the ClinicalTrials.gov v2 API enabling search, retrieval, trends, comparison, and patient matching.
  • typescript

54

GitHub Stars

typescript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You can run and connect to the ClinicalTrials.gov v2 MCP server to search trials, retrieve study details, compare studies, analyze trends, and match patients to eligible trials. This MCP server supports both stdio (local) and HTTP (remote) transports, and can be deployed to Cloudflare Workers for edge hosting.

How to use

To start using the ClinicalTrials.gov MCP server, configure your MCP client with either a remote HTTP endpoint or a local stdio process. The server exposes seven specialized tools for working with ClinicalTrials.gov data, including search, retrieval, results, field values, trends analysis, comparisons, and patient-trial matching. Use the client to perform complex queries, analyze data, and match patients to eligible studies.

How to install

Prerequisites: you will need Bun installed (version 1.2.0 or higher). You will also need a suitable MCP client to connect to the server via stdio or HTTP.

Publicly hosted instance: you can point your MCP client at the public endpoint directly.

Self-hosted / local installation steps are shown below.

# Public hosted instance example (no install required)
{
  "mcpServers": {
    "clinicaltrials_http": {
      "type": "http",
      "url": "https://clinicaltrials.caseyjhand.com/mcp",
      "args": []
    }
  }
}
# Self-hosted / local (stdio) example to run the server via Bun
# This uses the provided container image / package and runs the MCP server locally
{
  "mcpServers": {
    "clinicaltrials_stdio": {
      "type": "stdio",
      "command": "bunx",
      "args": ["clinicaltrialsgov-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info"
      }
    }
  }
}
# Alternative transport via Streamable HTTP (if you prefer HTTP streamable)
{
  "mcpServers": {
    "clinicaltrials_http": {
      "type": "http",
      "url": "https://clinicaltrials.caseyjhand.com/mcp",
      "args": []
    }
  }
}

Additional sections

Configuration, security, and practical usage notes follow to help you deploy and operate the MCP server smoothly.

Configuration details

All configuration is centralized and validated at startup. Key environment variables shape how the server runs, including transport, authentication, storage, logging, and tracing.

Security and authentication

The server supports multiple authentication modes, and you can configure credentials or tokens as needed. Ensure your secrets are stored securely and access is restricted to trusted clients.

Examples and usage notes

When you configure a client to use the HTTP endpoint, you simply point the client to https://clinicaltrials.caseyjhand.com/mcp and include the appropriate mcpServers configuration in your client settings.

Troubleshooting

If you encounter transport or authentication errors, verify that the chosen transport type (stdio or http) is correctly configured, and that any required environment variables are set in your runtime environment.

Notes

The MCP server is designed to run locally via stdio or expose an HTTP endpoint for remote clients. It can also be deployed to Cloudflare Workers for edge hosting, using the same codebase.

Available tools

clinicaltrials_search_studies

Search clinical trials using free-text queries and filters with geographic, status, phase, and area-based filters, supporting pagination and sorting.

clinicaltrials_get_study

Fetch one or more clinical studies by NCT ID, with full data or concise summaries; supports batch requests with partial success handling.

clinicaltrials_get_study_results

Fetch results data for completed studies, including outcomes, adverse events, participant flow, and baseline characteristics; supports section-level filtering.

clinicaltrials_get_field_values

Discover valid enum values for any API field with study counts to aid query construction.

clinicaltrials_analyze_trends

Aggregate statistics across up to 5000 studies by status, country, sponsor, phase, year, month, study type, or intervention type; supports multiple analysis types in one request.

clinicaltrials_compare_studies

Side-by-side comparison of 2-5 studies across eligibility, design, interventions, outcomes, and sponsors with configurable focus.

clinicaltrials_find_eligible_studies

Match patient profiles to eligible trials using age, sex, conditions, and location with proximity-sorted results and relevance filtering.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational