UN

Unofficial NCI GDC MCP Server for Cancer Genomics

Access harmonized cancer genomic and clinical data via the unofficial NCI GDC MCP server for streamlined oncology research.

Quick Install
npx -y @QuentinCody/nci-gdc-mcp-server

Overview

This unofficial NCI GDC MCP server exposes harmonized cancer genomic and clinical data through a Model Context Protocol (MCP)–compatible HTTP API. It provides a lightweight bridge between the NCI Genomic Data Commons (GDC) harmonized datasets and retrieval-oriented clients such as language models, search UIs, and analysis workflows. The server is intended to simplify access to curated GDC content (sample metadata, clinical annotations, variant summaries, and aggregated cohorts) in a format optimized for contextual retrieval.

Because it implements MCP-style endpoints, the server supports common retrieval patterns (similarity search, contextual snippets, metadata lookups) so developers can plug the data directly into model-driven pipelines or build search-driven applications for oncology research. This project is community-maintained and not an official NCI product — consult the repository for the latest behavior and consider institutional data-use policies when querying patient-derived data.

Features

  • Serves harmonized genomic and clinical records derived from the NCI GDC
  • MCP-compatible HTTP endpoints for retrieval and context assembly
  • Vectorized search over document-like records (text and metadata)
  • Lightweight configuration for local, cloud, or containerized deployment
  • Open-source code and OpenAPI/Swagger docs (repo link below)
  • Support for paging, ranking parameters, and metadata filtering
  • Example client snippets for curl and Python to bootstrap integrations

GitHub: https://github.com/QuentinCody/nci-gdc-mcp-server

Installation / Configuration

Clone the repository, install dependencies, and run the service. The project supports a Python-based workflow and a Docker container.

Basic steps (Python):

git clone https://github.com/QuentinCody/nci-gdc-mcp-server.git
cd nci-gdc-mcp-server

# create a virtual environment
python3 -m venv .venv
source .venv/bin/activate

# install requirements
pip install -r requirements.txt

# copy and edit environment variables
cp .env.sample .env
# edit .env to set DATA_DIR, PORT, and any API keys

# start the server (example using uvicorn)
uvicorn app.main:app --host 0.0.0.0 --port 8080 --reload

Run with Docker:

# build
docker build -t nci-gdc-mcp .

# run
docker run -p 8080:8080 \
  -e DATA_DIR=/data \
  -v /local/data:/data \
  nci-gdc-mcp

Configuration options (example .env keys)

  • PORT — HTTP port to listen on (default 8080)
  • DATA_DIR — path to preprocessed GDC artifacts or vector store
  • CACHE_TTL — cache expiration for metadata lookups
  • ALLOW_CORS — enable cross-origin requests for browser clients

Refer to the repository README for any provider-specific environment variables and advanced tuning.

Available Resources

The server exposes a small set of MCP-style endpoints. Exact paths can vary by release; check the server OpenAPI docs at /docs.

Endpoint summary:

PathMethodPurpose
/healthGETLiveness and readiness check
/mcp/searchPOSTSemantic or keyword search with ranking parameters
/mcp/context/{id}GETRetrieve full context document by id
/metadataGETList available datasets, fields, and filters
/schemaGETReturn the MCP response schema / document model
/docsGETInteractive OpenAPI UI (Swagger)

Typical request shapes:

  • Search: POST /mcp/search with JSON { “query”: “…”, “k”: 10, “filters”: {…} }
  • Context fetch: GET /mcp/context/{document_id}

Use Cases

  1. Enriching LLM prompts with relevant genomic context
  • Scenario: You have a user question about TP53 mutations in lung adenocarcinoma. Use the MCP search endpoint to retrieve top-k context snippets, then append these to the prompt you send to an LLM to get evidence-grounded responses.

Example (curl):

curl -X POST http://localhost:8080/mcp/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "TP53 mutation in lung adenocarcinoma",
    "k": 5,
    "filters": {"primary_site": "Lung"}
  }'
  1. Cohort selection and quick cohort summaries
  • Scenario: Programmatically find cases that match clinical criteria (e.g., age, stage, therapy) and return aggregate summaries. Use /metadata and /mcp/search to filter and retrieve example records for downstream analyses.

Example (Python):

import requests
resp = requests.post(
    "http://localhost:8080/mcp/search",
    json={"query": "stage III colorectal", "k": 50, "filters": {"disease_type": "
Tags:search