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.
npx -y @QuentinCody/nci-gdc-mcp-serverOverview
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):
# create a virtual environment
# install requirements
# copy and edit environment variables
# edit .env to set DATA_DIR, PORT, and any API keys
# start the server (example using uvicorn)
Run with Docker:
# build
# run
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:
| Path | Method | Purpose |
|---|---|---|
| /health | GET | Liveness and readiness check |
| /mcp/search | POST | Semantic or keyword search with ranking parameters |
| /mcp/context/{id} | GET | Retrieve full context document by id |
| /metadata | GET | List available datasets, fields, and filters |
| /schema | GET | Return the MCP response schema / document model |
| /docs | GET | Interactive 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
- 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):
- 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):
=