Skip to main content
Glama

hpo-link

Python 3.14+ CI Conformance License: MIT

An MCP server (Streamable HTTP or stdio) that grounds phenotype work in the Human Phenotype Ontology (HPO): term lookup, the is_a hierarchy, cross-ontology mapping, and gene↔phenotype↔disease associations, served read-only from a local index of the HPO release and its HPOA annotations.

IMPORTANT

Research use only. Not clinical decision support. Do not use for diagnosis, treatment, triage, or patient management.

Why

HPO ships as bulk artifacts — an OBO/JSON ontology graph (hp.json) and a flat annotation table (phenotype.hpoa). Neither answers a question. "Which genes are annotated to seizure, including its subtypes?" needs the transitive is_a closure over a multi-parent DAG, a synonym/xref index to get from free text to HP:0001250, and a join against HPOA — plumbing every consumer otherwise rebuilds, badly.

hpo-link builds that once into a read-only SQLite index (closure table, FTS over names/synonyms/definitions, xrefs ranked by mapping predicate) and serves it as MCP tools. No upstream call sits in the request path, so lookups are offline and deterministic, and every response cites the HPO id and the HPO release it came from.

Related MCP server: Unofficial HPO MCP Server

Quick start

Hosted — no install:

claude mcp add --transport http hpo-link https://hpo-link.genefoundry.org/mcp

Local (Python 3.14+, uv):

uv sync --group dev   # install
make data             # REQUIRED: download HPO + HPOA and build the local database
make data-status      # loaded HPO release + counts
make dev              # unified REST + MCP on http://127.0.0.1:8000 (/mcp, /health)

There is no data until make data (uv run hpo-link-data build) has run once.

claude mcp add --transport http hpo-link --scope user http://127.0.0.1:8000/mcp
make mcp-serve        # stdio instead, for Claude Desktop (stdout is the protocol)

Three console scripts: hpo-link (unified server), hpo-link-mcp (stdio), hpo-link-data (build / refresh / status for data authoring, and materialize-data for the hardened deployment init sidecar).

Tools

Tool

Purpose

get_server_capabilities

Discovery surface — tools, workflows, error taxonomy, limits

get_diagnostics

Database status, loaded HPO release, counts

resolve_term

Label, synonym, HP id or xref → one canonical term + match_type

resolve_terms_batch

Up to 100 labels / HP ids / xrefs in one call, per-item outcome

search_terms

Full-text search over names, synonyms and definitions

get_term

The record — definition, synonyms, grouped xrefs, parents/children, obsolescence

get_term_ancestors

Transitive is_a ancestors

get_term_descendants

Transitive is_a descendants — a phenotype and all its subtypes

get_term_parents

Direct is_a parents

get_term_children

Direct is_a children

resolve_xref

External CURIE (UMLS:, SNOMEDCT_US:, ORPHA:, …) → HP ids, ranked by predicate

map_cross_ontology

An HP term → its mappings, grouped by target prefix

get_phenotypes_for_gene

HPO terms annotated to a gene

get_genes_for_phenotype

Genes annotated to an HPO term

get_phenotypes_for_disease

HPO terms annotated to a disease

get_diseases_for_phenotype

Diseases annotated to an HPO term

get_genes_for_disease

Genes associated with a disease

get_diseases_for_gene

Diseases associated with a gene

score_genes_for_phenotypes

Genes ranked for a set of HPO terms (disease-level Resnik)

Every response carries _meta.next_commands (ready-to-call follow-ups). Ids are normalised to HP:NNNNNNN. response_mode ∈ minimal | compact | standard | full (default compact) trades detail for tokens. Worked examples: docs/usage.md.

Leaf names are unprefixed per Tool-Naming Standard v1 (serverInfo.name = hpo-link); behind genefoundry-router the gateway applies the canonical namespace token hpo, so they surface as hpo_<tool> — e.g. hpo_resolve_term.

Data & provenance

Built from two upstream artifacts: the HPO ontology (hp.json, via the OBO PURL http://purl.obolibrary.org/obo/hp.json) and the HPOA annotations (phenotype.hpoa), which link HPO terms to OMIM / Orphanet / DECIPHER diseases and, derived from those, to genes.

Local data authoring can refresh from upstream with conditional GET (ETag / Last-Modified), but deployed servers do not. Production uses the immutable, digest-pinned release declared in container-release.json: hpo-data-init materializes it before the application starts, then the application reads the selected snapshot only. Details: docs/data.md.

Data licence: HPO is distributed under a custom licence for research and educational use (https://hpo.jax.org/app/license) — attribution required.

Cite: Köhler S, Gargano M, Matentzoglu N, et al. The Human Phenotype Ontology in 2021. Nucleic Acids Research 2021;49(D1):D1207–D1217. doi:10.1093/nar/gkaa1043. For the most recent release cite instead: Gargano MA, Matentzoglu N, Coleman B, et al. The Human Phenotype Ontology in 2024: phenotypes around the world. Nucleic Acids Research 2024;52(D1):D1333–D1346. doi:10.1093/nar/gkad1005.

Documentation

  • Usage — per-tool examples, the citation contract, typical workflows.

  • Architecture — the two planes, ingest pipeline, SQLite schema, request lifecycle.

  • Data & provenance — sources, freshness, build integrity, prebuilt artifacts, licence.

  • Configuration — every HPO_LINK_* variable and the Host/Origin/CORS allowlists.

  • Deployment — Docker init sidecar, health and deploy verification.

  • AGENTS.md — engineering conventions, invariants, definition of done.

Contributing

See AGENTS.md for the invariants and conventions. make ci-local is the definition-of-done gate: format, lint, line budget, README standard, mypy, and tests. Write the failing test first.

License

MIT © Bernt Popp — code only. The HPO data is licensed separately for research and educational use with required attribution (https://hpo.jax.org/app/license); see Data & provenance.

Available Tools

19 tools
get_diagnosticsGet HPO DiagnosticsA
Read-onlyIdempotent

Report the local HPO index status: whether the data is built, the loaded HPO and HPOA release versions, term/obsolete/closure/xref/annotation counts, when it was built, and a runtime block (request/error counts and latency percentiles p50/p95/p99). Use this to confirm freshness or diagnose an upstream_unavailable error (an unbuilt/unavailable local index). Signature: get_diagnostics().

Inputs: no named parameters.

get_diseases_for_geneGet Diseases for GeneC
Read-onlyIdempotent

Return diseases associated with a gene (symbol or NCBI id). Signature: get_diseases_for_gene(gene, limit=, offset=, response_mode=).

Inputs: gene (required), limit, offset, response_mode.

get_diseases_for_phenotypeGet Diseases for HPO PhenotypeA
Read-onlyIdempotent

Return diseases annotated to an HPO phenotype term, optionally expanded to include descendants. Signature: get_diseases_for_phenotype(hpo_id, include_descendants=, limit=, offset=, response_mode=).

Inputs: hpo_id (required), limit, offset, response_mode, +1 more.

get_genes_for_diseaseGet Genes for DiseaseC
Read-onlyIdempotent

Return genes associated with a disease CURIE (e.g. OMIM:106210, ORPHA:550). Signature: get_genes_for_disease(disease_id, limit=, offset=, response_mode=).

Inputs: disease_id (required), limit, offset, response_mode.

get_genes_for_phenotypeGet Genes for HPO PhenotypeA
Read-onlyIdempotent

Return the genes annotated to an HPO phenotype term, optionally expanded to include descendants. Signature: get_genes_for_phenotype(hpo_id, include_descendants=, limit=, offset=, response_mode=). For several phenotypes and/or a candidate gene list at once, use score_genes_for_phenotypes instead of looping over single-term calls.

Inputs: hpo_id (required), limit, offset, response_mode, +1 more.

get_phenotypes_for_diseaseGet HPO Phenotypes for DiseaseB
Read-onlyIdempotent

Return the HPO phenotype terms annotated to a disease CURIE (e.g. OMIM:106210, ORPHA:550). Signature: get_phenotypes_for_disease(disease_id, limit=, offset=, response_mode=).

Inputs: disease_id (required), limit, offset, response_mode.

get_phenotypes_for_geneGet HPO Phenotypes for GeneA
Read-onlyIdempotent

Return the HPO phenotype terms annotated to a gene (symbol or NCBI id). Signature: get_phenotypes_for_gene(gene, limit=, offset=, response_mode=). For several phenotypes and/or a candidate gene list at once, use score_genes_for_phenotypes instead of looping over single-gene calls.

Inputs: gene (required), limit, offset, response_mode.

get_server_capabilitiesGet Server CapabilitiesA
Read-onlyIdempotent

Return the hpo-link discovery surface: identity/build/HPO release, the tool list WITH call signatures, response modes, recommended workflows, the xref prefixes, the error taxonomy, and limits. detail='full' adds the full policy notes. Call this first in a cold session, or read hpo://tools / hpo://capabilities. Signature: get_server_capabilities(detail=).

Inputs: detail.

get_termGet HPO TermA
Read-onlyIdempotent

Return an HPO phenotype term record: definition, synonyms (exact/related/broad/narrow), alt_ids, subsets, comments, cross-references, direct parents and children, and obsolescence (replaced_by). The term accepts an HP id, a label/synonym, or an external xref CURIE (resolved first). For only the labels of several HP ids, call resolve_terms_batch once. Pass fields=['synonyms', 'definition'] for a sparse projection. Note on synonyms shape: compact (default) returns synonyms as plain strings; standard/full return {text, scope} objects. Signature: get_term(hpo_id, response_mode=, fields=).

Inputs: hpo_id (required), fields, response_mode.

get_term_ancestorsGet HPO Term AncestorsA
Read-onlyIdempotent

Return all transitive is_a ancestors (broader phenotype terms) of an HPO term via the precomputed closure, with a pagination block {total, returned, limit, offset, truncated, next_offset}. When truncated, next_commands carries a forward-page step (offset) so you can walk a >limit closure without re-sending rows. Use get_term_parents for only the immediate parents. Signature: get_term_ancestors(hpo_id, limit=, offset=, response_mode=).

Inputs: hpo_id (required), limit, offset, response_mode.

get_term_childrenGet HPO Term ChildrenA
Read-onlyIdempotent

Return the direct is_a children (immediate more-specific phenotype terms) of an HPO term. Use get_term_descendants for the full transitive set. Signature: get_term_children(hpo_id, response_mode=).

Inputs: hpo_id (required), response_mode.

get_term_descendantsGet HPO Term DescendantsA
Read-onlyIdempotent

Return all transitive is_a descendants (more specific phenotype terms) of an HPO term via the precomputed closure, with a pagination block {total, returned, limit, offset, truncated, next_offset}. When truncated, next_commands carries a forward-page step (offset) so you can walk a >limit closure without re-sending rows. Use get_term_children for only the immediate children. Signature: get_term_descendants(hpo_id, limit=, offset=, response_mode=).

Inputs: hpo_id (required), limit, offset, response_mode.

get_term_parentsGet HPO Term ParentsA
Read-onlyIdempotent

Return the direct is_a parents (immediate broader phenotype terms) of an HPO term. Use get_term_ancestors for the full transitive set. Signature: get_term_parents(hpo_id, response_mode=).

Inputs: hpo_id (required), response_mode.

map_cross_ontologyMap HPO Cross-OntologyA
Read-onlyIdempotent

List an HPO term's cross-references to other ontologies/vocabularies, grouped by target prefix (UMLS/SNOMEDCT_US/NCIT/MEDDRA/ICD-10/ICD-9/MONDO/DOID/ORPHA/EFO/MSH/MESH). Optionally restrict to a subset of prefixes. Signature: map_cross_ontology(hpo_id, prefixes=, response_mode=, fields=).

Inputs: hpo_id (required), fields, prefixes, response_mode.

resolve_termResolve HPO TermA
Read-onlyIdempotent

Resolve a phenotype label, synonym, HP id (HP:0000118), or external cross-reference CURIE (UMLS:C0000737, SNOMEDCT_US:263681008, ...) to the canonical HPO term {hpo_id, name, match_type}. For 2 or more terms, call resolve_terms_batch once instead of calling this tool per item. An ambiguous label returns ambiguous_query with candidates (each {hpo_id, name}); an obsolete HP id resolves with success:true, obsolete:true, and its successor in replaced_by. This is the recommended first step — resolve any query to a canonical HP id before calling get_term. Returns the single best match; text queries add other_matches_count, and to list every term matching a text use search_terms. Signature: resolve_term(query, response_mode=).

Inputs: query (required), response_mode.

resolve_terms_batchResolve HPO Terms (batch)A
Read-onlyIdempotent

Resolve many phenotype labels, synonyms, HP ids or xref CURIEs in one call (label -> HP id and HP id -> label); returns one results[] row per input in input order: {index, query, ok: true, hpo_id, name, match_type} or {index, ok: false, error_code, message} (an ambiguous label adds candidates). One bad item never fails the call; unresolved_count says how many missed. Max 100 items. Signature: resolve_terms_batch(queries, response_mode=).

Inputs: queries (required), response_mode.

resolve_xrefResolve HPO Cross-ReferenceA
Read-onlyIdempotent

Resolve an external cross-reference CURIE (UMLS/SNOMEDCT_US/NCIT/MEDDRA/ICD-10/ICD-9/MONDO/DOID/ORPHA) back to the HPO term(s) that cross-reference it. Returns matches[] plus a pagination block {total, returned, limit, offset, truncated, next_offset}; when truncated, next_commands carries a forward-page step (offset). Signature: resolve_xref(xref_id, limit=, offset=, response_mode=).

Inputs: xref_id (required), limit, offset, response_mode.

score_genes_for_phenotypesScore Genes for HPO PhenotypesA
Read-onlyIdempotent

Rank genes for a set of HPO phenotype terms (Resnik similarity to annotated diseases); returns ranked candidate genes for a patient's phenotypes, each with score, best disease and matched term pairs (shared ancestor + IC); excluded terms are reported as conflicts, never scored. Every input HP id is scored as given, listed in replaced_hpo_ids (obsolete id or alt_id, scored as replaced_by) or listed in ignored_hpo_ids with a reason. close_call=true (with rank1_margin) means the top ranks are too close to pick rank 1 by score alone; close_call=false does not confirm rank 1. In minimal mode top_matches reads ' = ' for the same term, '~' for a related one, f=? when no frequency is recorded. Signature: score_genes_for_phenotypes(hpo_ids, excluded_hpo_ids=, candidate_genes=, limit=, offset=, response_mode=).

Inputs: hpo_ids (required), limit, offset, response_mode, +2 more.

search_termsSearch HPO TermsA
Read-onlyIdempotent

Full-text search over HPO phenotype term names, synonyms, and definitions (FTS, relevance-ranked); returns {hpo_id, name, score} -- compact adds a short definition_snippet; standard/full add the complete definition -- plus a pagination block {total, returned, limit, offset, truncated, next_offset}. When truncated, next_commands carries a forward-page step (offset advanced) and a widen step. Obsolete terms are excluded unless include_obsolete=true. Signature: search_terms(query, limit=, offset=, include_obsolete=, response_mode=).

Inputs: query (required), limit, offset, response_mode, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 19 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes: term navigation (children/parents/ancestors/descendants), annotation lookups in each direction, and resolution are well separated, and descriptions explicitly cross-reference the alternative tool to use. The main risk is the six inverse annotation pairs (get_phenotypes_for_gene vs get_genes_for_phenotype, etc.) and the resolve_term/resolve_terms_batch/search_terms/resolve_xref cluster, which are distinguishable but require reading descriptions carefully.

    Naming Consistency5/5

    All 19 tools use snake_case with a leading verb (resolve_, get_, search_, score_, map_) and a predictable noun phrase. The get_X_for_Y / get_Y_for_X inverse pairs are named symmetrically, which makes directionality explicit rather than confusing.

    Tool Count4/5

    19 tools is on the heavy side but each maps to a distinct operation: hierarchy traversal, annotation queries, resolution, scoring, and diagnostics. Nothing looks redundant enough to cut, though the four separate closure/child/parent tools could arguably be collapsed into one parameterized traversal tool.

    Completeness4/5

    The surface covers the full lifecycle: resolution, full-text search, hierarchy traversal, cross-ontology mapping, gene/disease/phenotype annotation in both directions, phenotype-driven gene ranking, and diagnostics/capabilities discovery. Minor gaps remain, such as no disease or gene name-based lookup (only CURIE/symbol input) and no batch get_term for multiple HP ids.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers