Gbif Biodiversity Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.8.0更新於 Nov 1, 2026

Search GBIF species taxonomy, occurrence records, datasets, and publishers.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取知識與記憶資料與分析

概覽

AI 產生的概覽

查詢 GBIF 公開生物多樣性資料:物種分類、出現紀錄、資料集與發布機構,提供 13 個唯讀工具。

可以做什麼
  • 將學名比對到 GBIF 主幹分類系統,可單筆或一次最多 50 筆批次比對,並取得分類單元、上層分類鏈與下層分類單元
  • 依分類單元、國家、座標、日期、紀錄依據、IUCN 等級等 Darwin Core 條件搜尋與計數出現紀錄,並取得單筆紀錄
  • 依國家、年份、資料集、分類單元等維度彙總出現紀錄數量
  • 搜尋資料集與發布機構,並取得資料集的完整中繼資料,包括引用、授權與發布機構
適用情境
適合需要核對物種分類、查詢某物種在何時何地被記錄,或把生物多樣性紀錄追溯到資料集與發布機構的情境,例如研究、名錄整理與生態學問題。
執行需求
可使用公開託管的 Streamable HTTP 端點,或透過 npx、Bun、Docker 在本機執行(Bun 1.4.0+ 或 Node.js v24+)。無需憑證,GBIF 端點公開。選用環境變數可調整 GBIF 基礎位址、請求逾時、讀取上限截斷與 User-Agent 聯絡資訊;HTTP 託管使用 MCP_HTTP_PORT 與 MCP_AUTH_MODE。
安裝前請注意
僅對公開 GBIF 資料做唯讀查詢,不寫入、不涉及付款。GBIF 要求整合方表明身分,建議將 GBIF_USER_AGENT 設為聯絡網址或電子郵件。若自行以 HTTP 託管,MCP_AUTH_MODE 預設為 none,能連上該埠的人皆可使用。選用的失敗負載日誌會記錄工具參數,自由文字中的密鑰不會被遮蔽。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Gbif Biodiversity Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.cyanheads%2Fgbif-biodiversity-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "gbif-biodiversity": {
      "type": "http",
      "url": "https://gbif-biodiversity.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/gbif-biodiversity-mcp-server

Search GBIF species taxonomy, occurrence records, datasets, and publishers via MCP. STDIO or Streamable HTTP.

13 Tools • 2 Resources


Overview

Species taxonomy, occurrence records, datasets, and publishers from the Global Biodiversity Information Facility (GBIF). Match names to the backbone taxonomy, search and aggregate 3.9B+ occurrence records with Darwin Core filters, and trace records back to their datasets and publishers.

Tools

ToolDescription
gbif_match_speciesMatch a scientific name to the GBIF backbone, returning its taxon key, confidence, and classification
gbif_bulk_match_speciesMatch up to 50 scientific names in one call, one result per name in input order
gbif_get_speciesFetch a backbone taxon by key: classification, authorship, synonymy, vernacular name, descendant count
gbif_search_speciesSearch or browse the backbone by name fragment, rank, or a kingdom, family, or genus name
gbif_get_species_classificationReturn a taxon's parent chain, root-first from kingdom to its immediate parent
gbif_get_species_childrenList a taxon's direct children, such as the genera in a family or the species in a genus
gbif_search_occurrencesSearch 3.9B+ occurrence records by taxon, place, date, basis of record, presence/absence, and IUCN category
gbif_count_occurrencesCount occurrences matching a filter without fetching records
gbif_get_occurrenceFetch one full Darwin Core occurrence record by key
gbif_occurrence_facetsAggregate occurrence counts by country, year, dataset, taxon, status, and other dimensions, optionally naming taxon and dataset keys
gbif_search_datasetsSearch datasets by keyword, type, publishing country, or publishing or hosting organization
gbif_get_datasetFetch full dataset metadata by UUID: citation, contacts, license, DOI, publishing organization key, coverage
gbif_search_publishersSearch GBIF-registered publishing organizations by name or country

Resources

ResourceDescription
gbif://species/{taxonKey}Taxon record from the GBIF backbone: classification, authorship, synonymy status, vernacular name
gbif://dataset/{datasetKey}Dataset metadata: title, description, citation, license, contacts, coverage, publishing organization key

Both resources are also reachable via gbif_get_species and gbif_get_dataset; many MCP clients are tool-only and never surface resources.

Skills

SkillDescription
gbif-biodiversity-guideAgent guide: where each key comes from, which region filter selects which records, and the checks before quoting a count, a trend, or an absence. Installed with the Claude Code and Codex plugins and the .mcpb, and served over MCP at skill://gbif-biodiversity-guide/SKILL.md

Capability reference

gbif_match_species tool

  • One scientific name (common names go to gbif_search_species), with optional strict, a kingdom to disambiguate, and an expected rank
  • Returns taxonKey, the accepted taxon to pass to the occurrence tools, plus matchedTaxonKey when a synonym was resolved, matchType (EXACT, FUZZY, or HIGHERRANK: a match at a higher rank, such as a misspelled species falling back to its genus or kingdom, where taxonKey covers that whole taxon, or its accepted taxon when the taxon GBIF fell back to is a synonym, and a notice names it), confidence 0–100 (review below 80; a HIGHERRANK match can score above 90), and the classification with a key at each rank
  • matchType NONE fails as no_match, carrying GBIF's note when it gives one (for several equal matches, set kingdom); a blank kingdom fails as invalid_filter

gbif_bulk_match_species tool

  • Scientific names with strict; the first 50 are processed in input order. With read-limit clamping enabled (default), extra names are returned in unprocessedNames, preserving order and duplicates for the next call
  • Each result carries name and matchType, and on a match taxonKey, matchedTaxonKey (synonyms), and confidence; a HIGHERRANK row carries a note naming the higher taxon GBIF matched and what its taxonKey covers: that taxon, or its accepted taxon when it is a synonym. An unmatched name is NONE, with GBIF's explanation in note when it gives one (such as several equal matches for a name shared across kingdoms); a failed lookup is ERROR with error and, when classified, reason, and neither fails the batch

gbif_get_species tool

  • One backbone taxonKey, a non-negative integer (0 is the backbone kingdom incertae sedis); a key not in the backbone fails as not_found, one past the 32-bit range as invalid_filter, and a fraction or negative key fails at the schema
  • Returns the classification with rank keys, authorship, vernacularName, numDescendants, publishedIn, and parentKey; a taxonomicStatus of SYNONYM comes with acceptedKey and accepted. GBIF's taxon record carries no occurrence count: use gbif_count_occurrences

gbif_search_species tool

  • q name fragment (scientific and vernacular), rank, isExtinct, and a checklist datasetKey (omit for the backbone); up to 1,000 per page with integer limit and offset
  • Taxa carry the checklist usage key, optional source datasetKey and mapped backbone nubKey, rank, taxonomicStatus, classification names, vernacularName (GBIF's own, else the first English vernacular name containing q when q is not part of the row's own scientific name, else the first English one), and numDescendants. numOccurrences appears only when GBIF supplies a positive value; its species search sends a 0 placeholder on every row, so count with gbif_count_occurrences on nubKey or a SPECIES_KEY facet. Enrichment reports totalCount, endOfRecords, and the taxonScope applied. Occurrence queries use nubKey when supplied; otherwise resolve the name with gbif_match_species. Omitted datasetKey selects GBIF Backbone Taxonomy d7dddbf4-2cf0-4f39-9b2a-bb099caae36c
  • kingdom, family, and genus take names, matched exactly as GBIF capitalizes them; the narrowest one scopes, and kingdom beside a narrower one disambiguates it. An unknown name fails as unresolved_taxon_scope, a genus outside the named family as conflicting_taxon_scope, and a scope paired with a non-backbone datasetKey matches nothing. A blank filter or a malformed datasetKey fails as invalid_filter

gbif_get_species_classification tool

  • One taxonKey; returns classification root-first from kingdom to the immediate parent, each entry with key, rank, name, and scientificName
  • The queried taxon is not included (use gbif_get_species); a root taxon returns an empty chain with a notice, an unknown key fails as not_found, one past the 32-bit range as invalid_filter, and a fraction or negative key fails at the schema

gbif_get_species_children tool

  • One taxonKey (a non-negative integer; 0 is the backbone's incertae sedis kingdom), up to 1,000 children per page with integer limit and offset; no filters. A fraction or negative value fails at the schema; an unknown key fails as not_found, one past GBIF's 32-bit range as invalid_filter
  • Each child carries key, canonicalName, rank, taxonomicStatus, vernacularName when GBIF has one, and numDescendants; GBIF sends no occurrence count, so use gbif_count_occurrences with the child's key. GBIF reports no total, so endOfRecords (with truncated while more remain) is the continuation signal
  • An empty later page gives offset-reset guidance; only an empty first page for an existing taxon means no direct children

gbif_search_occurrences tool

  • Filters: taxonKey (preferred; scientificName does not match synonyms), country, publishingCountry, stateProvince, gadmGid, a decimalLatitude/decimalLongitude box or WKT geometry, year, month, basisOfRecord, hasCoordinate, isInCluster, coordinateUncertaintyInMeters, datasetKey, catalogNumber, institutionCode, recordedBy, mediaType, occurrenceStatus, iucnRedListCategory; up to 300 per page
  • gadmGid is an uppercase GADM GID (ESP.1_1) GBIF derives from each record's coordinates, so records without coordinates match none; take one from a GADM_LEVEL_0_GID–GADM_LEVEL_3_GID facet or gbif_get_occurrence's gadm field. catalogNumber and institutionCode match the whole value case-insensitively, recordedBy one collector exactly and case-sensitively (take a spelling from a RECORDED_BY facet), and mediaType is StillImage, MovingImage, Sound, or InteractiveResource. taxonKey, month, limit, and offset are integers
  • All supplied spatial filters intersect: combining geometry with latitude or longitude ranges restricts results to their overlap
  • Records carry key, taxonKey, taxonomicStatus, coordinates, eventDate and eventTime, basisOfRecord, occurrenceStatus, iucnRedListCategory, datasetKey, institutionCode, catalogNumber, and issues; enrichment reports totalCount, endOfRecords, and the occurrenceStatus applied
  • Search, count and facets echo the same scope: effective supplied biological filters, with occurrenceStatus always included and pagination controls excluded. ANY is echoed but omitted upstream. taxonKey and scientificName combine with OR. All 11 GBIF basis-of-record values are accepted, including FOSSIL_SPECIMEN, OBSERVATION, and UNKNOWN
  • Latitude, longitude and coordinate uncertainty are independent optional facts; text renders each supplied value, including zero, in decimal degrees or meters
  • offset + limit caps at 100,001 and GBIF has no cursor; a deeper request fails as pagination_cap_exceeded, and a larger match is reached by partitioning on a DATASET_KEY facet from gbif_occurrence_facets. A rejected filter value fails as invalid_filter

gbif_count_occurrences tool

  • Accepts every biological filter listed for gbif_search_occurrences, with the same constraints and spatial intersection. isGeoreferenced remains an alias for hasCoordinate; either alone or both equal works, conflicting values fail as invalid_filter
  • Returns count, with the occurrenceStatus applied in the enrichment; a count above 100,001 carries a notice naming the partition route, and a rejected filter value fails as invalid_filter

gbif_get_occurrence tool

  • One occurrenceKey from a search result, a positive integer (a non-positive or fractional key is rejected at the schema); an unknown key fails as not_found
  • The full Darwin Core record: occurrenceStatus (ABSENT is a survey that found nothing, not a sighting), coordinates, GADM levels 0–3 under gadm, dates with eventTime, taxonomicStatus, iucnRedListCategory, institution, collection, and catalog codes, recordedBy and identifiedBy, media, identifiers, and issues

gbif_occurrence_facets tool

  • facet is one of COUNTRY, STATE_PROVINCE, YEAR, MONTH, BASIS_OF_RECORD, DATASET_KEY, PUBLISHING_COUNTRY, KINGDOM_KEY, PHYLUM_KEY, CLASS_KEY, ORDER_KEY, FAMILY_KEY, GENUS_KEY, SPECIES_KEY, OCCURRENCE_STATUS, IUCN_RED_LIST_CATEGORY, GADM_LEVEL_0_GID–GADM_LEVEL_3_GID, INSTITUTION_CODE, MEDIA_TYPE, RECORDED_BY; up to 100 values per page (facetLimit, default 10), paged with facetOffset
  • Accepts every biological filter listed for gbif_search_occurrences, with the same constraints and spatial intersection. Repeat them on the facet call and each partition search to preserve the population. Returns totalOccurrences and counts ranked by count; a rejected scope value fails as invalid_filter
  • Each facet request fetches one extra bucket to prove continuation. truncated, shown, and cap appear only when that bucket exists; advance facetOffset by the exposed page size. An exactly full final page carries no truncation flag. Empty later pages give offset-reset guidance; an empty first page distinguishes zero matching occurrences from a dimension with no data
  • DATASET_KEY buckets sum to the scope's full total, so it is the facet for partitioning a search too large to page; YEAR, MONTH, STATE_PROVINCE, SPECIES_KEY, INSTITUTION_CODE, MEDIA_TYPE, and RECORDED_BY drop records that lack the field, and the GADM levels drop records without coordinates or outside every GADM unit at that level. MEDIA_TYPE and RECORDED_BY buckets overlap (a record with two media types or two collectors counts in each), so their sums can exceed totalOccurrences. INSTITUTION_CODE buckets come back lowercased and institutionCode takes them unchanged. Pass facet: OCCURRENCE_STATUS with occurrenceStatus: ANY for the presence/absence split
  • includeLabels: true names each bucket on a KINGDOM_KEY–SPECIES_KEY or DATASET_KEY page: counts[].label is the taxon's canonicalName or the dataset title. It costs one GBIF request per exposed bucket (never the lookahead), at most 8 in flight server-wide, no retries, and one 10 s deadline per page; a bucket whose lookup fails or misses it has no label and is counted in notice. Other dimensions ignore it, and without it a facet call is one request

gbif_search_datasets tool

  • Filters: q, type (OCCURRENCE, CHECKLIST, METADATA, SAMPLING_EVENT), publishingCountry, publishingOrg, hostingOrg; up to 1,000 per page
  • Returns key, title, type, license, doi, recordCount, publishingOrganizationKey and publishingOrganizationTitle, and a 300-character description preview, with descriptionTruncated flagging a cut (gbif_get_dataset has the full text). publishingOrganizationKey goes back in as publishingOrg. limit and offset are integers
  • publishingOrg matches the organization whose data it is and is the usual chain from gbif_search_publishers; hostingOrg matches the organization whose installation serves it, and the two together intersect. Both take the lowercase UUID form; anything else, like any rejected filter value, fails as invalid_filter

gbif_get_dataset tool

  • One datasetKey UUID and contactLimit (default 10, max 100; 0 drops contact detail but keeps contactsTotal); a malformed key fails as invalid_filter, an unknown one as not_found
  • Returns description, citationText, license, doi, publishingOrganizationKey (goes into gbif_search_datasets as publishingOrg; the detail record carries no organization name), recordCount, numConstituents, contacts with contactsTotal and contactsReturned, temporalCoverages, and geographicCoverages

gbif_search_publishers tool

  • q name fragment and country (alpha-2 or alpha-3, any case); up to 1,000 per page with integer limit and offset
  • Returns organization key, title, country, and city; the key chains into gbif_search_datasets as publishingOrg
  • A blank q, an empty country, or a country GBIF cannot parse fails as invalid_filter

gbif://species/{taxonKey} resource

  • Taxon record as application/json: classification names, authorship, vernacularName, taxonomicStatus with acceptedKey and accepted, numDescendants
  • taxonKey is a whole signed decimal integer within the signed 32-bit range; 0 is the backbone kingdom incertae sedis. The segment is URI-decoded once and surrounding whitespace is trimmed; leading +, zero padding and their percent-encoded equivalents are accepted. An unknown key fails as not_found; malformed escapes, suffixes, fractions, exponents, hexadecimal forms, embedded whitespace and out-of-range values fail as invalid_filter before a request. Use a backbone key from gbif_match_species or a search result's nubKey, resolving its name when that mapping is absent

gbif://dataset/{datasetKey} resource

  • The gbif_get_dataset record as application/json, including publishingOrganizationKey, with contacts fixed at 10
  • datasetKey comes from gbif_search_datasets or an occurrence record; an unknown key fails as not_found, a malformed one as invalid_filter

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.

GBIF-specific:

  • GBIF API v1 species, occurrence, dataset, and organization endpoints, keyless, with an identifying User-Agent on every request
  • Synonym-safe keys: gbif_match_species resolves a synonym to its accepted taxon, and the occurrence tools filter on that taxonKey
  • Sightings by default: the search, count, and facet tools default occurrenceStatus to PRESENT, excluding absence records. Dataset recordCount spans every status, so it can exceed a gbif_count_occurrences total for the same key
  • Strict country codes: country (where a record was observed) and publishingCountry (the publisher's country) on the occurrence tools, and publishingCountry on gbif_search_datasets, accept only uppercase ISO 3166-1 alpha-2, because other forms silently match nothing there. stateProvince matches verbatim and case-sensitively, so take values from a STATE_PROVINCE facet
  • Blank filters rejected: GBIF reads an empty parameter as no filter, so an optional filter sent blank or whitespace-only fails as invalid_filter instead of widening the query. The exception is a blank country or publishingCountry on the occurrence tools, or a blank publishingCountry on gbif_search_datasets, which fails earlier at the uppercase pattern as -32602 invalid_arguments. Omit a field to leave it off

Agent-friendly output:

  • Scope echo: enrichment reports totalCount, endOfRecords, the occurrenceStatus applied, and the resolved taxonScope, with notices on empty results, over-cap totals, and a stateProvince, gadmGid, or recordedBy that matched nothing
  • Graceful partial failure: gbif_bulk_match_species returns a NONE or ERROR row per name instead of failing the batch
  • Typed errors: invalid_filter, not_found, no_match, unresolved_taxon_scope, conflicting_taxon_scope, and pagination_cap_exceeded, each with a recovery hint
  • Sparse fields omitted rather than null-filled: extinct appears only on taxa GBIF explicitly flags
  • Dataset metadata preserves temporal ranges, single dates, and verbatim periods such as 1975-current; unsupported coverage entries are disclosed. An unavailable supplementary record count carries recordCountNotice while retaining metadata
  • Publisher descriptions retain paragraph breaks and decode numeric character references once; Markdown output renders publisher text literally

Getting started

Public Hosted Instance

A public instance is available at https://gbif-biodiversity.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:

json
{  "mcpServers": {    "gbif-biodiversity-mcp-server": {      "type": "streamable-http",      "url": "https://gbif-biodiversity.caseyjhand.com/mcp"    }  }}

Self-Hosted / Local

Add the following to your MCP client configuration file.

json
{  "mcpServers": {    "gbif-biodiversity-mcp-server": {      "type": "stdio",      "command": "bunx",      "args": ["@cyanheads/gbif-biodiversity-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info"      }    }  }}

Or with npx (no Bun required):

json
{  "mcpServers": {    "gbif-biodiversity-mcp-server": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@cyanheads/gbif-biodiversity-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info"      }    }  }}

Or with Docker:

json
{  "mcpServers": {    "gbif-biodiversity-mcp-server": {      "type": "stdio",      "command": "docker",      "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/gbif-biodiversity-mcp-server:latest"]    }  }}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.4.0 or higher (or Node.js v24+).
  • No credentials: the GBIF endpoints this server calls are public.

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/gbif-biodiversity-mcp-server.git
  1. Navigate into the directory:
sh
cd gbif-biodiversity-mcp-server
  1. Install dependencies:
sh
bun install
  1. Configure environment:
sh
cp .env.example .env# optionally set GBIF_USER_AGENT to a contact URL or email

Configuration

VariableDescriptionDefault
GBIF_BASE_URLGBIF API base URL.https://api.gbif.org/v1
GBIF_CLAMP_READ_LIMITSClamp oversized whole-number read limits to the documented caps and disclose requested/applied values. Bulk matching processes the first 50 names and returns the remainder in unprocessedNames. Set false to advertise and enforce rejecting maxima instead. Strict boolean parsing rejects malformed values.true
GBIF_REQUEST_TIMEOUT_MSPer-request HTTP timeout, in ms.10000
GBIF_USER_AGENTUser-Agent sent on every GBIF request. GBIF asks integrators to identify themselves with a contact URL or email.server name, version, and repository URL
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTHTTP server port.3010
MCP_SESSION_MODEHTTP session mode: stateless, stateful, or auto. src/index.ts declares stateless; set this to override it.stateless
MCP_AUTH_MODEAuthentication: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (debug, info, warning, error, etc.).info
LOG_TOOL_FAILURE_PAYLOADSLog 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
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
STORAGE_PROVIDER_TYPEStorage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1.in-memory
OTEL_ENABLEDEnable OpenTelemetry.false

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

Running the server

Local development

  • Build and run the production version:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:http# orbun run start:stdio
  • Run checks and tests:

    sh
    bun run devcheck  # Lints, formats, type-checks, and morebun run test      # Runs the test suite

Docker

sh
docker build -t gbif-biodiversity-mcp-server .docker run --rm -p 3010:3010 gbif-biodiversity-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/gbif-biodiversity-mcp-server. OpenTelemetry peer dependencies are installed by default; build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/mcp-server/toolsTool definitions (*.tool.ts) and shared tool utilities. Thirteen tools across species taxonomy, occurrences, datasets, and publishers.
src/mcp-server/resourcesResource definitions. Species and dataset resources.
src/services/gbifGBIF API service layer: HTTP client with retry, timeouts, and error mapping, plus raw response types.
src/configServer-specific environment variable parsing and validation with Zod.
tests/Unit and integration tests, mirroring the src/ structure.

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 logging, ctx.state for 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:

sh
bun run devcheckbun run test

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

來源:README.md,提交 4b29653

工具

13

gbif_match_species

Match Species Name

Match a scientific name against the GBIF backbone taxonomy. Returns the best-matching taxon with full classification and a confidence score (0–100). This is the mandatory first step for any GBIF workflow — it returns the backbone taxonKey required by gbif_search_occurrences, gbif_count_occurrences, and gbif_occurrence_facets. When the name GBIF matched is a synonym — the queried name, or the higher taxon a HIGHERRANK match falls back to — taxonKey is the accepted taxon it resolves to and matchedTaxonKey carries the synonym's own key; occurrence counts differ sharply between the two, so pass taxonKey. matchType HIGHERRANK is GBIF's label for a match made at a higher rank: a misspelled or unknown species falls back to its genus or even its kingdom, at a confidence that can exceed 90, and a bare genus name carries the label too, matched as that genus. taxonKey then covers that whole taxon, or its accepted taxon when it is a synonym, and a notice names it. Below confidence 80, the match should be reviewed. matchType NONE means no usable match was found — try removing the strict flag or broadening the name; when GBIF reports several equal matches, as for a genus name shared by an animal and a plant, set kingdom to pick one.

輸入參數name必填rankstrictkingdom

gbif_bulk_match_species

Bulk Match Species Names

Resolve up to 50 scientific names to GBIF backbone taxon keys in one call — the batch counterpart to gbif_match_species for checklist, inventory, and species-list workflows that would otherwise need one round trip per name. Each name is matched independently and results are returned in input order, one entry per processed name. By default, an oversized batch processes the first 50 and returns the remainder in unprocessedNames. A name GBIF matched at a higher rank yields matchType HIGHERRANK with a note naming the taxon matched and what its taxonKey covers: that whole taxon, or its accepted taxon when it is a synonym — a misspelled species can fall back to its genus or kingdom at a confidence above 90, and a bare genus name carries the label too, matched as that genus. A name with no backbone match yields matchType NONE (no taxonKey) instead of failing the batch, with a note carrying GBIF's explanation when it gives one, such as several equal matches for a name shared across kingdoms; a per-name lookup failure yields matchType ERROR carrying that name's error message and, when the failure was classified, a machine-readable reason — the rest of the batch is unaffected, and the call as a whole still succeeds. When the name GBIF matched is a synonym — the queried name, or the higher taxon a HIGHERRANK match falls back to — taxonKey is the accepted taxon it resolves to and matchedTaxonKey carries the synonym's own key. Common names are not supported — use gbif_search_species for vernacular searches. Below confidence 80, review the match.

輸入參數names必填strict

gbif_get_species

Get Species Record

Fetch a single backbone taxon by its GBIF taxon key. Returns full classification, authorship, taxonomic status, vernacular name, descendant count, and publication reference. Use after gbif_match_species when you need the complete record rather than the match summary. When taxonomicStatus is SYNONYM, acceptedKey and accepted fields identify the accepted taxon. The extinct field is absent (not false) on most records — only present on explicitly flagged taxa.

輸入參數taxonKey必填

gbif_search_species

Search Species Taxonomy

Search or browse the GBIF backbone taxonomy by default, or an explicit checklist datasetKey. Accepts scientific name fragments, rank filters, and higher-taxon constraints. Useful for exploring what species exist under a higher taxon (e.g., "list all families of Coleoptera"), for simple name-fragment searches, or when gbif_match_species returns too narrow a result. kingdom, family, and genus scope the browse to a higher taxon: each is resolved to its backbone key before the search runs, so the narrowest one supplied is what scopes, an alternative name resolves to the taxon it is a synonym of, and a name that matches no backbone taxon at that rank fails rather than returning the whole index. Names are capitalized as GBIF writes them ("Paridae", not "paridae") and are matched exactly, not fuzzily. Paginated — use limit and offset to walk through results.

輸入參數qrankgenuslimitfamilyoffsetkingdomisExtinctdatasetKey

gbif_get_species_classification

Get Species Classification

Return the parent chain for a taxon — from kingdom (or domain) down to the immediate parent of the queried taxon — as an ordered array. Each entry has its rank, canonical name, and taxon key. The array is returned root-first (kingdom → phylum → class → … → immediate parent of the queried taxon); the queried taxon itself is not included — call gbif_get_species for its own record. Useful for building taxonomic trees or understanding placement without navigating the backbone level-by-level.

輸入參數taxonKey必填

gbif_get_species_children

Get Species Children

List direct children of a backbone taxon — genera within a family, species within a genus, subspecies within a species. Paginated. Use gbif_match_species to get the taxonKey first, then iterate with offset for large groups.

輸入參數limitoffsettaxonKey必填

gbif_search_occurrences

Search Occurrences

Search GBIF occurrence records with Darwin Core filters. Use taxonKey from gbif_match_species for reliable results — it resolves synonyms automatically. Accepts country (uppercase ISO 3166-1 alpha-2, where the record was observed), publishingCountry (the publishing organization's country — a different question), stateProvince, gadmGid (a GADM administrative-area code GBIF derives from coordinates), bounding box (decimalLatitude/decimalLongitude ranges), WKT polygon geometry, year range, month, basis of record, coordinate filter, dataset key, catalogNumber, institutionCode, recordedBy (collector), and mediaType. Returns sightings only by default — GBIF also indexes absence records (surveys that looked and found nothing), and occurrenceStatus controls whether they are included. Pagination is capped at offset+limit=100,001 and GBIF offers no cursor or scroll, so a larger result set is covered only by partitioning it — facet it by DATASET_KEY with gbif_occurrence_facets and search each datasetKey separately. BASIS_OF_RECORD and PUBLISHING_COUNTRY are gap-free second cuts for a dataset bucket still over the cap; YEAR, MONTH, STATE_PROVINCE, and SPECIES_KEY lose records lacking that dimension. Repeat every biological filter on the facet call and each partition search, including the same occurrenceStatus, and compare sub-split sums against the bucket total. Bulk retrieval is outside this server: use the asynchronous GBIF Download API with a GBIF.org account or the monthly GBIF Parquet snapshot on AWS Open Data.

輸入參數yearlimitmonthoffsetcountrygadmGidgeometrytaxonKeymediaTypedatasetKeyrecordedByisInCluster另有 12 個

gbif_count_occurrences

Count Occurrences

Count occurrences matching a taxon + location filter without fetching records. Use for quick totals ("how many Aves records in Sweden?") or before deciding whether to paginate a full search. Accepts taxonKey, country (uppercase ISO 3166-1 alpha-2), publishingCountry, stateProvince, gadmGid, scientificName, spatial ranges and geometry (intersected), month, basisOfRecord, hasCoordinate (alias isGeoreferenced), isInCluster, coordinateUncertaintyInMeters, datasetKey, year, catalogNumber, institutionCode, recordedBy, mediaType, occurrenceStatus, and iucnRedListCategory. Counts sightings only by default, matching gbif_search_occurrences — GBIF also indexes absence records, and for some taxa they are the overwhelming majority. A count above 100,001 is the signal to partition rather than page: gbif_search_occurrences cannot reach past that offset, so split the query by DATASET_KEY via gbif_occurrence_facets and search each dataset separately.

輸入參數yearmonthcountrygadmGidgeometrytaxonKeymediaTypedatasetKeyrecordedByisInClusterbasisOfRecordcatalogNumber另有 11 個

gbif_get_occurrence

Get Occurrence Record

Fetch a single occurrence record by its GBIF occurrence key. Returns the complete Darwin Core record — all coordinates, administrative geography (GADM levels 0–3), dates, collections metadata, collector identifiers, conservation status, media links, and quality issue flags. Check occurrenceStatus before reading the record as a sighting: ABSENT means a survey looked for the taxon and did not find it. Use the occurrence key from gbif_search_occurrences results.

輸入參數occurrenceKey必填

gbif_occurrence_facets

Occurrence Facet Aggregation

Aggregate occurrence counts across a dimension (COUNTRY, STATE_PROVINCE, YEAR, BASIS_OF_RECORD, DATASET_KEY, KINGDOM_KEY, etc.). Returns one page of facet values ranked by count descending — the top facetLimit at facetOffset 0, a later slice of the same ranking past that. No record payloads returned. Core tool for distribution analysis and trend queries: "which countries have the most records for this species?", "how has observation volume changed since 2010?". Key dimensions (KINGDOM_KEY through SPECIES_KEY, DATASET_KEY) return bare keys; includeLabels names the taxon or dataset behind each one on the page. Scope the aggregation with taxonKey, country (uppercase ISO 3166-1 alpha-2), publishingCountry, stateProvince, gadmGid, year, scientificName, latitude/longitude ranges, month, hasCoordinate, isInCluster, coordinateUncertaintyInMeters, geometry (all spatial filters intersect), basisOfRecord, datasetKey, catalogNumber, institutionCode, recordedBy, mediaType, occurrenceStatus, or iucnRedListCategory filters. Also the way to split a result set too large for gbif_search_occurrences to page (offset+limit caps at 100,001): facet by DATASET_KEY, then search each datasetKey on its own. Aggregates sightings only by default, matching gbif_search_occurrences and gbif_count_occurrences; to measure the presence/absence split itself, pass facet OCCURRENCE_STATUS with occurrenceStatus ANY.

輸入參數yearfacet必填monthcountrygadmGidgeometrytaxonKeymediaTypedatasetKeyfacetLimitrecordedByfacetOffset另有 14 個

gbif_search_datasets

Search Datasets

Search GBIF datasets by keyword, type, publishing country (uppercase ISO 3166-1 alpha-2), publishing organization, or hosting organization. The two organization filters answer different questions — publishingOrg matches the organization whose data it is, hostingOrg the organization whose installation serves it — and an organization key from gbif_search_publishers usually wants publishingOrg. Returns dataset title, description, license, record count, DOI, and the publishing organization's key and name; the key goes back in as publishingOrg. Use to find the source dataset behind a set of records, or to explore what data collections are available for a taxon, country, or organization.

輸入參數qtypelimitoffsethostingOrgpublishingOrgpublishingCountry

gbif_get_dataset

Get Dataset

Fetch full dataset metadata by UUID key — title, description, citation text, contacts, license, DOI, record count, numConstituents (sub-datasets), temporal/geographic coverage, and the publishing organization key, which gbif_search_datasets takes as publishingOrg. Use after gbif_search_datasets or when an occurrence record's datasetKey needs provenance detail. Contacts are capped by contactLimit (default 10); contactsTotal and contactsReturned report the full count.

輸入參數datasetKey必填contactLimit

gbif_search_publishers

Search Publishers

Search organizations registered with GBIF by name fragment or country. Returns organization key, title, and country — sufficient to chain into gbif_search_datasets as publishingOrg for the datasets an organization published, or as hostingOrg for the ones its own installation serves, or to understand who publishes data for a region. publishingOrg is the usual chain: most organizations publish through an installation someone else runs, so hostingOrg matches nothing for them.

輸入參數qlimitoffsetcountry

版本歷史

6
  1. v0.8.0最新Nov 1, 2026
  2. v0.7.7Oct 24, 2026
  3. v0.7.6Oct 23, 2026
  4. v0.7.5Oct 9, 2026
  5. v0.7.4Sep 20, 2026
  6. v0.7.3Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分