@cyanheads/gnomad-genetics-mcp-server
Public Hosted Server: https://gnomad-genetics.caseyjhand.com/mcp
Tools
Five gnomAD tools, plus three for SQL analytics over the DuckDB-backed canvas tables the list tools materialize:
Tool | Description |
| Full population record for one or more variants — AC/AN/AF overall and per genetic-ancestry group, homozygote/hemizygote counts, quality flags, transcript consequence, in-silico predictors, and joined ClinVar significance. Batch up to 25 IDs with per-item partial success. |
| Gene loss-of-function constraint — pLI, LOEUF ( |
| Every variant in a gene, transcript, or region with allele frequencies and predicted consequences, filterable by consequence class and max AF. Spills to the |
| Sequencing coverage across a gene, transcript, or region — mean/median depth and the fraction of samples over depth thresholds, per callset track. Tells a true absent variant from an uncallable position. |
| Gene-level ClinVar detail via NCBI E-utilities — classified variants, review status (star rating), conditions, and submission counts. Spills to the |
| Run a read-only SQL |
| List the tables staged on a canvas and their columns before writing SQL. |
| Drop a named table from a canvas to reclaim memory. Opt-in via |
gnomad_get_variant
The "how common, is it benign" answer in one call.
Batch up to 25 IDs per call, each a
chrom-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 othersPer-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 variantAn 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
The orthogonal axis to allele frequency — a loss-of-function variant matters far more in a gene intolerant to being broken.
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-scoresMany 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
List variants across a gene, transcript, or region, then SQL the full set.
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 frequencyThe full result is staged on a DataCanvas table named
gene_variantswith an inline preview returned alongsidecanvas_idandtable_name— query it withgnomad_dataframe_queryto rank by AF, count by consequence, or group across the complete setReusing a
canvas_idREPLACES the staged table; it does not appendWhen the canvas is disabled (
CANVAS_PROVIDER_TYPE!=duckdb) the tool returns a capped inline preview withspilled=falseand the SQL path is unavailable
gnomad_get_coverage
Disambiguate a true absent variant from an uncallable position.
Supply exactly one of
gene,transcript_id, orregionReturns 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 trackA variant missing from a well-covered region is informative; one missing from a poorly-covered region is not
gnomad_search_clinvar
Gene-panel curation depth beyond the per-variant ClinVar join, via NCBI E-utilities.
Returns a gene's classified ClinVar variants — clinical significance, review status with a 0–4 star rating, associated conditions, molecular consequences, and submission counts
Optional filters:
clinical_significance(e.g.pathogenic) and a minimum star rating (min_review_stars, 0–4)The full set is staged on the
clinvar_variantscanvas table with an inline preview; reusing acanvas_idREPLACES that tableKeyless, but honors
NCBI_API_KEYfor a higher rate limit (10 vs 3 req/s)
Canvas dataframe tools
gnomad_dataframe_query, gnomad_dataframe_describe, and gnomad_dataframe_drop operate on the canvas tables the list tools stage.
gnomad_dataframe_queryruns single-statementSELECTs only — writes, DDL, and file/HTTP table functions are rejected by the canvas gategnomad_dataframe_describereturns each staged table's name, row count, and column schema — call it before writing SQLgnomad_dataframe_dropis a deliberate mutation (readOnlyHint: false); it stays absent fromtools/listunlessGNOMAD_DATAFRAME_DROP_ENABLED=trueAll three require
CANVAS_PROVIDER_TYPE=duckdb; without it they return acanvas_disablederror
Resources and prompts
Type | Name | Description |
Resource |
| Population record for one variant — mirrors |
Resource |
| Gene loss-of-function constraint — mirrors |
Prompt |
| Guided rare-disease variant-triage workflow: population frequency → gene constraint → callability check, in order. |
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.
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation
Unified error handling — handlers throw, framework catches, classifies, and formats
Typed error contracts with agent-facing recovery hints
Pluggable auth:
none,jwt,oauthStructured logging with optional OpenTelemetry tracing
STDIO and Streamable HTTP transports
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 visiblePolite client — conservative concurrency cap and exponential backoff against a community-funded, rate-limited API
In-conversation SQL analytics:
gnomad_list_gene_variantsandgnomad_search_clinvarstage their full result on a DuckDB-backed canvas table queryable viagnomad_dataframe_query
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 batchProvenance on every response — effective
datasetandreference_genomeechoed back; null upstream fields preserved as null, never fabricatedRecovery 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:
{
"mcpServers": {
"gnomad-genetics-mcp-server": {
"type": "streamable-http",
"url": "https://gnomad-genetics.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
Add the following to your MCP client configuration file. gnomAD is a free, keyless API — no credentials required.
{
"mcpServers": {
"gnomad-genetics-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/gnomad-genetics-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"gnomad-genetics-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/gnomad-genetics-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"gnomad-genetics-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/gnomad-genetics-mcp-server:latest"
]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpTo enable the SQL analytics path, also set CANVAS_PROVIDER_TYPE=duckdb (requires the @duckdb/node-api peer dependency; unavailable on Cloudflare Workers).
Prerequisites
Bun v1.3.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:
git clone https://github.com/cyanheads/gnomad-genetics-mcp-server.gitNavigate into the directory:
cd gnomad-genetics-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# all vars are optional — the server runs keyless out of the boxConfiguration
All variables are optional; the server runs keyless with the defaults below.
Variable | Description | Default |
| gnomAD GraphQL endpoint. Override for a private mirror or testing. |
|
| Dataset used when a tool call omits |
|
| Per-request timeout against the GraphQL endpoint, in milliseconds. |
|
| Cap on concurrent upstream requests — politeness against a community-funded API. |
|
| Maximum variant IDs accepted per |
|
| NCBI E-utilities base URL for |
|
| Optional NCBI key. Raises the E-utilities rate limit from 3 to 10 req/s. | — |
| Set to |
|
| Gate for the opt-in |
|
| Transport: |
|
| Port for the HTTP server. |
|
| Auth mode: |
|
| Log level (RFC 5424). |
|
| Enable OpenTelemetry instrumentation. |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t gnomad-genetics-mcp-server .
docker run --rm -e MCP_TRANSPORT_TYPE=http -p 3010:3010 gnomad-genetics-mcp-serverThe 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
Directory | Purpose |
|
|
| Server-specific environment variable parsing and validation with Zod. |
| Tool definitions ( |
| Resource definitions ( |
| Prompt definitions ( |
| gnomAD GraphQL client, query documents, and domain types. |
| NCBI E-utilities client for the optional ClinVar tool. |
| Module-level accessor for the framework's optional DataCanvas. |
Development guide
See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources in the
createApp()arrays insrc/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
gnomAD data is provided by the Genome Aggregation Database (Broad Institute). ClinVar data is provided by NCBI.