Cdc Health Mcp Server

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

Search and query CDC public health data — mortality, vaccinations, surveillance, behavioral risk.

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

概覽

AI 產生的概覽

用來搜尋與查詢 CDC 公共衛生資料:透過 SoQL 存取開放資料入口約 1,080 個資料集,並取得 CDC WONDER 的全國死亡率統計。

可以做什麼
  • 依關鍵字、類別、標籤或資源類型搜尋 CDC 資料集目錄,並列出目錄的類別與標籤詞彙表
  • 檢視資料集的欄位結構、資料列數、涵蓋範圍、引用與授權資訊
  • 對 CDC 資料集執行 SoQL 查詢:篩選、彙總、排序、全文檢索與欄位選取
  • 查詢 CDC WONDER,取得五個死亡率資料庫中的全國死亡人數、人口及粗死亡率或年齡標準化死亡率
  • 讀取目錄概觀與個別資料集資源,並依引導式健康趨勢分析提示進行作業
適用情境
當問題需要美國官方公共衛生數據(例如死亡率趨勢、疫苗接種、監測或行為風險資料)時適用,可讓助理先找到合適的 CDC 資料集、確認結構再查詢,而不是憑空給出數字。
執行需求
可作為遠端託管端點使用,也可透過 npx(需 Node.js v24+ 或 Bun v1.4.0+)、Docker 或原始碼建置在本機執行。不需帳號或金鑰;CDC_APP_TOKEN 為選用,僅用於提高 Socrata 速率上限。需要能連線至 CDC 開放資料入口與 CDC WONDER。自行架設時可設定 MCP_TRANSPORT_TYPE、MCP_HTTP_PORT 與 MCP_AUTH_MODE。
安裝前請注意
對公開 CDC 資料為唯讀,不寫入、不涉及付款。CDC WONDER 會拒絕間隔不足 15 秒的請求,因此呼叫會排隊並間隔約 16 秒,較慢的查詢可能以可重試的上游錯誤失敗。臨時性 WONDER 資料只涵蓋部分年度且隱去部分死因;被抑制或不可靠的儲存格會回傳空值。橋接種族與單一族群兩套比率序列不可直接比較。選用的 CDC_APP_TOKEN 屬於憑證,應避免寫入共用設定。

安裝

在 SourceWeft 中

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

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

交給代理程式安裝

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

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

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

其他 MCP 客戶端

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

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

README

@cyanheads/cdc-health-mcp-server

Search and query CDC public health data — mortality, vaccinations, surveillance, behavioral risk (Socrata SODA API) via MCP. STDIO or Streamable HTTP.

5 Tools • 2 Resources • 1 Prompt

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


Overview

CDC public health data from the CDC Open Data portal and CDC WONDER. Search 1,000+ datasets on vaccination, surveillance, and behavioral risk, inspect their schemas and query them with SoQL, or pull national mortality statistics by year, month, age, sex, race, Hispanic origin, or cause of death.

Tools

ToolDescription
cdc_discover_datasetsSearch the CDC dataset catalog by keyword, category, tag, or asset type
cdc_get_dataset_schemaFetch column schema, row count, and metadata for a dataset
cdc_list_catalog_vocabularyList the catalog's category and tag values with their entry counts
cdc_query_datasetExecute SoQL queries — filter, aggregate, sort, full-text search, select fields
cdc_query_wonderQuery CDC WONDER for national mortality, population, and death rates across five databases

Resources

ResourceDescription
cdc://datasetsTop 50 most-viewed catalog entries, for orientation
cdc://datasets/{datasetId}Dataset metadata and the first 100 columns for a specific dataset

Both resources mirror data also reachable via cdc_discover_datasets and cdc_get_dataset_schema, for clients that surface resources but not tools.

Prompts

PromptDescription
analyze_health_trendGuided workflow for investigating a public health question across CDC data

Skill

SkillDescription
cdc-health-guideGates for agents comparing or trending results: which WONDER rate to compare across groups, race beside Hispanic origin, the provisional database's partial year and withheld causes, finding a peak month, splicing WONDER databases, and reading stratified Socrata tables

Ships in skills/ for plugin installs, the npm package, the Docker image, and the .mcpb bundle, and is served over MCP as skill://cdc-health-guide/SKILL.md.

Capability reference

cdc_discover_datasets tool

  • Filters: query, category, tags, and asset_types (dataset, filter, chart, map, story, file, href; ["dataset", "filter"] keeps the entries with rows to query). tags union — a dataset matches when it carries any one of them, so each tag added widens the result set — while query, category, and asset_types intersect with them. limit defaults to 10; offset + limit is capped at 10,000 (page_out_of_range past it). order defaults to relevance when query is set and dataset_id otherwise; relevance order varies between calls, so only dataset_id pages every match exactly once
  • Results carry assetType, permalink, columnCount (0 marks a chart, map, or other non-tabular asset), an 8-name columnSample, and a description cut to 300 characters, plus totalCount and appliedFilters. A link (href) entry's destinations are in accessPoints, and the datasets a chart, map, filter, or story is built on in parentIds
  • When a category or tags value matches nothing, the notice names the closest catalog values with their entry counts, e.g. Vaccination → "Vaccinations" (89 datasets)

cdc_get_dataset_schema tool

  • Takes a four-by-four datasetId (e.g. bi63-dtpu). column_limit (default 100) and column_offset page wide schemas, reporting totalCount, truncated, and nextOffset
  • The dataset description is capped at 4,000 characters by default (descriptionTruncated and descriptionLength are set when cut); full_description: true returns the whole text
  • Columns carry fieldName, dataType, and description. rowCountSource says whether rowCount is live or Socrata's cached figure
  • Where the publisher recorded them, temporalCoverage, updateFrequency, geographicCoverage, citation, license, and attribution come back as the publisher's own text, and a filter carries parentId, the dataset it is a view of
  • A chart or map fails with not_queryable, naming the dataset it is built on

cdc_list_catalog_vocabulary tool

  • Every category comes back whole; the ~1,600 tags are ranked by entry count and paged with tag_limit (default 50) and tag_offset. filter (up to 500 characters) narrows both by word match, not fuzzy matching; a word under 3 letters or digits matches whole words only
  • Each value carries datasetCount; the response also reports vocabularySize, categoryCount, tagCount, truncated, nextOffset, and truncationCeiling (an upper bound on the counts of the tags after the page)

cdc_query_dataset tool

  • Clauses: select, where, group, having, order, and full-text search. Up to 1,000 rows per call (default 100; a larger limit is clamped, and the notice names the clamp when rows remain), offset up to 1,000,000
  • For stable offset paging, set an order ending in a unique tie-breaker (:id on ungrouped rows, the grouped columns on a grouped query); the notice says so when it is missing
  • effectiveQuery echoes the SoQL clauses as sent; truncated and nextOffset report paging, with no totalCount. A chart or map ID fails with not_queryable, naming the dataset it is built on

cdc_query_wonder tool

databaseCDC databaseYearsRace groupsmcd_icd10
underlying_1999_2020 (default)D76 — Underlying Cause of Death1999–20204 bridged—
provisionalD176 — Provisional Mortality Statistics2018 → current year (latest year partial)6 single-raceyes
underlying_2018_2024D158 — Underlying Cause of Death, Single Race2018–20246 single-race—
multiple_1999_2020D77 — Multiple Cause of Death1999–20204 bridgedyes
multiple_2018_2024D157 — Multiple Cause of Death, Single Race2018–20246 single-raceyes
  • group_by takes 1–4 of year, month, age_group, sex, race, hispanic_origin, icd_chapter, icd_subchapter, cause_113, leading_causes (alone only), and injury_intent; results are always national. A grouping that could produce more than 10,000 rows is refused before any request. cause_icd10 and mcd_icd10 take an ICD-10 code, a range (X40-X49), or a list of up to 50. age_groups takes NS (age not stated) alone or with all eleven known groups. race reports four bridged groups on the 1999–2020 databases and six single-race groups on the rest; the two families' series are not comparable
  • limit pages the table fetched from CDC; omitted, it returns the rest of the table from offset, up to 10,000 rows per call. A larger limit is lowered to that ceiling, which equals the table-size bound, so one call always holds the whole table. offset goes up to 10,000
  • Rows carry deaths, population, crude_rate, and age_adjusted_rate where age can be standardized, each rate followed by its 95% confidence interval (crude_rate_lower and crude_rate_upper, age_adjusted_rate_lower and age_adjusted_rate_upper), null where CDC sent none. Chapter and sub-chapter rows add cause_code, the ICD-10 range cause_icd10 takes; cause_113 rows add cause_level; month rows carry deaths only. Cells CDC returns as Suppressed, Unreliable, or Not Applicable read null and are listed in cellNotes; messages reports rows CDC hid, and totalCount is exact
  • The provisional database's latest year covers part of the year against a full-year population, and CDC withholds some recent causes; a notice says so whenever a query reaches either, and on a month grouping names the month the data ends in as partial
  • CDC rejects requests less than 15 seconds apart, so calls are queued one at a time and spaced 16 seconds apart. A request WONDER has not finished answering within 20 seconds fails as a retryable upstream_error

cdc://datasets resource

  • Top 50 catalog entries by popularity, each with id, name, assetType, category, columnCount, and updatedAt, plus the catalog totalCount
  • columnCount: 0 marks a non-tabular entry; cdc_discover_datasets searches and pages the full catalog

cdc://datasets/{datasetId} resource

  • Dataset metadata plus the first 100 columns as application/json, with columnCount and truncated; the description is capped at 4,000 characters. It carries the same parentId and publisher fields as cdc_get_dataset_schema, and a chart or map fails with not_queryable, naming its parent dataset
  • For more columns or the full description, use cdc_get_dataset_schema with column_offset or full_description: true

analyze_health_trend prompt

  • Arguments: topic required; timeRange and geography optional
  • Returns one user message that routes the question to cdc_query_wonder (national mortality) or the Socrata tools (everything else), then walks discover → inspect → baseline → compare → synthesize

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.

CDC-specific:

  • The Socrata SODA API v2.1 over the CDC Open Data portal (~1,080 datasets); no auth required, and an optional app token raises rate limits
  • CDC WONDER mortality data from five databases covering 1999 through the current year, reached over its XML request API
  • The four Socrata tools take a domain input, limited to data.cdc.gov (default) and chronicdata.cdc.gov; both serve the same catalog
  • category and tags must match the catalog's own values (matched ignoring case, otherwise exactly); cdc_list_catalog_vocabulary lists them
  • Socrata returns values as strings (geo columns as GeoJSON objects), and a column like year is numeric in some datasets and text in others. Match WHERE literals to the column's dataType: numbers bare, strings single-quoted

Agent-friendly output:

  • Paging is reported explicitly: totalCount, truncated, nextOffset, and shown/cap. limit sets the page: cdc_query_dataset clamps it to 1,000 rows, naming the clamp in the notice when rows remain, and cdc_query_wonder lowers it to 10,000, its table-size bound; up to those ceilings a page ends short of limit only at the end of the result set
  • Typed errors with a recovery hint on every declared reason, such as not_queryable, page_out_of_range, and invalid_query
  • Upstream gaps stay visible: WONDER status tokens in cellNotes, hidden-row notices in messages, and rowCountSource on schema row counts
  • effectiveQuery echoes the SoQL clauses or a WONDER query summary, so a result can be reproduced

Getting started

Connect to the hosted instance, no install:

sh
claude mcp add --transport http cdc-health-mcp-server https://cdc.caseyjhand.com/mcp

Or run it locally:

sh
claude mcp add cdc-health-mcp-server -- npx -y @cyanheads/cdc-health-mcp-server

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

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

Setting CDC_APP_TOKEN to a Socrata app token raises the Socrata rate limits. For Docker or a source build, see Running the server.

Configuration

VariableDescriptionDefault
CDC_APP_TOKENSocrata app token; raises rate limits.none
CDC_BASE_URLSODA host for requests with no domain (the cdc://datasets/{datasetId} resource).https://data.cdc.gov
CDC_CATALOG_URLSocrata Discovery API base URL.https://api.us.socrata.com/api/catalog/v1
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTHTTP server port.3010
MCP_SESSION_MODEHTTP session mode: stateless, stateful, or auto.stateless
MCP_AUTH_MODEAuthentication: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (debug, info, warning, error, etc.).info
OTEL_ENABLEDEnable OpenTelemetry.false

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

Running the server

Local development

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

  • Clone and install:

    sh
    git clone https://github.com/cyanheads/cdc-health-mcp-server.gitcd cdc-health-mcp-server && bun installcp .env.example .env   # optionally set CDC_APP_TOKEN
  • 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 run --rm -p 3010:3010 ghcr.io/cyanheads/cdc-health-mcp-server:latest

The image defaults to HTTP transport, stateless session mode, and logs to /var/log/cdc-health-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/cdc-health-mcp-server:latest"]. To build locally, docker build -t cdc-health-mcp-server .; OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools/resources/prompts and inits services.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts). Four Socrata tools and one WONDER tool.
src/mcp-server/resourcesResource definitions. Catalog overview and dataset detail.
src/mcp-server/promptsPrompt definitions. Health trend analysis workflow.
src/services/socrataSocrata service — catalog search, vocabularies, metadata, SoQL queries.
src/services/wonderCDC WONDER service — XML request builder, response parser, request spacing.
src/utilsShared helpers — HTML-to-text, table-cell escaping, vocabulary matching.
skills/cdc-health-guideAgent skill published to agents that install the server, and served over MCP as skill://cdc-health-guide/SKILL.md.
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 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

Apache-2.0 — see LICENSE for details.

來源:README.md,提交 21c37d3

工具

5

cdc_discover_datasets

Cdc Discover Datasets

Search the CDC dataset catalog by keyword, category, tag, or asset type. Returns IDs, names, truncated descriptions, asset types, column counts, update timestamps, and portal links. The catalog also holds charts, maps, stories, files, and links; an entry whose columnCount is 0 is one of those and yields no data from the other tools — reach a file or link through its permalink or accessPoints, and a chart or map through the dataset its parentIds name. Use cdc_get_dataset_schema for the full column list of a chosen dataset.

輸入參數tagslimitorderquerydomainoffsetcategoryasset_types

cdc_get_dataset_schema

Cdc Get Dataset Schema

Fetch the column schema for a CDC dataset — names, data types, descriptions, row count, last-updated timestamp, and, for a filter, the dataset it is a view of — with the period and area it covers, how often it is updated, its suggested citation, license, and attribution wherever the publisher recorded them. A chart or map has no schema of its own; the failure names the dataset it is built on. Returns the first 100 columns by default; wide datasets continue via column_offset. The dataset description is capped at 4,000 characters by default; pass full_description: true for the whole text. Get dataset IDs from cdc_discover_datasets.

輸入參數domaindatasetId必填column_limitcolumn_offsetfull_description

cdc_list_catalog_vocabulary

List CDC Catalog Vocabulary

List the controlled vocabularies cdc_discover_datasets' category and tags filters are matched against — every domain category and domain tag the CDC catalog publishes, each with the number of entries carrying it. Call it before filtering a search: a value the catalog does not carry matches nothing and returns an empty page, which is indistinguishable from a real value with no results. All categories come back whole; the tag vocabulary runs to roughly 1,600 values, so tags are ranked by entry count and returned one page at a time via tag_limit and tag_offset. Pass filter to narrow both vocabularies to the values whose words contain its words, or that appear whole inside it; a filter under three letters or digits matches whole words only.

輸入參數domainfiltertag_limittag_offset

cdc_query_dataset

Cdc Query Dataset

Execute a SoQL query against any CDC dataset. Supports filtering, aggregation, sorting, full-text search, and field selection. Use cdc_discover_datasets to find dataset IDs and cdc_get_dataset_schema to inspect columns before querying.

輸入參數grouplimitorderwheredomainhavingoffsetsearchselectdatasetId必填

cdc_query_wonder

Cdc Query Wonder

Query CDC WONDER for national US mortality statistics — deaths, population, and crude/age-adjusted death rates — across its five mortality databases, selected with the database input: final underlying-cause data for 1999–2020 (the default) or 2018–2024, provisional data running from 2018 through the current year (its latest year partial, with a notice saying so), and two multiple-cause databases covering the same two eras. Break results out by year, month, age group, sex, race, Hispanic origin, or underlying cause of death — ICD-10 chapter or sub-chapter, CDC's 113-cause list, its 15 leading causes, or injury intent — and filter by ICD-10 cause of death, sex, age group, or year range; on a multiple-cause database, mcd_icd10 additionally matches a cause listed anywhere on the death certificate rather than only the one certified as underlying. Each database holds a different span of years (1999–2026 across all of them) and a request whose year_range falls outside the selected one's span is rejected with that span named. WONDER is a separate CDC system from the Socrata datasets the other cdc_* tools query. Data is national only — sub-national (state/county) breakdowns are not available through the API (CDC vital-statistics policy). Chapter and sub-chapter rows carry their ICD-10 code range as cause_code, which cause_icd10 accepts as it stands; 113-cause-list rows carry cause_level, their depth in that nested list, whose deeper causes are already counted in the cause containing them; leading_causes ranks the 15 leading causes by deaths and combines with no other grouping, while the filters still apply; month rows carry deaths only — CDC publishes no monthly population, so population and both rates come back "Not Applicable". The values each grouping dimension can take multiply to bound the table — year beside month, or icd_chapter beside icd_subchapter, adds nothing, since the finer level already enumerates the coarser — and a grouping that could produce more than 10,00

輸入參數sexlimitoffsetdatabasegroup_bymcd_icd10age_groupsyear_rangecause_icd10

版本歷史

6
  1. v0.11.0最新Nov 1, 2026
  2. v0.10.0Oct 13, 2026
  3. v0.9.3Oct 7, 2026
  4. v0.9.2Sep 23, 2026
  5. v0.9.0Sep 21, 2026
  6. v0.8.7Sep 16, 2026

評分

已滿足適用檢查項的 100%

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

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