{
  "markdown": "<div align=\"center\">\n  <h1>@cyanheads/paleobiology-mcp-server</h1>\n  <p><b>Search fossil occurrences, resolve taxon fossil ranges, plot diversity through deep time, and look up the geologic time scale via MCP. STDIO or Streamable HTTP.</b>\n  <div>8 Tools • 2 Resources</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n[![Version](https://img.shields.io/badge/Version-0.3.5-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/paleobiology-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/paleobiology-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/paleobiology-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0%2B-blueviolet.svg?style=flat-square)](https://bun.sh/)\n\n</div>\n\n<div align=\"center\">\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/paleobiology-mcp-server/releases/latest/download/paleobiology-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=paleobiology-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvcGFsZW9iaW9sb2d5LW1jcC1zZXJ2ZXIiXX0=) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22paleobiology-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fpaleobiology-mcp-server%22%5D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n</div>\n\n<div align=\"center\">\n\n**Public Hosted Server:** [https://paleobiology.caseyjhand.com/mcp](https://paleobiology.caseyjhand.com/mcp)\n\n</div>\n\n---\n\n## Tools\n\nEight tools (seven by default) — five domain tools for the Paleobiology Database, plus a DataCanvas trio for SQL over staged occurrence sets. Large occurrence results spill to a canvas; the other domain tools return inline.\n\n| Tool Name | Description |\n|:----------|:------------|\n| `paleobiology_search_occurrences` | Search fossil occurrences by taxon, geologic time, geography, and depositional environment. Every row carries both modern and paleo coordinates. The flagship; broad results spill to a DataCanvas for SQL. |\n| `paleobiology_get_taxon` | Resolve a taxon by name or `taxon_no` to its accepted name, rank, classification, parent, occurrence count, and first/last-appearance (FAD/LAD) range. Run first to resolve names for the other tools. |\n| `paleobiology_get_diversity` | Compute a diversity / origination / extinction curve for a clade across geologic time, binned by period, epoch, or age. Returns the full bin set inline. |\n| `paleobiology_list_intervals` | Look up the geologic time scale — eons through ages with absolute-age (Ma) boundaries and nesting. Translates named intervals ↔ Ma. Served offline from a bundled ICS snapshot; a name outside it costs one PBDB lookup across the sub-stage and regional scales. |\n| `paleobiology_search_collections` | Find fossil collections (localities) by area and geologic time, with their formation, lithology, depositional environment, and co-occurring-fossils count. Paged inline. |\n| `paleobiology_dataframe_query` | Run a read-only SQL `SELECT` over occurrence sets staged on a DataCanvas by `paleobiology_search_occurrences`. SELECT only. |\n| `paleobiology_dataframe_describe` | List the tables and columns staged on a DataCanvas. Call before `paleobiology_dataframe_query` to discover table and column names. |\n| `paleobiology_dataframe_drop` | Drop a single staged table to free memory before its TTL expires. Opt-in — registered only when `PALEOBIOLOGY_DATAFRAME_DROP_ENABLED=true`. |\n\n---\n\n### `paleobiology_search_occurrences`\n\nSearch fossil occurrences filtered by taxon, geologic time, geography, and environment — the flagship.\n\n- `base_name` (a clade and all its descendants) or `taxon_name` (exact) for the taxon filter\n- `base_id` filters the same clade by its resolved PBDB `taxon_no` — take it from `paleobiology_get_taxon` (or `accepted_no` on an occurrence row) and skip the name ambiguity. `base_name` and `base_id` are mutually exclusive; sending both is rejected at the tool boundary\n- Age by a named interval (e.g. `Maastrichtian`) or a `max_ma`/`min_ma` range, and/or a lng/lat bounding box\n- `collection_no` scopes the search to a single locality — drill from a `paleobiology_search_collections` row into the fauna found there\n- `environment` enum: `marine`, `terrestrial`, `freshwater`\n- At least one filter (taxon, time, place, environment, or `collection_no`) is required — an unfiltered call is rejected before the upstream request, not reported as PBDB being unavailable\n- `lngmin`/`lngmax` are a closed pair (both or neither), and `min_ma` must be strictly less than `max_ma` — both are rejected at the tool boundary with a recovery hint, before the upstream request. A lone `latmin` or `latmax` is valid and filters as a half-plane\n- Every row carries two distinct coordinate systems — **modern** lng/lat (where the rock is today) and **paleo** lng/lat (where the landmass sat at deposition) — plus formation, age interval, and higher classification (phylum through genus)\n- Broad queries return many rows: an inline preview answers the immediate question, and when the set outgrows that preview the matching occurrences — up to the per-call cap (`limit`, further bounded by `PBDB_MAX_OCCURRENCES`) — stage on a DataCanvas for SQL via `paleobiology_dataframe_query`. `canvas_id` and `table_name` come back only on that spill path; a result that fits inline stages nothing\n- Results page inline via `limit`/`offset` against the true upstream match count. When occurrences remain, the notice names the page bounds and the exact next offset (`Showing occurrences 1–500 of 4170. Advance offset to 500 for the next page.`); paging past the end reports the overshoot instead of blaming the filters\n- Reusing a `canvas_id` **replaces** that canvas's occurrence table — each search restages its result, it does not accumulate across calls\n\n---\n\n### `paleobiology_get_taxon`\n\nResolve a taxon by name or integer `taxon_no` to its full record and fossil temporal range — the name-resolution gateway the occurrence and diversity tools depend on.\n\n- Returns accepted name, rank, higher classification, immediate parent, occurrence count, and FAD/LAD range in Ma\n- The `taxon_no` it returns is the `base_id` accepted by `paleobiology_search_occurrences`, `paleobiology_get_diversity`, and `paleobiology_search_collections`\n- `show_children` also lists immediate child taxa, up to 200 per call. `children_truncated` says whether more remain and `children_offset` says where the page started — advance `children_offset` by 200 while `children_truncated` is true to walk the whole child list. A taxon with over 200 immediate children returns a page, never a silently clipped list\n- PBDB taxonomy is opinionated and can differ from GBIF's backbone, so the accepted name may differ from the searched name — the response surfaces both\n\n---\n\n### `paleobiology_get_diversity`\n\nCompute a diversity / origination / extinction curve for a clade across geologic time.\n\n- Clade-inclusive `base_name` **or** `base_id` (exactly one is required; both together, or neither, is rejected at the tool boundary), bound by a named interval (e.g. `Mesozoic`) or a `max_ma`/`min_ma` range (`min_ma` must be strictly less than `max_ma`)\n- `count` enum: `genera`, `species`, `families`; `resolution` enum: `period`, `epoch`, `age`\n- The full bin set returns inline (a diversity series is a bounded set of geologic intervals)\n- Counts reflect **sampled** diversity, biased by collection effort and rock availability — not true past diversity\n\n---\n\n### `paleobiology_search_collections`\n\nFind fossil collections (localities) by area and geologic time — \"what has been dug up here, and from what rock.\"\n\n- Each locality returns location, age (named interval and Ma), formation and strata, lithology, depositional environment, and co-occurring-fossils count\n- Filter by `base_name` or `base_id` (mutually exclusive), a named interval or `max_ma`/`min_ma` range, a lng/lat bounding box, a `formation` or `lithology` name, and/or `environment` — at least one filter is required (an unfiltered call is rejected before the upstream request)\n- Same bounding-box and Ma-ordering rules as `paleobiology_search_occurrences`: `lngmin`/`lngmax` both or neither, `min_ma` strictly less than `max_ma`\n- Results page inline via `limit`/`offset`; the response discloses when more remain\n- Take a `collection_no` from a row — or the same bbox+interval — into `paleobiology_search_occurrences` to see the fauna found together\n\n---\n\n## Resources and prompts\n\n| Type | Name | Description |\n|:---|:---|:---|\n| Resource | `paleobiology://occurrence/{occurrence_no}` | One fossil occurrence with full detail — modern + paleo coordinates, classification, strata, locality, and the CC BY source credit. |\n| Resource | `paleobiology://taxon/{taxon_no}` | One taxon record with its fossil range, classification, and the CC BY source credit. |\n\nAll resource data is also reachable via tools — the resources mirror a single-record read of `paleobiology_search_occurrences` / `paleobiology_get_taxon` for clients that surface resources. Tool-only clients lose nothing. `occurrence_no` and `taxon_no` are bare integers from those tools' output.\n\n---\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):\n\n- Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation\n- Unified error handling — handlers throw, framework catches, classifies, and formats\n- Pluggable auth: `none`, `jwt`, `oauth` (runs `none` by default — PBDB is keyless)\n- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`\n- Structured logging with optional OpenTelemetry tracing\n- STDIO and Streamable HTTP transports\n\nPaleobiology-specific:\n\n- Type-safe client for the Paleobiology Database (PBDB) REST API, requesting `vocab=pbdb` so readable field names come straight from upstream instead of hand-mapped terse codes\n- Bundled ICS geologic time-scale snapshot — `paleobiology_list_intervals` resolves the international scale's named intervals ↔ absolute Ma boundaries with no network call, and falls back to a PBDB lookup for the sub-stage and regional names that occurrence and collection rows report (`Late Maastrichtian`, `Lancian`), labeling each answer with its source and scale\n- DataCanvas spill for broad occurrence queries: an inline preview plus a staged table queryable with read-only SQL (count by interval, group by formation/country, roll up by family from the `classification` JSON column)\n\nAgent-friendly output:\n\n- Two coordinate systems on every occurrence — modern lng/lat and paleo lng/lat — distinctly labeled, so an agent never plots a deep-time fossil on a modern coastline\n- Both temporal representations on every age — the named interval **and** its Ma boundaries\n- Provenance and honesty — every row carries its `reference_no`, every PBDB-backed tool and resource carries the CC-BY attribution, sparse upstream fields (paleo-coords, formation, `late_interval`) are omitted rather than zeroed, and diversity counts are flagged as sampled\n\n---\n\n## Getting started\n\n### Public Hosted Instance\n\nA public instance is available at `https://paleobiology.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:\n\n```json\n{\n  \"mcpServers\": {\n    \"paleobiology-mcp-server\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"https://paleobiology.caseyjhand.com/mcp\"\n    }\n  }\n}\n```\n\n### Self-Hosted / Local\n\nAdd one of the following to your MCP client configuration file. PBDB is keyless — no API key required.\n\nWith bunx:\n\n```json\n{\n  \"mcpServers\": {\n    \"paleobiology-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/paleobiology-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with npx (no Bun required):\n\n```json\n{\n  \"mcpServers\": {\n    \"paleobiology-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/paleobiology-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with Docker:\n\n```json\n{\n  \"mcpServers\": {\n    \"paleobiology-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-e\", \"MCP_TRANSPORT_TYPE=stdio\",\n        \"ghcr.io/cyanheads/paleobiology-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\nFor Streamable HTTP, set the transport and start the server:\n\n```sh\nMCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http\n# Server listens at http://localhost:3010/mcp\n```\n\nTo enable SQL over large occurrence sets, set `CANVAS_PROVIDER_TYPE=duckdb` (the `@duckdb/node-api` peer dep ships in `dependencies`). Without it, `paleobiology_search_occurrences` still returns its inline preview; the `paleobiology_dataframe_*` tools fail with a clear \"canvas disabled\" message.\n\n### Prerequisites\n\n- [Bun v1.3](https://bun.sh/) or higher (or Node.js v24+).\n- No API key — the Paleobiology Database is fully open.\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/paleobiology-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd paleobiology-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n4. **Configure environment (optional):**\n\n```sh\ncp .env.example .env\n# edit .env to override defaults — all vars are optional\n```\n\n## Configuration\n\nAll variables are optional — the server runs with no configuration against the public PBDB API.\n\n| Variable | Description | Default |\n|:---------|:------------|:--------|\n| `PBDB_BASE_URL` | Paleobiology Database API base. Override for a mirror/proxy or pinned API version. | `https://paleobiodb.org/data1.2` |\n| `PBDB_TIMEOUT_MS` | Per-request timeout in milliseconds. Diversity queries over large clades can be slow. | `30000` |\n| `PBDB_MAX_OCCURRENCES` | Hard cap on rows pulled per occurrence/collection call. | `1000` |\n| `CANVAS_PROVIDER_TYPE` | Set to `duckdb` to enable the DataCanvas spill path and `paleobiology_dataframe_*` tools. | `none` |\n| `PALEOBIOLOGY_DATAFRAME_DROP_ENABLED` | Register `paleobiology_dataframe_drop`. Absent from `tools/list` when unset. | `false` |\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |\n| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |\n| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |\n| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry) (spans, metrics, completion logs). | `false` |\n\nSee [`.env.example`](./.env.example) for the full list of optional overrides.\n\n## Running the server\n\n### Local development\n\n- **Build and run:**\n\n  ```sh\n  # One-time build\n  bun run rebuild\n\n  # Run the built server\n  bun run start:stdio\n  # or\n  bun run start:http\n  ```\n\n- **Run checks and tests:**\n\n  ```sh\n  bun run devcheck   # Lint, format, typecheck, security\n  bun run test       # Vitest test suite\n  bun run lint:mcp   # Validate MCP definitions against spec\n  ```\n\n### Docker\n\n```sh\ndocker build -t paleobiology-mcp-server .\ndocker run --rm -p 3010:3010 paleobiology-mcp-server\n```\n\nThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/paleobiology-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.\n\n## Project structure\n\n| Directory | Purpose |\n|:----------|:--------|\n| `src/index.ts` | `createApp()` entry point — registers tools/resources and inits services. |\n| `src/config` | Server-specific environment variable parsing and validation with Zod. |\n| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). |\n| `src/mcp-server/resources` | Resource definitions (`*.resource.ts`). |\n| `src/services/pbdb` | Paleobiology Database HTTP client, normalization, and domain types. |\n| `src/services/intervals` | In-memory index over the bundled ICS geologic time-scale snapshot. |\n| `tests/` | Unit and integration tests mirroring `src/`. |\n\n## Development guide\n\nSee [`CLAUDE.md`/`AGENTS.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage\n- Register new tools and resources via the barrels in `src/mcp-server/*/definitions/index.ts`\n- Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields (a missing paleo-coordinate is \"unknown\", not `0,0`)\n\n## Contributing\n\nIssues and pull requests are welcome. Run checks and tests before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nApache-2.0 — see [LICENSE](LICENSE) for details.\n\nData is from the [Paleobiology Database](https://paleobiodb.org), licensed CC BY 4.0 — credit it in downstream use.\n",
  "bytes": 18020,
  "sha": "d9a98e52903a93a3fdddc44f435d31f4de64b94198ac54f4daf4f5b1b5372b59",
  "repo_slug": "cyanheads/paleobiology-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_cyanheads_paleobiology_mcp_ser_7a2d4984/readme"
}