Wraps the Open Targets Platform GraphQL API with 65 curated tools plus raw query access for drug discovery and target validation workflows. You get typed operations for searching targets by Ensembl ID, querying disease associations with evidence scores, pulling drug safety data from ChEMBL, and exploring genetic variants across 22+ integrated sources including ClinVar, GTEx, and Reactome. The tool set covers cross-entity workflows like chaining disease to target to drug evidence, with optional field filtering to control response size. Includes smart entity resolution with synonym handling and strict ID validation. Ships with stdio for Claude Desktop via mcpm, plus SSE and HTTP transports for web clients. Python 3.10+ required.
Public tool metadata for what this MCP can expose to an agent.
get_open_targets_graphql_schemaRetrieve the Open Targets Platform GraphQL schema filtered by category. You MUST specify one or more categories to retrieve the relevant schema subset. Categories group related GraphQL types into coherent subschemas (e.g., 'drug-mechanisms', 'genetic-associations', 'target-saf...1 paramsRetrieve the Open Targets Platform GraphQL schema filtered by category. You MUST specify one or more categories to retrieve the relevant schema subset. Categories group related GraphQL types into coherent subschemas (e.g., 'drug-mechanisms', 'genetic-associations', 'target-saf...
categoriesarrayget_type_dependenciesGet schema subsets for types, separated by specific and shared deps. Given a list of type names, returns SDL (Schema Definition Language) organized into type-specific dependencies and shared dependencies. Returns a dict with: - One key per input type: SDL for types ONLY reacha...1 paramsGet schema subsets for types, separated by specific and shared deps. Given a list of type names, returns SDL (Schema Definition Language) organized into type-specific dependencies and shared dependencies. Returns a dict with: - One key per input type: SDL for types ONLY reacha...
type_namesarraysearch_entitiesSearch for entities across multiple types using the Open Targets Platform search API. This tool performs a streamlined entity search that returns the id and entity type for up to 3 matching entities across targets, diseases, drugs, variants, and studies. Supports multiple quer...1 paramsSearch for entities across multiple types using the Open Targets Platform search API. This tool performs a streamlined entity search that returns the id and entity type for up to 3 matching entities across targets, diseases, drugs, variants, and studies. Supports multiple quer...
query_stringsarrayquery_open_targets_graphqlExecute GraphQL queries against the Open Targets Platform API. WORKFLOW - Follow these steps in order: Step 1: RESOLVE IDENTIFIERS If user provides common names (gene symbols, disease names, drug names), use `search_entity` tool FIRST to convert them to standardized IDs: - Tar...2 paramsExecute GraphQL queries against the Open Targets Platform API. WORKFLOW - Follow these steps in order: Step 1: RESOLVE IDENTIFIERS If user provides common names (gene symbols, disease names, drug names), use `search_entity` tool FIRST to convert them to standardized IDs: - Tar...
variablesvaluequery_stringstringbatch_query_open_targets_graphqlExecute the same GraphQL query multiple times with different variable sets. Use this tool instead of the regular query tool when you need to run the same query repeatedly with different arguments (e.g., querying multiple drugs, targets, or diseases). WORKFLOW - Follow these st...3 paramsExecute the same GraphQL query multiple times with different variable sets. Use this tool instead of the regular query tool when you need to run the same query repeatedly with different arguments (e.g., querying multiple drugs, targets, or diseases). WORKFLOW - Follow these st...
key_fieldstringquery_stringstringvariables_listarrayA 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.
uvx (no install)uvx --from git+https://github.com/nickzren/opentargets-mcp opentargets-mcp
# Install mcpm package manager
pip install mcpm
# Install the server
mcpm install opentargets
git clone https://github.com/nickzren/opentargets-mcp
cd opentargets-mcp
pip install uv
uv sync
# Run (stdio transport by default)
uv run python -m opentargets_mcp.server
git clone https://github.com/nickzren/opentargets-mcp
cd opentargets-mcp
# Build and run with Docker Compose
docker-compose up -d --build
Note: the default transport is http for docker deployments.
See the configuration section below for details and how to set ports and other environment variables.
mcpm import stdio opentargets \
--command "$(uv run which python)" \
--args "-m opentargets_mcp.server --transport stdio"
Then restart Claude Desktop to start using the Open Targets tools.
This implementation is designed for practical Open Targets workflows:
fields filters on core domain tools to return only what you need.The Open Targets Platform integrates evidence from 22+ primary data sources:
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.
# Using the convenience script (installs uv if missing, then syncs dependencies)
./run.sh
# Or run directly with uv (stdio transport by default)
uv run python -m opentargets_mcp.server
# Installed entrypoints
opentargets-mcp --help
# Specify transport explicitly
uv run python -m opentargets_mcp.server --transport [stdio|sse|http]
MCP_TRANSPORT, FASTMCP_SERVER_HOST, and FASTMCP_SERVER_PORT (defaults: stdio, 0.0.0.0, 8000). API endpoint uses OPEN_TARGETS_API_URL (default: https://api.platform.opentargets.org/api/v4/graphql). For local-only development, prefer FASTMCP_SERVER_HOST=127.0.0.1.src/opentargets_mcp/settings.py), so invalid values fail fast.search_entities to find canonical IDs).fields to trim output, and reserve raw GraphQL for edge cases.page_index >= 0, page_size >= 1, and a global page_size <= 500.opentargets-mcp --transport [stdio|sse|http] --host 0.0.0.0 --port 8000 --api <url> provides flexible transport and endpoint selection.--verbose to elevate the global log level to DEBUG when troubleshooting.--list-tools prints all registered tools, and --version prints the package version.OPEN_TARGETS_RATE_LIMIT_RPS and OPEN_TARGETS_RATE_LIMIT_BURST can enable global server-side rate limiting. --rate-limiting and OPEN_TARGETS_RATE_LIMIT_ENABLED=true are also supported.The server supports multiple transport protocols powered by FastMCP:
# For Claude Desktop (via mcpm) and local CLI tools
opentargets-mcp --transport stdio
# For web-based MCP clients with Server-Sent Events
opentargets-mcp --transport sse --host 0.0.0.0 --port 8000
# For streamable HTTP MCP clients
opentargets-mcp --transport http --host 0.0.0.0 --port 8000
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"
The ReAct Agent provides an interactive terminal interface for exploring Open Targets data:

# Copy the example .env file and add your OpenAI API key
cp .env.example .env
# Then edit .env and set your OPENAI_API_KEY
# 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.
The server wraps 68 operations from the Open Targets Platform: 65 curated tools plus 3 advanced GraphQL tools. Every tool returns structured JSON that mirrors the Open Targets GraphQL schema, and you can inspect the full machine-readable list with the MCP list_tools request.
Most domain tools accept either a canonical identifier (e.g., ENSG..., EFO_..., CHEMBL...) or a human-readable name/symbol. When a name is provided, the server automatically resolves it to the best matching Open Targets ID.
Many core tools accept an optional fields list (dot-paths) to filter the response payload.
search_entities also returns search.triples for compact {id, entity, name} consumption.
For edge cases, prefer curated tools + fields first; use raw GraphQL only when no curated tool fits.
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 literatureget_drug_repurposing_candidates – Multi-hop disease -> target -> drug candidate prioritizationgraphql_batch_query – Run one GraphQL query across many variable setsget_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.get_disease_info, get_disease_associated_targets, get_disease_phenotypes, get_disease_otar_projects, get_disease_known_drugs, get_disease_ontology, get_disease_literature_occurrences, get_disease_similar_entities.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, get_drug_pharmacogenomics, get_drug_literature_occurrences, get_drug_similar_entities.get_target_disease_evidence, get_target_disease_biomarkers.search_entities, search_suggestions, get_similar_targets, search_facets.get_api_metadata, get_association_datasources, get_gene_ontology_terms, get_interaction_resources, map_ids.get_drug_repurposing_candidates.get_targets_batch, get_diseases_batch, get_drugs_batch.get_variant_info, get_variant_credible_sets, get_variant_pharmacogenomics, get_variant_evidences, get_variant_intervals, get_variant_protein_coordinates.get_study_info, get_studies_by_disease, get_study_credible_sets, get_credible_set_by_id, get_credible_set_colocalisation, get_credible_sets.graphql_schema, graphql_query, graphql_batch_query.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 Open Targets API FAQ and cache downstream where possible.
# Run lint checks (same as CI/release)
uv run ruff check src tests
# Run tests
uv run pytest tests/ -v
# Inspect registered tools from CLI
uv run opentargets-mcp --list-tools