DG

DGIdb MCP Server for Drug Gene Interactions

Explore the MCP server for DGIdb to access drug-gene interaction data, druggable genome info, and pharmacogenomics resources for research.

Quick Install
npx -y @QuentinCody/dgidb-mcp-server

Overview

The DGIdb MCP Server provides a Model Context Protocol (MCP)‑compliant API layer to programmatically access DGIdb (Drug–Gene Interaction Database) content. It exposes drug–gene interaction records, curated druggable genome annotations, and pharmacogenomics resources so developers and researchers can integrate this knowledge into search interfaces, annotation pipelines, or downstream analytic workflows.

Designed for programmatic consumption, the server translates DGIdb content into a consistent MCP resource format, enabling tools that implement MCP to discover and query DGIdb data alongside other knowledge sources. This makes it easier to integrate drug–gene evidence into clinical decision support, variant interpretation, or cohort‑level queries without parsing DGIdb dumps manually.

Features

  • Exposes DGIdb content via MCP‑compatible HTTP endpoints
  • Search and query drug–gene interactions by gene, drug, or variant context
  • Druggable genome annotations (gene classifications, confidence tiers)
  • Pharmacogenomics resources (annotated drug–gene pairs with source provenance)
  • Simple configuration and Docker support for local or containerized deployments
  • Lightweight API intended for integration into pipelines, search backends, and UIs

Installation / Configuration

Prerequisites: Python 3.8+ (or your chosen runtime), git, and Docker (optional).

Clone the repository and create a virtual environment:

git clone https://github.com/QuentinCody/dgidb-mcp-server.git
cd dgidb-mcp-server
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Copy and edit the example environment file:

cp .env.example .env
# Edit .env to set MCP_HOST, MCP_PORT, and data path variables

Typical .env variables (examples):

MCP_HOST=0.0.0.0
MCP_PORT=8080
DGIDB_DATA_PATH=/data/dgidb
LOG_LEVEL=info

Load initial DGIdb data (if provided scripts exist):

# If the repo includes a data loader script
python scripts/load_dgidb_data.py --input /path/to/dgidb_sources --out $DGIDB_DATA_PATH

Run the server locally:

# Simple run (module name may vary)
python -m dgidb_mcp_server.app
# or
FLASK_APP=app.py flask run --host=0.0.0.0 --port=8080

Docker (build and run):

docker build -t dgidb-mcp-server .
docker run -d -p 8080:8080 \
  -e MCP_PORT=8080 \
  -e DGIDB_DATA_PATH=/data/dgidb \
  -v /local/dgidb:/data/dgidb \
  dgidb-mcp-server

For production deployments, configure a process manager or container orchestrator and point the server at a persistent DGIdb data volume.

Available Resources

The server exposes resources and endpoints that map DGIdb concepts into MCP-compatible responses. Typical endpoints include:

EndpointDescription
GET /mcp/metadataService metadata and declared tools/capabilities
GET /mcp/healthHealth check for readiness/liveness
GET /mcp/search?q={term}Full‑text search for genes, drugs, or interactions
POST /mcp/queryMCP-style query endpoint for structured tool queries
GET /mcp/interactions?gene={symbol}List drug–gene interactions for a gene symbol
GET /mcp/druggable_genomeDruggable genome annotations and gene tiers
GET /mcp/pharmacogenomics?drug={name}Pharmacogenomics entries for a drug

Refer to the repository README or OpenAPI spec (if included) for the exact request/response schemas and available query parameters.

Use Cases

  1. Retrieve interactions for a gene panel

    • Example (curl):

      curl "http://localhost:8080/mcp/interactions?gene=EGFR" \
        -H "Accept: application/json"
      

      Response will include interaction pairs with source provenance, interaction types, and links to evidence.

  2. Integrate into a variant annotation pipeline

    • A pipeline that annotates somatic variants can call /mcp/search or /mcp/query to fetch druggable targets related to mutated genes and append drug recommendations or evidence levels to variant reports.
  3. Power a clinical search UI

    • Use GET /mcp/search?q= to implement autosuggest and result lists for drugs and genes. The MCP server provides normalized identifiers and source links that reduce client‑side normalization work.
  4. Cross‑source enrichment and knowledge graphs

    • Combine MCP responses from DGIdb with other MCP‑