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.
npx -y @QuentinCody/dgidb-mcp-serverOverview
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:
Copy and edit the example environment file:
# 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
Run the server locally:
# Simple run (module name may vary)
# or
FLASK_APP=app.py
Docker (build and run):
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:
| Endpoint | Description |
|---|---|
| GET /mcp/metadata | Service metadata and declared tools/capabilities |
| GET /mcp/health | Health check for readiness/liveness |
| GET /mcp/search?q={term} | Full‑text search for genes, drugs, or interactions |
| POST /mcp/query | MCP-style query endpoint for structured tool queries |
| GET /mcp/interactions?gene={symbol} | List drug–gene interactions for a gene symbol |
| GET /mcp/druggable_genome | Druggable 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
Retrieve interactions for a gene panel
Example (curl):
Response will include interaction pairs with source provenance, interaction types, and links to evidence.
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.
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.
Cross‑source enrichment and knowledge graphs
- Combine MCP responses from DGIdb with other MCP‑