home / mcp / clinicaltrials mcp server

ClinicalTrials MCP Server

Provides access to ClinicalTrials.gov data for trial search, adverse event comparisons, safety feature analysis, and dose–response exploration via an MCP client.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "aki894-mcp-clinicaltrial": {
      "command": "node",
      "args": [
        "/path/to/mcp-clinicaltrials/dist/index.js"
      ]
    }
  }
}

You can run a dedicated MCP server to analyze clinical trial adverse events using data from the ClinicalTrials.gov API. This server lets you search trials, compare adverse event risks between drugs and controls, and explore safety profiles and dose–response relationships to support safety assessments, study design, and regulatory submissions.

How to use

You will interact with the MCP server through an MCP client to perform key tasks such as searching clinical trials, retrieving study details, comparing adverse events between drugs and controls, and analyzing overall safety profiles. Start with a focused search to identify relevant trials, then pull detailed information for those trials to ground your analysis. Use the compare and analyze features to obtain baseline references, evidence of dose–response differences, and a structured safety assessment across multiple studies.

Typical workflows include the following patterns:

  • Search trials by condition, intervention, status, location, and/or an exact NCT ID to assemble a dataset for analysis.
  • Fetch detailed study information for a given NCT ID to verify design, populations, and outcomes.
  • Compare adverse events for a drug against placebo or active controls to establish baseline risks.
  • Analyze the safety profile of a drug across multiple studies, including dose–response assessments and outcome prevalence.
  • Use the results to inform trial design, safety monitoring plans, and regulatory discussions.

How to install

Prerequisites: you need Node.js installed on your system. Ensure you have permission to install global npm packages and to run the MCP server locally or on a server you manage.

# Install dependencies
npm install

# Development mode
npm run dev

# Build the project
npm run build

# Production start
npm start

Additional sections

Configuration and usage details follow common MCP patterns. The server exposes no public authentication by default and relies on the standard MCP transport and process wiring described below for local development and deployment.

MCP server connection configurations shown in examples specify how to run the server locally and how to connect a client to remote execution when needed.

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

Remote server configuration example shows how to connect via SSH and start the MCP server process on a remote host, allowing you to forward control to a running instance and interact through the MCP client as if it were local.

{
  "mcpServers": {
    "clinicaltrials": {
      "command": "ssh",
      "args": [
        "user@your-server-ip",
        "cd ~/mcp-servers/clinicaltrials && node dist/index.js"
      ],
      "env": {}
    }
  }
}

API and usage examples

You can perform common actions with the following function calls in your MCP client to interact with the server and retrieve or analyze data.

// Search trials related to a condition
await searchClinicalTrials({
  condition: "lung cancer",
  intervention: "pembrolizumab",
  status: "COMPLETED",
  pageSize: 10
});

// Get details for a specific study
await getStudyDetails("NCT04267848");

// Compare adverse events for a drug against placebo
await compareAdverseEvents({
  drug_name: "pembrolizumab",
  control_type: "placebo",
  condition: "lung cancer",
  limit: 20
});

// Analyze safety profile across studies
await analyzeSafetyProfile({
  drug_name: "pembrolizumab",
  condition: "cancer",
  include_completed_only: true,
  limit: 50
});

Available tools

searchClinicalTrials

Search clinical trials using multiple query parameters such as condition, intervention, outcome, sponsor, status, location, and nct_id with pagination and total count options.

getStudyDetails

Fetch detailed information for a specific clinical trial by its NCT ID.

compareAdverseEvents

Core function to compare adverse event data for a drug versus placebo or active controls, including baseline references and safety assessments across studies.

analyzeSafetyProfile

Analyze a drug's safety features, providing risk assessment and dose–response relationships with optional completion-filtered data.

ClinicalTrials MCP Server - aki894/mcp-clinicaltrial