Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Ensembl Server

БесплатноНе проверен

Enables looking up genes, fetching sequences, predicting variant consequences, finding orthologs, and cross-database xrefs via Ensembl REST API through MCP.

GitHubEmbed

Описание

Enables looking up genes, fetching sequences, predicting variant consequences, finding orthologs, and cross-database xrefs via Ensembl REST API through MCP.

README

@cyanheads/ensembl-mcp-server

Look up genes, fetch sequences, predict variant consequences, find orthologs, and retrieve cross-database xrefs from Ensembl REST via MCP. STDIO or Streamable HTTP.

7 Tools • 4 Resources • 1 Prompt

Public Hosted Server: https://ensembl.caseyjhand.com/mcp


Overview

Gene, sequence, and variant data for vertebrates and other model organisms from the Ensembl REST API. Look up genes, fetch sequences, predict variant consequences, find orthologs, and cross-reference external databases.

Tools

Tool Description
ensembl_list_species List species supported by Ensembl with display name, common name, assembly, taxon ID, and division
ensembl_lookup_gene Resolve a gene by symbol (synonyms and former symbols included) + species or by stable ID to its Ensembl ID, genomic location, biotype, and transcript list
ensembl_get_sequence Fetch the DNA, cDNA, CDS, or protein sequence for a gene, transcript, protein, or genomic region
ensembl_query_region Find genomic features (genes, transcripts, variants, regulatory elements, exons) overlapping a chromosomal region
ensembl_predict_variant Predict functional consequences of a sequence variant using the Ensembl Variant Effect Predictor (VEP)
ensembl_get_homology Find orthologs and/or paralogs of a gene across species with percent identity and taxonomy level
ensembl_get_xrefs Retrieve cross-database references for a gene — HGNC, UniProt, EntrezGene, OMIM, RefSeq, Reactome, and others

Resources

Resource Description
ensembl://gene/{id} Gene record by stable ID (ENSG…, or the species' own form: AT1G01010, FBgn0000042, LRG_1) — location, biotype, description, and transcript list
ensembl://transcript/{id} Transcript record by stable ID (ENST…, or the species' own form: AT1G01010.1, FBtr0070823, LRG_1t1) — parent gene, location, biotype, canonical flag, and length
ensembl://species Supported Ensembl species for the endpoint default division (vertebrates on the default endpoint)
ensembl://species/{division} Supported species in one division (EnsemblVertebrates, EnsemblPlants, EnsemblFungi, EnsemblMetazoa, EnsemblProtists)

The species resources return the first 50 species by internal name; the ensembl_list_species tool pages through the rest and filters by name.

Prompts

Prompt Description
ensembl_gene_dossier Structured workflow for assembling a complete gene profile: symbol → ID + location → sequence → variants → orthologs → xrefs

Capability reference

Ensembl's stable-ID endpoints answer a versioned ID (ENSG00000139618.19) as not found, so every tool and resource that takes an Ensembl stable ID drops a trailing .N from an ENS… ID, or from an LRG transcript or translation ID (LRG_1t1.1, LRG_1p1.12), before the request and returns the current version. HGVS input to ensembl_predict_variant (ENST00000380152.8:c.2T>A) keeps its version, and IDs from other sources (AT3G52430.1) are forwarded unchanged.

ensembl_list_species tool

  • Optional division (EnsemblVertebrates, EnsemblPlants, EnsemblFungi, EnsemblMetazoa, EnsemblProtists; omitted, the endpoint default — vertebrates, ~356 species on GRCh38) and nameContains, a substring match against name, display name, and common name
  • Returns the internal name every other tool expects (homo_sapiens), plus display name, common name, taxon ID, assembly, and division
  • Sorted by internal name and paged by offset (default 0) and max_results (default 25, 0 uncapped); totalCount reports every match, and nextOffset is where the next page starts when more follow

ensembl_lookup_gene tool

  • Exactly one of symbol (+ species, default homo_sapiens), id, ids, or symbols (up to 1,000 submitted items; first 20 distinct trimmed queries processed); expand_transcripts (default false) adds the transcript list with biotype and canonical flag
  • canonicalTranscript identifies the canonical transcript without expansion; transcript-ID lookups also return parentGeneId. Expanded transcripts include maneSelect RefSeq accessions when available (BRCA2: ENST00000380152.8, NM_000059.4)
  • A symbol that is not a current gene name falls back to synonyms and former symbols (HER2 → ERBB2), reported as matchedAlias; a name shared by several genes (MDR1) returns ambiguous with candidates to retry by id
  • A single lookup returns gene (or ambiguous); a batch returns ordered succeeded items carrying the submitted query, failed items with query, reason (not_found, ambiguous with candidates, or unavailable), error, and recovery, and omitted queries past the processing cap. Omitted queries are never requested or reported as failed; resubmit them separately. Errors: not_found, invalid_species, no_input, conflicting_input

ensembl_get_sequence tool

  • A stable ID (ENSG…/ENST…/ENSP…) or a region (species:chr:start-end, or chr:start-end with species; at most 10,000,000 bases); type is genomic (default), cdna, cds, or protein — cdna and cds from a transcript ID only, protein from a transcript or protein ID; expand_5prime/expand_3prime add flanking bases
  • Regions take a :1/:-1 strand suffix (1:1000000-1000020:-1 returns the reverse complement); the mitochondrion is MT in vertebrates (mitochondrion_genome in Drosophila, MtDNA in C. elegans), and M/chrM are rejected as invalid_region where they would not resolve to it
  • Returns a window set by offset (default 0) and max_length (default 10000, 0 uncapped); length is the full sequence length, and truncated/nextOffset say where to resume
  • Errors: not_found, type_mismatch (also a protein ID asked for genomic/cdna/cds, or a non-coding transcript asked for protein/cds), invalid_species, missing_species, invalid_region (also an id with a colon that is not a valid region)

ensembl_query_region tool

  • region as species:chr:start-end, or chr:start-end with species (at most 5,000,000 bases; reversed coordinates are rejected; mitochondrion naming as in ensembl_get_sequence); feature defaults to ["gene"] and also accepts transcript, variation, regulatory, exon; optional case-sensitive biotype filter (protein_coding, lncRNA), applied to gene, transcript, and exon features only (an exon by its parent transcript's biotype); variation and regulatory features come back unfiltered, with a notice. An empty filtered result suggests removing the filter without inferring the locus is intergenic
  • Features come in one fixed order (requested feature type, then start, end, ID, parent transcript), paged by offset (default 0) and max_results (default 25). 0 or a value above 5,000 returns 5,000 features and says so; with ENSEMBL_CLAMP_LIMITS=false the schema advertises 5,000 as the maximum and rejects larger values instead. totalCount reports the true count and nextOffset where the next page starts. Ensembl has no paging of its own, so every page re-reads the full overlap set; a 5,000-row variation page is about 0.75 MB
  • assemblyName names the coordinates' assembly, and exon rows carry parentId and rank. Errors: invalid_region, invalid_species, missing_species

ensembl_predict_variant tool

  • variant as HGVS (transcript-relative or genomic), region+allele (chr:start:end:strand/allele), or a dbSNP rsID
  • Returns the most severe consequence, per-transcript impact (HIGH/MODERATE/LOW/MODIFIER), and colocated known variants with clinical significance. Errors: invalid_notation, not_found, invalid_species
  • A region+allele input on strand -1 has its allele reverse-complemented and is sent on the forward strand, with a notice; - and structural-variant terms (DUP, DEL) pass unchanged. A -1 allele that equals the forward reference fails as invalid_notation, naming the forward request
  • Each record and each colocated variant reports strand, and its alleles (alleleString, variantAllele, clinicalSignificanceByAllele keys) read on that strand. A transcript or protein HGVS on a reverse-strand gene reports -1. A notice appears when a record's strand differs from a colocated variant's
  • Requests HGVS, canonical and MANE annotations on every input route. Consequences retain variantAllele, optional canonical/maneSelect, HGVS and available SIFT/PolyPhen prediction-score pairs, with scores shown as Ensembl stores them (0, not 0.000); records retain alleleString
  • Colocated clinicalSignificance is aggregate, not a classification of the submitted allele. clinicalSignificanceByAllele preserves explicit per-allele terms and clinicalSignificanceReferenceAllele identifies their reference allele; absent annotations remain omitted. An empty allele key in Ensembl's per-allele terms is read as the deletion allele - only when that colocated variant's alleleString lists -
  • max_transcript_consequences and max_pubmed_ids_per_variant (default 10 each, 0 uncapped; include_all_colocated_pubmed lifts the PubMed cap) bound the result, while transcriptConsequencesTotal and pubmedTotal report the full counts

ensembl_get_homology tool

  • Exactly one of symbol (+ species, default homo_sapiens) or id; type is orthologues (default), paralogues, or all; optional target_species filter
  • A target_species outside the comparison Ensembl runs for the source species (a fly gene to homo_sapiens) is answered from Ensembl's pan-taxonomic comparison when it holds both species, with a notice saying so
  • Homologs keep Ensembl's own order, which starts with the closest relatives and is stable across calls, and are paged by offset (default 0) and max_results (default 25; 0 returns every homolog from offset). totalCount reports the true count and nextOffset where the next page starts. Errors: not_found, invalid_species (unknown species or target_species), target_not_compared (a target outside the source species' comparison that the pan-taxonomic comparison cannot answer), no_input, conflicting_input
  • percId and percPos are shown as Ensembl stores them
  • Each row retains optional targetProteinId for ensembl_get_sequence with type:"protein". Optional targetSymbol comes from a lookup of the returned page's distinct gene IDs, five per request and three requests at a time, sharing one ten-second budget bounded by the call's remaining deadline, with no retries. Missing names or failed lookups retain every primary homolog with a notice; cancellation still aborts

ensembl_get_xrefs tool

  • id (ENSG…/ENST…/ENSP…) required; optional dbname filter (e.g. HGNC, Uniprot_gn, Uniprot/SWISSPROT for the reviewed UniProt accession on the translation, EntrezGene, MIM_GENE, RefSeq_mRNA, Reactome_gene for gene pathways, Reactome for translation pathways, GO)
  • Default all_levels:false queries the requested object's level. Set all_levels:true to include a gene's transcript and translation references, independently of dbname; for example, gene-level RefSeq_mRNA may need this or a transcript ID. Empty lists remain successful with totalCount:0. Errors: not_found
  • Each reference carries how Ensembl assigned it (infoType: DIRECT, DEPENDENT, PROJECTION, …; infoText: its source, such as UniProt or the ortholog a projection came from) and its evidence codes (linkageTypes, GO evidence such as IDA or IEA) when supplied, so GO and Projected GO rows, and experimental and electronic annotations, stay distinct on both surfaces

ensembl://gene/{id} resource

  • id is a gene stable ID (ENSG…, or the species' own form: AT1G01010, FBgn0000042, YFL039C, LRG_1); a version suffix on an ENS… ID is optional and dropped
  • Returns location, biotype, description, and transcript list. An ID Ensembl holds as a transcript, translation, or exon is refused as wrong_object_type, naming the type found, its parent, and where to read it. Errors: not_found, wrong_object_type

ensembl://transcript/{id} resource

  • id is a transcript stable ID (ENST…, or the species' own form: AT1G01010.1, FBtr0070823, YFL039C_mRNA, LRG_1t1); a version suffix on an ENS… or LRG ID is optional and dropped
  • Returns parent gene, location, biotype, canonical flag, and length. An ID Ensembl holds as a gene, translation, or exon is refused as wrong_object_type, naming the type found, its parent, and where to read it. Errors: not_found, wrong_object_type

ensembl://species resource

  • No parameters — covers the endpoint default division (vertebrates, ~356 species on the default GRCh38 endpoint)
  • Returns the first 50 species by internal name with totalCount, shown, and truncated; a truncated body's notice points to ensembl_list_species (offset, max_results) for the rest
  • For a named division, read ensembl://species/{division} instead

ensembl://species/{division} resource

  • division required: EnsemblVertebrates, EnsemblPlants, EnsemblFungi, EnsemblMetazoa, or EnsemblProtists
  • Returns that division's first 50 species by internal name — internal name, display name, assembly, taxon ID, and division — with totalCount, shown, and truncated; a truncated body's notice points to ensembl_list_species (division, offset, max_results) for the rest

ensembl_gene_dossier prompt

  • Arguments: gene_symbol required; species optional (default homo_sapiens)
  • Sequences a 7-step workflow: resolve the gene → fetch the protein sequence → find variants in the locus → predict variant consequences → find model-organism orthologs → get external database IDs → synthesize the dossier

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.

Ensembl-specific:

  • Keyless REST API — no API key required; Ensembl REST is fully public at 55,000 req/hr
  • Retries 429 responses (honoring Retry-After) and transient 5xx errors
  • Upstream calls time out at 180 s per attempt and 240 s per call, so a stalled Ensembl fails instead of hanging
  • Batch lookups use POST /lookup/id and POST /lookup/symbol/{species} to avoid N+1 round trips
  • GRCh37 legacy support via ENSEMBL_BASE_URL — point the entire server at https://grch37.rest.ensembl.org for clinical workflows on the older assembly
  • All coordinate-bearing responses echo the assembly name so agents never see a bare genomic position without assembly context

Agent-friendly output:

  • ensembl_get_sequence returns bounded windows (10,000 characters by default) with the full length and a nextOffset to continue
  • ensembl_list_species is the discovery step for internal species names, 25 per page with a nextOffset
  • Xref IDs from ensembl_get_xrefs are described as inputs for protein, disease, pathway, and structure servers; the ensembl_gene_dossier prompt chains 6 of the 7 tools

Getting started

Connect to the hosted instance, no install:

claude mcp add --transport http ensembl-mcp-server https://ensembl.caseyjhand.com/mcp

Or run it locally:

claude mcp add ensembl-mcp-server -- npx -y @cyanheads/ensembl-mcp-server

For other clients, add this to the MCP config file:

{
  "mcpServers": {
    "ensembl-mcp-server": {
      "command": "npx",
      "args": ["-y", "@cyanheads/ensembl-mcp-server"]
    }
  }
}

Ensembl REST is public, so no API key is needed. Set ENSEMBL_BASE_URL to https://grch37.rest.ensembl.org to query the GRCh37 assembly instead of GRCh38. For Docker or a source build, see Running the server.

Configuration

All configuration is validated at startup via Zod schemas in src/config/server-config.ts.

Variable Description Default
ENSEMBL_BASE_URL Ensembl REST API base URL. Override for GRCh37 (https://grch37.rest.ensembl.org) or a local mirror. https://rest.ensembl.org
ENSEMBL_CLAMP_LIMITS ensembl_query_region clamps a max_results above 5,000 to 5,000 with a notice. Set false to advertise 5,000 as the schema maximum and reject larger values. true
MCP_TRANSPORT_TYPE Transport: stdio or http stdio
MCP_HTTP_PORT HTTP server port 3010
MCP_HTTP_ENDPOINT_PATH HTTP endpoint path /mcp
MCP_SESSION_MODE HTTP session mode: auto, stateful, or stateless stateless
MCP_AUTH_MODE Authentication: none, jwt, or oauth none
MCP_LOG_LEVEL Log level (debug, info, warning, error, etc.) info
LOGS_DIR Directory for log files (Node.js only) <project-root>/logs
LOG_TOOL_FAILURE_PAYLOADS Log each failed tool call's arguments and result, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). A secret inside a free-form value is not redacted. false
OTEL_ENABLED Enable OpenTelemetry false

See .env.example for the full list of optional overrides.

Running the server

Local development

Requires Bun v1.4.4 or higher (or Node.js v24+).

  • Clone and install:

    git clone https://github.com/cyanheads/ensembl-mcp-server.git
    cd ensembl-mcp-server && bun install
    cp .env.example .env   # optional: set ENSEMBL_BASE_URL for GRCh37 or a mirror
    
  • Build and run:

    # One-time build
    bun run rebuild
    
    # Run the built server
    bun run start:stdio
    # or
    bun run start:http
    
  • Run 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 run --rm -p 3010:3010 ghcr.io/cyanheads/ensembl-mcp-server:latest

The image defaults to HTTP transport, stateless session mode, and logs to /var/log/ensembl-mcp-server. To run it over stdio from an MCP client, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/ensembl-mcp-server:latest"]. To build locally, docker build -t ensembl-mcp-server .; OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

Directory Purpose
src/index.ts createApp() entry point — registers tools/resources/prompts and inits services
src/config Server-specific environment variable parsing and validation with Zod
src/mcp-server/tools Tool definitions (*.tool.ts) — 7 tools
src/mcp-server/resources Resource definitions (*.resource.ts) — gene, transcript, species
src/mcp-server/prompts Prompt definitions (*.prompt.ts) — gene dossier workflow
src/services/ensembl Ensembl REST API client — HTTP, rate-limit handling, retry, error normalization
tests/ Unit and integration tests mirroring src/

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools and resources in the createApp() arrays in src/index.ts
  • Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Contributing

Issues are welcome. Run checks and tests before submitting:

bun run devcheck
bun run test

License

Apache-2.0 — see LICENSE for details.

from github.com/cyanheads/ensembl-mcp-server

Установка Ensembl Server

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/cyanheads/ensembl-mcp-server

FAQ

Ensembl Server MCP бесплатный?

Да, Ensembl Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Ensembl Server?

Нет, Ensembl Server работает без API-ключей и переменных окружения.

Ensembl Server — hosted или self-hosted?

Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.

Как установить Ensembl Server в Claude Desktop, Claude Code или Cursor?

Открой Ensembl Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Ensembl Server with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории data