{
  "markdown": "<div align=\"center\">\n  <h1>@cyanheads/cdc-health-mcp-server</h1>\n  <p><b>Search and query CDC public health data — mortality, vaccinations, surveillance, behavioral risk (Socrata SODA API) via MCP. STDIO or Streamable HTTP.</b>\n  <div>4 Tools • 2 Resources • 1 Prompt</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n[![Version](https://img.shields.io/badge/Version-0.8.6-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/cdc-health-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/cdc-health-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/cdc-health-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.3.0-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/cdc-health-mcp-server/releases/latest/download/cdc-health-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=cdc-health-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvY2RjLWhlYWx0aC1tY3Atc2VydmVyIl19) [![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%22cdc-health-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads/cdc-health-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://cdc.caseyjhand.com/mcp](https://cdc.caseyjhand.com/mcp)\n\n</div>\n\n---\n\n## Tools\n\nFour tools for discovering and querying CDC public health data. Three query the CDC Open Data portal (Socrata); one queries CDC WONDER mortality statistics:\n\n| Tool | Description |\n|:---|:---|\n| `cdc_discover_datasets` | Search the catalog by keyword, category, or tag. Entry point for all queries. |\n| `cdc_get_dataset_schema` | Fetch column schema, row count, and metadata for a dataset. Essential before writing SoQL queries. Returns a bounded column window with a continuation offset for wide schemas. |\n| `cdc_query_dataset` | Execute SoQL queries — filter, aggregate, sort, full-text search, and field selection. |\n| `cdc_query_wonder` | Query CDC WONDER for national mortality statistics (deaths, population, crude/age-adjusted rates) by year, age, sex, and race, filtered by ICD-10 cause. Covers five CDC mortality databases — final and provisional, underlying-cause and multiple-cause. Large tables page with a continuation offset. |\n\n### `cdc_discover_datasets`\n\nSearch the CDC dataset catalog to find relevant datasets.\n\n- Full-text search across dataset names and descriptions\n- Filter by domain category (e.g., \"NNDSS\", \"Vaccinations\", \"Behavioral Risk Factors\")\n- Filter by domain tags (e.g., `[\"covid19\", \"surveillance\"]`) — a dataset matches on any one tag, so each tag added widens the result set; narrow with `query` or `category`, which intersect with the tag set\n- Returns dataset IDs, names, truncated descriptions, a column count with a short column sample, and update timestamps — use `cdc_get_dataset_schema` for the full column list\n- Each result carries its catalog `assetType` (`dataset`, `filter`, `chart`, `map`, `story`, `file`, `href`); a `columnCount` of 0 marks an entry that is not tabular and yields no data from the other tools\n- Pagination via offset for browsing large result sets — `offset` plus `limit` must not exceed 10,000, the ceiling the catalog enforces\n- `domain` selects the host contacted, `data.cdc.gov` (default) or `chronicdata.cdc.gov` — both front the same catalog and return the same entries, so switching hosts neither widens nor narrows a search\n\n---\n\n### `cdc_get_dataset_schema`\n\nFetch the column schema for a specific dataset.\n\n- Column names, data types, and full descriptions — never truncated per column\n- Row count and last-updated timestamp\n- Essential for understanding column types before writing `$where` clauses\n- Accepts four-by-four dataset identifiers (e.g., `bi63-dtpu`)\n- Returns the first 100 columns by default. Catalog schemas run from 3 to 322 columns, so every ordinary dataset arrives whole; wider ones report `totalCount`, `truncated`, and a `nextOffset` to pass back as `column_offset`. Raise `column_limit` (max 500) to pull a wide schema in one call\n- A `column_offset` at or past the column count returns an empty window rather than an error\n- Fails with `not_queryable` when the ID names a non-tabular catalog asset, rather than returning an empty column list\n- `domain` selects the host contacted, `data.cdc.gov` (default) or `chronicdata.cdc.gov` — a four-by-four ID resolves on either\n\n---\n\n### `cdc_query_dataset`\n\nExecute SoQL queries against any CDC dataset.\n\n- Full SoQL support: `$select`, `$where`, `$group`, `$having`, `$order`\n- Full-text search across all text columns via `$q`\n- Up to 5,000 rows per request with pagination\n- `truncated` is measured, not guessed: the request fetches one row past the limit and drops it, so a page that fills the limit exactly is reported as complete instead of sending you paginating an aggregate\n- `nextOffset` names where to resume whenever rows remain. Pair it with an `order` clause — SODA does not order results implicitly, and `order=\":id\"` works on any dataset\n- Rows are also bounded by a 200,000-character response budget, so a wide dataset at `limit: 5000` returns a usable page with a `nextOffset` rather than several megabytes\n- Returns the SoQL clauses it sent as `effectiveQuery`, values in their original text rather than URL-encoded, so a clause can be copied back into the parameter it came from\n- All response values are strings (per SODA v2.1) — parse based on column type metadata\n- `domain` selects the host contacted, `data.cdc.gov` (default) or `chronicdata.cdc.gov` — a four-by-four ID returns the same rows from either\n\n---\n\n### `cdc_query_wonder`\n\nQuery CDC WONDER for national US mortality statistics — a separate CDC system from the Socrata datasets the other tools query.\n\n`database` picks which of CDC's five mortality databases answers the query:\n\n| Value | CDC database | Years | Race groups | `mcd_icd10` |\n|:---|:---|:---|:---|:---|\n| `underlying_1999_2020` *(default)* | D76 — Underlying Cause of Death | 1999–2020 | 4 bridged | — |\n| `provisional` | D176 — Provisional Mortality Statistics | 2018 → current year | 6 single-race | yes |\n| `underlying_2018_2024` | D158 — Underlying Cause of Death, Single Race | 2018–2024 | 6 single-race | — |\n| `multiple_1999_2020` | D77 — Multiple Cause of Death | 1999–2020 | 4 bridged | yes |\n| `multiple_2018_2024` | D157 — Multiple Cause of Death, Single Race | 2018–2024 | 6 single-race | yes |\n\n- Group results by any of `year`, `age_group`, `sex`, `race` (1–4 dimensions)\n- Filter by ICD-10 underlying cause, sex, age groups, and year range\n- `age_groups` carries the whole list CDC offers: the eleven ten-year groups plus `NS`, the group for a death whose age was not recorded. Listing the eleven without `NS` returns fewer deaths than the same query unfiltered, so include it to match an all-ages total or select it alone to count those deaths\n- `mcd_icd10` matches a cause recorded anywhere on the death certificate rather than only the one certified as underlying — \"died with a respiratory condition listed\", which no underlying-cause query can produce. Accepted only by the three databases marked above; the others reject it. A multiple-cause database queried without it returns the same figures as the underlying-cause database for the same years, and says so\n- `year_range` carries the union of every database's span; a range outside the span of the one selected is rejected with that database's actual years named\n- A `race` breakdown does not carry across the two race families — bridged race combines Asian and Pacific Islander into one group, single race splits them and adds a multiracial category, so the two series are not comparable\n- Both cause filters also take `999--999`, CDC's marker for deaths whose cause it is still withholding under the provisional database's six-month reporting lag. Only `provisional` records them; the other databases reject the code, and the tool says which one to select\n- Row dimension values are CDC's own labels with surrounding whitespace removed, so the same year keys identically across databases — CDC pads a few of them, and `\"2024 \"` and `\"2024\"` would otherwise read as two different years\n- Provisional rows carry CDC's own year labels, e.g. `2025 (provisional)` and `2026 (provisional and partial)`, rather than a bare year\n- Returns deaths, population, and crude death rate, plus age-adjusted rate when WONDER can standardize by age — omitted when grouping by `age_group` or filtering to a single age group\n- Returns the whole table by default. A broad grouping runs long — `[\"year\",\"age_group\",\"sex\",\"race\"]` can pass a thousand rows — so `limit` (max 5,000) and `offset` take it a page at a time, alongside `totalCount`, `truncated`, and a `nextOffset` to resume from. An `offset` at or past the row total returns an empty page rather than an error\n- Paging shapes the response only: WONDER's request carries no limit of its own, so CDC is asked once either way and every page is a slice of the one table. `caveats` and `messages` come back complete on each page; `cellNotes` covers the rows returned, with `row` relative to them\n- National totals only — sub-national (state/county) breakdowns are not available through the WONDER API (CDC vital-statistics policy)\n- CDC replaces some measure values with a status token — `Suppressed` (withheld for confidentiality), `Unreliable` (a rate from fewer than 20 deaths), `Not Applicable` (no population denominator). Those cells read `null` in `rows`; `cellNotes` names the row, column, and token for each\n- CDC also hides whole rows before sending the table — strata with zero deaths, and strata whose death count is suppressed. Those rows are absent from `rows` with nothing marking the gap, so `messages` carries CDC's own statement whenever it happened\n- CDC rejects requests made less than 15 seconds apart, measured from the end of the previous response and counted across all five databases; the server spaces consecutive requests 16 seconds automatically\n\n## Resources and prompt\n\n| Type | Name | Description |\n|:---|:---|:---|\n| Resource | `cdc://datasets` | 50 most-viewed catalog entries for orientation, each with its asset type and column count |\n| Resource | `cdc://datasets/{datasetId}` | Dataset metadata plus the first 100 columns, with the dataset's total column count and a truncation flag; `cdc_get_dataset_schema` reaches the rest |\n| Prompt | `analyze_health_trend` | Picks between CDC WONDER and the Socrata catalog for the question at hand, then runs a 5-step workflow: discover, inspect, baseline query, compare, synthesize |\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):\n\n- Declarative tool definitions — single file per tool, framework handles registration and validation\n- Unified error handling across all tools\n- Pluggable auth (`none`, `jwt`, `oauth`)\n- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`\n- Structured logging with optional OpenTelemetry tracing\n- Runs locally (stdio/HTTP) or on Cloudflare Workers from the same codebase\n\nCDC-specific:\n\n- Wraps the [Socrata SODA API v2.1](https://dev.socrata.com/) — no auth required, optional app token for higher rate limits\n- Adds CDC WONDER mortality access (`cdc_query_wonder`) — national deaths, population, and crude/age-adjusted rates across five mortality databases spanning 1999 through the current year, final and provisional, underlying-cause and multiple-cause; a separate XML-over-HTTP CDC system\n- Discovery-first approach for a heterogeneous catalog (~1,080 datasets across many health domains)\n- Two CDC Socrata hosts via the `domain` input — [`data.cdc.gov`](https://data.cdc.gov/) (default) and [`chronicdata.cdc.gov`](https://chronicdata.cdc.gov/), restricted to this allowlist. Both front one Socrata tenant: a single catalog whose assets — PLACES small-area estimates, the Heart Disease & Stroke Atlas and Environmental Public Health Tracking among them — are discoverable and queryable from either host\n- Conservative request spacing for rate limit compliance (no rate-limit headers returned by Socrata)\n- Handles SODA string-typed responses — all values returned as strings, parsed via column type metadata\n\n## Getting started\n\n### Public Hosted Instance\n\nA public instance is available at `https://cdc.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:\n\n```json\n{\n  \"mcpServers\": {\n    \"cdc-health-mcp-server\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"https://cdc.caseyjhand.com/mcp\"\n    }\n  }\n}\n```\n\n### Self-Hosted / Local\n\nAdd the following to your MCP client configuration file.\n\n```json\n{\n  \"mcpServers\": {\n    \"cdc-health-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/cdc-health-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    \"cdc-health-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/cdc-health-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    \"cdc-health-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"-e\", \"MCP_TRANSPORT_TYPE=stdio\", \"ghcr.io/cyanheads/cdc-health-mcp-server:latest\"]\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\n### Prerequisites\n\n- [Bun v1.3.0](https://bun.sh/) or higher.\n- Optional: [Socrata app token](https://dev.socrata.com/docs/app-tokens.html) for higher rate limits.\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/cdc-health-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd cdc-health-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n## Configuration\n\nAll configuration is validated at startup via Zod schemas in `src/config/server-config.ts`. Key environment variables:\n\n| Variable | Description | Default |\n|:---|:---|:---|\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http` | `stdio` |\n| `MCP_HTTP_PORT` | HTTP server port | `3010` |\n| `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth` | `none` |\n| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.) | `info` |\n| `LOGS_DIR` | Directory for log files (Node.js only) | `<project-root>/logs` |\n| `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1` | `in-memory` |\n| `CDC_APP_TOKEN` | Socrata app token for higher rate limits | none |\n| `CDC_BASE_URL` | Base URL for SODA API requests | `https://data.cdc.gov` |\n| `CDC_CATALOG_URL` | Base URL for Socrata Discovery API | `https://api.us.socrata.com/api/catalog/v1` |\n| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry) (spans, metrics, completion logs) | `false` |\n\n## Running the server\n\n### Local development\n\n- **Build and run the production version**:\n\n  ```sh\n  # One-time build\n  bun run rebuild\n\n  # Run the built server\n  bun run start:http\n  # or\n  bun run start:stdio\n  ```\n\n- **Run checks and tests**:\n  ```sh\n  bun run devcheck  # Lints, formats, type-checks, and more\n  bun run test      # Runs the test suite\n  ```\n\n## Project structure\n\n| Directory | Purpose |\n|:---|:---|\n| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Three CDC data tools. |\n| `src/mcp-server/resources` | Resource definitions. Catalog overview and dataset detail. |\n| `src/mcp-server/prompts` | Prompt definitions. Health trend analysis workflow. |\n| `src/services/socrata` | Socrata SODA API service layer — HTTP client, catalog search, metadata, queries. |\n| `src/config` | Server-specific environment variable parsing and validation with Zod. |\n\n## Development guide\n\nSee [`CLAUDE.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 logging, `ctx.state` for storage\n- Register new tools and resources in the `createApp()` arrays\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\nThis project is licensed under the Apache 2.0 License. See the [LICENSE](./LICENSE) file for details.\n",
  "bytes": 17724,
  "sha": "4e0ce02fcd8a875c769b145c3861d7342a5e01058567e984339ed0ee285cef5b",
  "repo_slug": "cyanheads/cdc-health-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_cyanheads_cdc_health_mcp_serve_1d34108b/readme"
}