MCP server for Open Targets Platform biomedical data access
Project description
Open Targets MCP Server
A Model Context Protocol (MCP) server that exposes the Open Targets Platform GraphQL API as a set of tools for use with Claude Desktop and other MCP-compatible clients.
Quick Install
For Claude Desktop
Option 1: Using MCPM (Recommended)
# Install mcpm package manager
pip install mcpm
# Install the server
mcpm install opentargets
Option 2: Manual Setup
# Clone and setup
git clone https://github.com/nickzren/opentargets-mcp
cd opentargets-mcp
pip install uv
uv sync
# Import to Claude Desktop
mcpm import stdio opentargets \
--command "$(uv run which python)" \
--args "-m opentargets_mcp.server"
Then restart Claude Desktop to start using the Open Targets tools.
For Other MCP Clients
git clone https://github.com/nickzren/opentargets-mcp
cd opentargets-mcp
pip install uv
uv sync
# Option 1: Use the simple runner script (thin wrapper around uv run)
./run.sh
# Option 2: Run directly
uv run python -m opentargets_mcp.server
Features
Core Capabilities
- Target Analysis: Search genes/proteins by Ensembl ID or symbol. Access expression data, genetic constraints, pathways, protein interactions, safety profiles, and mouse phenotypes
- Disease Analysis: Query diseases by EFO ID. Find associated targets, phenotypes (HPO), and research projects
- Drug Discovery: Search drugs by ChEMBL ID. Access safety data, adverse events, indications, and mechanism of action
- Evidence Mining: Explore target-disease associations with scored evidence from multiple sources
- Variant Analysis: Query genetic variants, GWAS credible sets, and pharmacogenomics data
- Study Exploration: Access GWAS studies with L2G predictions and fine-mapped loci
- Smart Search: Entity resolution with synonym handling, autocomplete, and ID mapping
Data Sources
The Open Targets Platform integrates evidence from 22+ primary data sources:
- Genetics: Open Targets Genetics, ClinVar, UK Biobank, FinnGen, Gene2Phenotype, Orphanet, COSMIC
- Functional: CRISPR screens, DepMap, GeneBass
- Drugs: ChEMBL, FDA/EMA approvals, chemical probes
- Expression: GTEx, Human Protein Atlas, Expression Atlas
- Pathways: Reactome, Signor, IntAct
- Literature: Europe PMC text mining
- Safety: FAERS, pharmacogenomics data
- Models: Mouse (MGI, IMPC) phenotypes
Architecture
graph LR
subgraph "Clients"
A[Claude Desktop]
B[Python Scripts]
C[AI Agents]
end
subgraph "MCP Server"
D[Open Targets<br/>MCP Server]
E[Tool Categories<br/>Target • Disease • Drug<br/>Evidence • Search • Variant • Study]
end
subgraph "Open Targets"
F[GraphQL API]
G[22+ Data Sources]
end
A <-->|MCP Protocol| D
B <-->|Direct API| D
C <-->|Function Calls| D
D <-->|GraphQL| F
F <--> G
E --> D
style D fill:#e1f5fe
style F fill:#fff3e0
The MCP server acts as a bridge between client applications and the Open Targets Platform. It translates tool calls into GraphQL queries and provides structured access to biomedical data from 22+ integrated sources.
Prerequisites
- Python 3.12+ with pip
Usage
Running the Server Standalone
# Using the convenience script (automatically handles uv setup)
./run.sh
# Or run directly with uv
uv run python -m opentargets_mcp.server
Example Scripts
uv run python examples/target_validation_profile.py EGFR
uv run python examples/disease_to_drug.py "schizophrenia"
uv run python examples/drug_safety_profile.py "osimertinib"
uv run python examples/genetic_target_prioritization.py "inflammatory bowel disease"
AI Agent Example
The ReAct Agent provides an interactive terminal interface for exploring Open Targets data:
# Create .env file with your OpenAI API key
echo "OPENAI_API_KEY=your_key_here" > .env
# Run agent
uv run python examples/react_agent.py
The agent uses a ReAct (Reasoning and Acting) pattern to break down complex biomedical queries into steps, making it easy to explore drug targets, diseases, and their relationships.
Available Tools
The server wraps 45 GraphQL operations from the Open Targets Platform. Every tool returns structured JSON that mirrors the official schema, and you can inspect the full machine-readable list with the MCP list_tools request.
Quick-start shortcuts
get_target_info– Core target identity record (Ensembl IDs, synonyms, genomic coordinates)get_disease_info– Disease/EFO summary with therapeutic area contextget_drug_info– ChEMBL-backed drug profile and mechanism datasearch_entities– Unified entity search with synonym handlingget_target_associated_diseases– High-confidence target-disease links with scoresget_disease_associated_targets– Prioritised target list for an EFO diseaseget_target_known_drugs– Approved and investigational agents for a targetget_target_disease_evidence– Evidence details across genetics, expression, and literature
Full catalog by category
- Target identity & biology (20 tools) —
get_target_info,get_target_class,get_target_alternative_genes,get_target_associated_diseases,get_target_known_drugs,get_target_literature_occurrences,get_target_expression,get_target_pathways_and_go_terms,get_target_homologues,get_target_subcellular_locations,get_target_genetic_constraint,get_target_mouse_phenotypes,get_target_hallmarks,get_target_depmap_essentiality,get_target_interactions,get_target_safety_information,get_target_tractability,get_target_chemical_probes,get_target_tep,get_target_prioritization. - Disease analytics (4 tools) —
get_disease_info,get_disease_associated_targets,get_disease_phenotypes,get_disease_otar_projects. - Drug profiling (7 tools) —
get_drug_info,get_drug_cross_references,get_drug_linked_diseases,get_drug_linked_targets,get_drug_adverse_events,get_drug_pharmacovigilance,get_drug_warnings. - Evidence synthesis (2 tools) —
get_target_disease_evidence,get_target_disease_biomarkers. - Search & discovery (4 tools) —
search_entities,search_suggestions,get_similar_targets,search_facets. - Variant interpretation (4 tools) —
get_variant_info,get_variant_credible_sets,get_variant_pharmacogenomics,get_variant_evidences. - Study exploration (4 tools) —
get_study_info,get_studies_by_disease,get_study_credible_sets,get_credible_set_by_id.
Each grouping matches the data domains described in the Open Targets docs (targets, diseases, drugs, evidence, variants, and studies). For high-volume workloads, respect the platform's throttling guidance from the official API FAQ and cache downstream where possible.
Development
# Run tests
uv run pytest tests/ -v
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opentargets_mcp-0.1.0.tar.gz.
File metadata
- Download URL: opentargets_mcp-0.1.0.tar.gz
- Upload date:
- Size: 32.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28adc1793119801ec25cbad585c11dedfa12df6f99c2754ed91da7112e614fc4
|
|
| MD5 |
8bae666f14500ee4e25e8933d0bf5936
|
|
| BLAKE2b-256 |
fd85aebfa631ec83d8f5ebbc32b5c2c53d762181d2edae6de7d48457e8215d5e
|
File details
Details for the file opentargets_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: opentargets_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 35.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a682481bdbb4f98731dee02120b1629e2d0d077cc0360a79bc562b5f6f4e76f
|
|
| MD5 |
163fec272f2b7d41d440dd7a6a5d143c
|
|
| BLAKE2b-256 |
31ada3a28903035014ea94453c5e5eb0d1095a85e93e95474c2646d95259bbc2
|