# clinicaltrialsgov-mcp-server

Connects AI assistants to the ClinicalTrials.gov registry to query studies, pull outcome data, and pre-screen trials for patient profiles. No API key needed.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 98
- Author: cyanheads
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cyanheads/clinicaltrialsgov-mcp-server
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/clinicaltrialsgov-mcp-server

## What it does

The server provides access to clinical study records using seven tools and the `clinicaltrials://{nctId}` resource. It runs free-text and field queries covering conditions, sponsors, locations, or trial phases, and retrieves posted outcome data for completed trials.

While `clinicaltrials_find_eligible` filters recruiting studies by age, sex, and diagnosis, it skips inclusion and exclusion criteria analysis. Protocol criteria still require manual review. You can run it locally via `npx` over STDIO or attach directly to the hosted HTTP endpoint.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://clinicaltrials.caseyjhand.com/mcp`
- Environment variables: `CT_API_BASE_URL`, `CT_REQUEST_TIMEOUT_MS`, `CT_MAX_PAGE_SIZE`, `MCP_LOG_LEVEL`, `MCP_TRANSPORT_TYPE`, `MCP_HTTP_HOST`, `MCP_HTTP_PORT`, `MCP_HTTP_ENDPOINT_PATH`, `MCP_AUTH_MODE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http clinicaltrialsgov-mcp-server https://clinicaltrials.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
claude mcp add --env CT_API_BASE_URL=<CT_API_BASE_URL> --env CT_REQUEST_TIMEOUT_MS=<CT_REQUEST_TIMEOUT_MS> --env CT_MAX_PAGE_SIZE=<CT_MAX_PAGE_SIZE> --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> --transport stdio clinicaltrialsgov-mcp-server -- npx -y clinicaltrialsgov-mcp-server
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add clinicaltrialsgov-mcp-server --url https://clinicaltrials.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
codex mcp add clinicaltrialsgov-mcp-server --env CT_API_BASE_URL=<CT_API_BASE_URL> --env CT_REQUEST_TIMEOUT_MS=<CT_REQUEST_TIMEOUT_MS> --env CT_MAX_PAGE_SIZE=<CT_MAX_PAGE_SIZE> --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> -- npx -y clinicaltrialsgov-mcp-server
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "clinicaltrialsgov-mcp-server": {
            "url": "https://clinicaltrials.caseyjhand.com/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "clinicaltrialsgov-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "clinicaltrialsgov-mcp-server"
            ],
            "env": {
                "CT_API_BASE_URL": "<CT_API_BASE_URL>",
                "CT_REQUEST_TIMEOUT_MS": "<CT_REQUEST_TIMEOUT_MS>",
                "CT_MAX_PAGE_SIZE": "<CT_MAX_PAGE_SIZE>",
                "MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
                "MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "clinicaltrialsgov-mcp-server": {
            "type": "http",
            "url": "https://clinicaltrials.caseyjhand.com/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "clinicaltrialsgov-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "clinicaltrialsgov-mcp-server"
            ],
            "env": {
                "CT_API_BASE_URL": "<CT_API_BASE_URL>",
                "CT_REQUEST_TIMEOUT_MS": "<CT_REQUEST_TIMEOUT_MS>",
                "CT_MAX_PAGE_SIZE": "<CT_MAX_PAGE_SIZE>",
                "MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
                "MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http clinicaltrialsgov-mcp-server https://clinicaltrials.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
gemini mcp add -e CT_API_BASE_URL=<CT_API_BASE_URL> -e CT_REQUEST_TIMEOUT_MS=<CT_REQUEST_TIMEOUT_MS> -e CT_MAX_PAGE_SIZE=<CT_MAX_PAGE_SIZE> -e MCP_LOG_LEVEL=<MCP_LOG_LEVEL> -e MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> clinicaltrialsgov-mcp-server npx -y clinicaltrialsgov-mcp-server
```
Replace <…> with your own values. 4 more environment variables are in the server README

## When to use it
- search active clinical trials by condition, sponsor, or location coordinates
- retrieve full protocol records and reported study outcomes by NCT identifier
- count matching trials quickly without downloading entire study records
- screen candidate studies matching patient demographics and diagnoses

## Example prompts
- Find recruiting phase 3 breast cancer studies within 50 miles of Boston
- Get published outcome measures and adverse event summary for NCT04280705
- Count how many completed stroke trials have posted results

## Similar
- [Zotero MCP](https://affpapa.org/en/nevibecode/mcp/zotero-mcp.md) — MCP server · ★ 5548
- [arxiv-mcp-server](https://affpapa.org/en/nevibecode/mcp/arxiv-mcp-server.md) — MCP server · ★ 3231
- [PaperBanana](https://affpapa.org/en/nevibecode/mcp/paperbanana.md) — MCP server · ★ 2417
- [MATLAB MCP Server](https://affpapa.org/en/nevibecode/mcp/matlab-mcp-server.md) — MCP server · ★ 1716
- [Hex Research](https://affpapa.org/en/nevibecode/mcp/hex-research.md) — MCP server · ★ 583
- [DocsAgent — Zotero, Obsidian & Apple Notes MCP Server](https://affpapa.org/en/nevibecode/mcp/docsagent-zotero-obsidian-apple-notes-mcp-server.md) — MCP server · ★ 578

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
