
Gnomad Genetics Mcp Server
io.github.cyanheadsv0.3.0更新于 Sep 29, 2026
Look up allele frequencies by ancestry, gene constraint, variants, and coverage over gnomAD.
安装
在 SourceWeft 中
- 打开 控制台中的 Gnomad Genetics Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。
{
"mcpServers": {
"gnomad-genetics-mcp-server": {
"type": "http",
"url": "https://gnomad-genetics.caseyjhand.com/mcp"
}
}
}README
@cyanheads/gnomad-genetics-mcp-server
Look up variant allele frequencies by ancestry, gene loss-of-function constraint, gene variant lists, and sequencing coverage over gnomAD — with ClinVar significance joined in — via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://gnomad-genetics.caseyjhand.com/mcp
Overview
Population genetics over gnomAD (Broad Institute), with ClinVar clinical significance joined in from NCBI. Look up per-ancestry allele frequencies, gene loss-of-function constraint, gene variant catalogs, and sequencing coverage, then query large result sets with SQL from any MCP client. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
Tools
Resources
All resource data is also reachable via tools. The list tools (gnomad_list_gene_variants, gnomad_get_coverage, gnomad_search_clinvar) return analytical row sets rather than stable single-URI documents, so they are not exposed as resources — call the tools instead.
Prompts
Capability reference
gnomad_get_variant tool
- Batch up to 25 IDs per call (default; raise via
GNOMAD_MAX_VARIANT_BATCH), each achrom-pos-ref-altvariantId (e.g.1-55051215-G-GA) or an rsID (e.g.rs11591147) - Per-item partial success — a malformed or absent ID lands in
failed[]without failing the others - Per-ancestry frequency vector is returned in full, never collapsed to a single global AF
- Reports which callset(s) (
exome/genome) carry the variant, quality flags, transcript consequence, in-silico predictor scores, and the ClinVar significance gnomAD joins per variant - An empty
found[]for a well-formed ID means the variant is not in the chosen dataset — pair withgnomad_get_coverageto confirm the position is callable before concluding true absence
gnomad_get_gene_constraint tool
- Accepts an HGNC symbol (
PCSK9) or an Ensembl gene ID (ENSG00000169174) - Returns pLI (>0.9 intolerant), LOEUF /
oe_lof_upper(<0.6 intolerant in v4, <0.35 in v2) with its lower bound, observed/expected ratios for LoF / missense / synonymous, and the three Z-scores - Many genes have null constraint (sparse upstream) — null fields are reported as such, never fabricated
constraint_flagssurfaces v4 beta caveats flagged by the gnomAD team
gnomad_list_gene_variants tool
- Supply exactly one of
gene,transcript_id, orregion(chrom-start-stop, 1-based inclusive) - Optional filters: one
consequence_class(lof/missense/synonymous/other) and/or a maximum allele frequency - A result too large to inline (the preview holds about 14,000 characters of rows, keeping a response near 24 KB) is staged on a DataCanvas table named
gene_variants, returned ascanvas_idandtable_namebeside the preview — inspect it withgnomad_dataframe_describe, then query it withgnomad_dataframe_queryto rank by AF, count by consequence, or group across every row. The response notice names the table and both tools - A result that fits inline stages no table and uses no canvas (
canvas_idis empty) unless you pass acanvas_id - Passing a
canvas_idalways writes the result togene_variantson that canvas, REPLACING the previous table (it never appends), even when the result fits inline; a result with no variants removes the table - When the canvas is disabled (
CANVAS_PROVIDER_TYPE!=duckdb) the tool returns the same capped inline preview (as many rows as fit about 14,000 characters) and the SQL path is unavailable - A blank
geneortranscript_idcounts as omitted
gnomad_get_coverage tool
- Supply exactly one of
gene,transcript_id, orregion; a blankgeneortranscript_idcounts as omitted - Returns mean and median read depth plus the mean fraction of samples covered at each threshold (1× through 100×), summarized per callset track
coverage_sourcenarrows to one track (exome/genome); omit to return every available track- A variant missing from a well-covered region is informative; one missing from a poorly-covered region is not
gnomad_search_clinvar tool
- Returns a gene's classified ClinVar variants — clinical significance, review status with a 0–4 star rating, associated conditions, molecular consequences, and submission counts
- Each row carries gnomAD-compatible identifiers:
canonical_spdi,rsids, andgrch38_variant_id(chrom-pos-ref-alt, set for SNVs, MNVs, and delins), whichgnomad_get_variantresolves in the GRCh38 datasets - Optional filters:
clinical_significance(e.g.pathogenic; blank means no filter) and a minimum star rating (min_review_stars, 0–4) - Returns one window of up to 500 ClinVar records per call:
total_foundis ClinVar's candidate count for the gene and filter terms (taken before the significance and star filters narrow each window),truncatedandnext_offsetsay whether more remain, andoffset/limit(1–500) page through them.limitcounts records before the filters, so a window can return fewer rows - VariationIDs ClinVar returns no summary for are listed in
unavailable_idsrather than returned as blank rows - Accepts an HGNC symbol only — ClinVar's gene index doesn't resolve Ensembl gene IDs, unlike the other gnomAD tools. An Ensembl gene ID returns guidance to resolve its symbol and searches nothing, leaving any
canvas_idyou pass untouched - A window too large to inline (the preview holds about 11,000 characters of rows, keeping a response near 24 KB) is staged on the
clinvar_variantscanvas table — inspect it withgnomad_dataframe_describe, then query it withgnomad_dataframe_query. A window that fits inline stages no table unless you pass acanvas_id; passing one always writes the window toclinvar_variants, REPLACING the previous table, and a window with no rows removes it. With the canvas disabled, the preview is the same capped preview (as many rows as fit about 11,000 characters) - Keyless, but honors
NCBI_API_KEYfor a higher rate limit (10 vs 3 req/s)
gnomad_dataframe_query tool
- Runs single-statement, read-only SQL
SELECTs against a canvas table staged bygnomad_list_gene_variantsorgnomad_search_clinvar— writes, DDL, and file/HTTP table functions are rejected by the canvas gate - Reference tables by the name the staging tool returned (
gene_variantsorclinvar_variants) - Output columns are dynamic per the SQL projection;
truncated: truemarks a result clipped at the canvas row cap - Requires
CANVAS_PROVIDER_TYPE=duckdb— otherwise fails with acanvas_disablederror
gnomad_dataframe_describe tool
- Lists every table staged on a canvas with its row count and column schema (name and DuckDB type)
- Call it before writing SQL for
gnomad_dataframe_query - Requires
CANVAS_PROVIDER_TYPE=duckdb— otherwise fails with acanvas_disablederror
gnomad_dataframe_drop tool
- Drops a named table from a canvas to reclaim memory — a deliberate mutation (
readOnlyHint: false,destructiveHint: true) on an otherwise read-only surface - Opt-in via
GNOMAD_DATAFRAME_DROP_ENABLED=true; absent fromtools/listwhen off, since per-table TTL already reclaims memory automatically - Requires
CANVAS_PROVIDER_TYPE=duckdb— otherwise fails with acanvas_disablederror
gnomad://variant/{dataset}/{variantId} resource
- Population record for one variant as
application/json— mirrorsgnomad_get_variant; thedatasetsegment keeps the URI self-describing variantIdaccepts a chrom-pos-ref-alt ID or an rsID, same grammar as the tool- Typed errors:
invalid_variant_id(outside the coordinate/rsID grammar) andvariant_not_found
gnomad://gene/{dataset}/{gene}/constraint resource
- Gene loss-of-function constraint as
application/json— mirrorsgnomad_get_gene_constraint geneaccepts an HGNC symbol or Ensembl gene ID- Typed error
gene_not_foundwhen no gene matches in the requested build
gnomad_variant_triage prompt
- Arguments:
variantrequired (chrom-pos-ref-alt or rsID);geneanddatasetoptional.datasetis one ofgnomad_r4,gnomad_r3,gnomad_r2_1,exac— any other value is rejected; omitted or blank, the emitted calls carry nodatasetand use the server default. A blankgenecounts as omitted - Emits a three-step chain as one user message: population frequency (
gnomad_get_variant) → gene constraint (gnomad_get_gene_constraint) → callability check (gnomad_get_coverageon the exact position, not gene-level) - Rejects a malformed
variantwith a validation error before generating the chain
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
gnomAD-specific:
- Single keyless GraphQL source for the entire core surface — ClinVar significance is joined per variant inside gnomAD's own response
datasetandreference_genomeare distinct, coherence-validated parameters (v4/v3 ⇒ GRCh38, v2.1/ExAC ⇒ GRCh37); both are echoed in every tool's output so a wrong-build coordinate mismatch is visible- Polite client — conservative concurrency cap (
GNOMAD_MAX_CONCURRENCY, default 2) and exponential backoff against a community-funded, rate-limited API - In-conversation SQL analytics:
gnomad_list_gene_variantsandgnomad_search_clinvarstage results too large to inline on a DuckDB-backed canvas table —gnomad_dataframe_describelists its columns,gnomad_dataframe_queryruns SQL over every row
Agent-friendly output:
- Per-ancestry allele-frequency vector returned in full, never collapsed to a single global AF — the cross-ancestry contrast is the signal clinical interpretation needs
- Graceful partial failure —
gnomad_get_variantreturns per-itemfailed[]rows with actionable messages instead of failing the whole batch - Provenance on every response — effective
datasetandreference_genomeechoed back; null upstream fields preserved as null, never fabricated - Recovery hints on errors (
incoherent_build,invalid_target,gene_not_found,canvas_disabled) so callers know the next move
Getting started
Public Hosted Instance
A public instance is available at https://gnomad-genetics.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
Self-Hosted / Local
Add the following to your MCP client configuration file. gnomAD is a free, keyless API — no credentials required.
Or with npx (no Bun required):
Or with Docker:
For Streamable HTTP, set the transport and start the server:
To enable the SQL analytics path, also set CANVAS_PROVIDER_TYPE=duckdb — @duckdb/node-api ships as a dependency, so nothing extra to install.
Prerequisites
- Bun v1.4.0 or higher (or Node.js v24+).
- No API key — gnomAD's GraphQL endpoint is keyless. An optional
NCBI_API_KEYraises thegnomad_search_clinvarrate limit.
Installation
- Clone the repository:
- Navigate into the directory:
- Install dependencies:
- Configure environment:
Configuration
All variables are optional; the server runs keyless with the defaults below.
See .env.example for the full list of optional overrides.
Running the server
Local development
-
Build and run:
-
Run checks and tests:
Docker
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/gnomad-genetics-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Development guide
See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - Register new tools and resources in the
createApp()arrays insrc/index.ts - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Data attribution
gnomAD data is provided by the Genome Aggregation Database (Broad Institute). ClinVar data is provided by NCBI.
Contributing
Issues are welcome. Run checks and tests before submitting:
License
Apache-2.0 — see LICENSE for details.
来源:README.md,提交 12ed17e
工具
0版本历史
3- v0.3.0最新Sep 24, 2026
- v0.2.2Sep 20, 2026
- v0.2.1Sep 16, 2026