Cdc Health Server
БесплатноПоддерживаетсяDiscover and query CDC public health datasets via the Socrata SODA API. Provides tools for dataset discovery, schema inspection, and SoQL queries, plus resource
Описание
Discover and query CDC public health datasets via the Socrata SODA API. Provides tools for dataset discovery, schema inspection, and SoQL queries, plus resources and a guided prompt for health trend analysis.
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.
Public Hosted Server: https://cdc.caseyjhand.com/mcp
Overview
CDC public health data — the Socrata-based CDC Open Data portal, plus CDC WONDER, a separate CDC system for national mortality statistics. Search the catalog, inspect dataset schemas, and run SoQL queries across vaccination, surveillance, and behavioral-risk data, or query WONDER for deaths, population, and death rates by year, age, sex, and race. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
Tools
| Tool | Description |
|---|---|
cdc_discover_datasets |
Search the CDC dataset catalog by keyword, category, or tag |
cdc_get_dataset_schema |
Fetch column schema, row count, and metadata for a dataset |
cdc_query_dataset |
Execute SoQL queries — filter, aggregate, sort, full-text search, select fields |
cdc_query_wonder |
Query CDC WONDER for national mortality, population, and death rates across five databases |
Resources
| Resource | Description |
|---|---|
cdc://datasets |
Top 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
| Prompt | Description |
|---|---|
analyze_health_trend |
Guided workflow for investigating a public health question across CDC data |
Capability reference
cdc_discover_datasets tool
domainselectsdata.cdc.gov(default) orchronicdata.cdc.gov— both front the same catalog, so switching hosts neither widens nor narrows a searchquery,category, andtagsfilters — tags union (a dataset matches on any one tag, so each tag added widens the result set), whilequeryandcategoryintersect with the tag set- Up to 100 results per page (default 10);
offsetis capped at 9999, andoffset + limitmust not exceed 10,000 — Socrata's catalog ceiling order:dataset_id(default) sorts deterministically for stable pagination;relevanceranks by best match but is not stably paginable across pages- Each result carries
columnCount— a value of 0 marks a non-tabular asset (chart, map, story, file, or href) that yields no data from the other tools;assetTypeis descriptive only - Enrichment carries
totalCountandappliedFilters; anoticedistinguishes an offset past the end of the result set from a search that matched nothing
cdc_get_dataset_schema tool
- Accepts a four-by-four
datasetId(e.g.bi63-dtpu) and the samedomainenum as the other Socrata tools - Returns the first 100 columns by default (
column_limit, max 500) — catalog schemas run 3 to 322 columns, so ordinary datasets arrive whole; wider ones reporttotalCount,truncated, andnextOffsetto pass back ascolumn_offset - A
column_offsetat or past the column count returns an empty window rather than an error - Fails with
not_queryablewhen the ID names a non-tabular catalog asset, rather than returning an empty column list
cdc_query_dataset tool
- Full SoQL support —
select,where,group,having,order, plus full-textsearchacross text columns - Up to 5,000 rows per request (default 100);
offsetcapped at 1,000,000 truncatedis measured by an over-fetch probe (one row past the limit), never guessed from the row count; rows are also bounded by a 200,000-character response budget, so a wide page can end short oflimitwith anextOffseteffectiveQueryechoes the SoQL clauses sent in their original text, not URL-encoded, so a clause can be copied back into the parameter it came from- All response values are strings (SODA v2.1) — parse per the column's
dataTypefrom the schema
cdc_query_wonder tool
database selects which of five mortality databases answers the query:
| Value | CDC database | Years | Race groups | mcd_icd10 |
|---|---|---|---|---|
underlying_1999_2020 (default) |
D76 — Underlying Cause of Death | 1999–2020 | 4 bridged | — |
provisional |
D176 — Provisional Mortality Statistics | 2018 → current year | 6 single-race | yes |
underlying_2018_2024 |
D158 — Underlying Cause of Death, Single Race | 2018–2024 | 6 single-race | — |
multiple_1999_2020 |
D77 — Multiple Cause of Death | 1999–2020 | 4 bridged | yes |
multiple_2018_2024 |
D157 — Multiple Cause of Death, Single Race | 2018–2024 | 6 single-race | yes |
group_by: 1–4 ofyear,age_group,sex,race; national totals only — no sub-national breakdown at any settingmcd_icd10matches a cause recorded anywhere on the death certificate rather than only the underlying cause; accepted only byprovisional,multiple_1999_2020, andmultiple_2018_2024— the others reject itage_groupsmust include"NS"(age not recorded) to match an unfiltered total; ayear_rangeoutside the selected database's span is rejected with that span named- Measure cells CDC withholds or flags (
Suppressed,Unreliable,Not Applicable) readnullinrowsand are named per cell incellNotes; whole rows CDC hides (zero or suppressed deaths) are absent fromrowswith no gap marker — checkmessages - Returns the whole table by default;
limit(max 5,000) andoffset(max 10,000) page it, alongsidetotalCount,truncated, andnextOffset - Consecutive requests are spaced 16 seconds automatically — CDC rejects anything sent less than 15 seconds after the prior response finished, measured across all five databases
cdc://datasets resource
- Top 50 CDC catalog entries by popularity, each carrying
assetTypeandcolumnCountfor orientation columnCount: 0marks a non-tabular entry (chart, map, story, file, or href); usecdc_discover_datasetsfor full catalog search with filtering and pagination
cdc://datasets/{datasetId} resource
- Dataset metadata plus the first 100 columns as
application/json;datasetIdis a four-by-four identifier fromcdc_discover_datasets - Carries the dataset's total
columnCountand atruncatedflag; wider schemas continue viacdc_get_dataset_schemawithcolumn_offset - Takes no query-parameter selector — an RFC 6570
{?column_limit,column_offset}template would stop the barecdc://datasets/{datasetId}form from matching at all
analyze_health_trend prompt
- Arguments:
topicrequired;timeRangeandgeographyoptional - Returns one user message that routes the question to CDC WONDER (national mortality, 1999–current, ICD-10-filterable) or the Socrata catalog (everything else), then walks discover → inspect → baseline query → compare → synthesize
- Routing is prose for the reader to act on — the handler does not classify the topic itself
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:
- Wraps the Socrata SODA API v2.1 (the CDC Open Data portal, ~1,080 datasets) — no auth required, optional app token for higher rate limits
- Adds CDC WONDER mortality access (
cdc_query_wonder) — a separate XML-over-HTTP CDC system, spanning five mortality databases from 1999 through the current year - Discovery-first workflow for a heterogeneous catalog — discover, inspect schema, then query
- Two Socrata hosts via the
domaininput (data.cdc.gov,chronicdata.cdc.gov), allowlisted at the schema level — both front one tenant, so assets like PLACES and the Heart Disease & Stroke Atlas are reachable from either - Conservative request spacing for both APIs — no rate-limit headers from Socrata, and CDC WONDER requests are spaced 16 seconds apart automatically
Agent-friendly output:
- Pagination and truncation disclosed on every tool —
totalCount/truncated/nextOffset(orshown/cap) rather than a bare row count, so an agent can tell a complete result from a page of one - Typed error contracts with a
recoveryhint on every declared reason (e.g.not_queryable,page_out_of_range) — actionable next steps, not just an error code - Upstream data gaps stay visible rather than silently dropped — CDC's status tokens (
Suppressed,Unreliable,Not Applicable) are named per cell incellNotes, and hidden-row notices surface inmessages effectiveQueryechoes the exact query sent (SoQL clauses or a WONDER summary), so a result is reproducible and a clause can be copied back into its parameter
Getting started
Public Hosted Instance
A public instance is available at https://cdc.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"cdc-health-mcp-server": {
"type": "streamable-http",
"url": "https://cdc.caseyjhand.com/mcp"
}
}
}
Self-Hosted / Local
Add the following to your MCP client configuration file.
{
"mcpServers": {
"cdc-health-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/cdc-health-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"cdc-health-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/cdc-health-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"cdc-health-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/cdc-health-mcp-server:latest"]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp
Prerequisites
- Bun v1.4.0 or higher.
- Optional: Socrata app token for higher rate limits.
Installation
- Clone the repository:
git clone https://github.com/cyanheads/cdc-health-mcp-server.git
- Navigate into the directory:
cd cdc-health-mcp-server
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
# edit .env and set optional overrides
Configuration
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT_TYPE |
Transport: stdio or http |
stdio |
MCP_HTTP_PORT |
HTTP server port | 3010 |
MCP_SESSION_MODE |
HTTP session posture: stateful, stateless, or auto. src/index.ts declares stateless; this variable overrides it |
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 |
STORAGE_PROVIDER_TYPE |
Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1 |
in-memory |
CDC_APP_TOKEN |
Socrata app token for higher rate limits | — |
CDC_BASE_URL |
Base URL for SODA API requests | https://data.cdc.gov |
CDC_CATALOG_URL |
Base URL for Socrata Discovery API | https://api.us.socrata.com/api/catalog/v1 |
OTEL_ENABLED |
Enable OpenTelemetry instrumentation (spans, metrics, completion logs) | false |
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Docker
docker build -t cdc-health-mcp-server .
docker run --rm -p 3010:3010 cdc-health-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/cdc-health-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). Four CDC data tools. |
src/mcp-server/resources |
Resource definitions. Catalog overview and dataset detail. |
src/mcp-server/prompts |
Prompt definitions. Health trend analysis workflow. |
src/services/socrata |
Socrata SODA API service layer — HTTP client, catalog search, metadata, queries. |
src/services/wonder |
CDC WONDER service layer — XML request builder and response parser. |
src/utils |
Shared helpers, including escapeTableCell for format() output. |
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/catchin tool logic - Use
ctx.logfor logging,ctx.statefor storage - Register new tools and resources in the
createApp()arrays - 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.
Установить Cdc Health Server в Claude Desktop, Claude Code, Cursor
unyly install cdc-health-mcp-serverСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add cdc-health-mcp-server --env MCP_LOG_LEVEL="" --env MCP_TRANSPORT_TYPE="" -- npx -y @cyanheads/cdc-health-mcp-serverПошаговые гайды: как установить Cdc Health Server
FAQ
Cdc Health Server MCP бесплатный?
Да, Cdc Health Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Cdc Health Server?
Да, требуются переменные окружения: MCP_LOG_LEVEL, MCP_TRANSPORT_TYPE. Unyly подставит их в конфиг при установке.
Cdc Health Server — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Cdc Health Server в Claude Desktop, Claude Code или Cursor?
Открой Cdc Health Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Изменения
Версии и запрашиваемые доступы со временем.
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectAmap Maps Mcp Server
MCP server for using the AMap Maps API
автор: duxiaohuiSupabase
Database, auth and storage
автор: SupabaseEverything
Reference / test server with prompts, resources, and tools.
Git
Tools to read, search, and manipulate Git repositories.
Sequential Thinking
Dynamic and reflective problem-solving through thought sequences.
Time
Time and timezone conversion capabilities.
Compare Cdc Health Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
