Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

MCP server for discovering and querying CDC public health datasets via the Socrata SODA API.

README.md

<div align="center"> <h1>@cyanheads/cdc-health-mcp-server</h1> <p><b>Search and query CDC public health data — mortality, vaccinations, surveillance, behavioral risk (Socrata SODA API) via MCP. STDIO or Streamable HTTP.</b> <div>4 Tools • 2 Resources • 1 Prompt</div> </p> </div>

<div align="center">

![Version](./CHANGELOG.md) ![License](./LICENSE) ![Docker](https://github.com/users/cyanheads/packages/container/package/cdc-health-mcp-server) ![MCP SDK](https://modelcontextprotocol.io/) ![npm](https://www.npmjs.com/package/@cyanheads/cdc-health-mcp-server) ![TypeScript](https://www.typescriptlang.org/) ![Bun](https://bun.sh/)

</div>

<div align="center">

![Install in Claude Desktop](https://github.com/cyanheads/cdc-health-mcp-server/releases/latest/download/cdc-health-mcp-server.mcpb) ![Install in Cursor](https://cursor.com/en/install-mcp?name=cdc-health-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvY2RjLWhlYWx0aC1tY3Atc2VydmVyIl19) ![Install in VS Code](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)

![Framework](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)

</div>

<div align="center">

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

</div>

---

Tools

Four tools for discovering and querying CDC public health data. Three query the CDC Open Data portal (Socrata); one queries CDC WONDER mortality statistics:

| Tool | Description | |:---|:---| | cdc_discover_datasets | Search the catalog by keyword, category, or tag. Entry point for all queries. | | cdc_get_dataset_schema | Fetch column schema, row count, and metadata for a dataset. Essential before writing SoQL queries. | | cdc_query_dataset | Execute SoQL queries — filter, aggregate, sort, full-text search, and field selection. | | 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. |

cdc_discover_datasets

Search the CDC dataset catalog to find relevant datasets.

  • Full-text search across dataset names and descriptions
  • Filter by domain category (e.g., "NNDSS", "Vaccinations", "Behavioral Risk Factors")
  • Filter by domain tags (e.g., ["covid19", "surveillance"])
  • 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
  • Pagination via offset for browsing large result sets
  • domain selects the portal: data.cdc.gov (default) or chronicdata.cdc.gov

---

cdc_get_dataset_schema

Fetch the full column schema for a specific dataset.

  • Column names, data types, and descriptions
  • Row count and last-updated timestamp
  • Essential for understanding column types before writing $where clauses
  • Accepts four-by-four dataset identifiers (e.g., bi63-dtpu)
  • domain selects the portal hosting the dataset: data.cdc.gov (default) or chronicdata.cdc.gov

---

cdc_query_dataset

Execute SoQL queries against any CDC dataset.

  • Full SoQL support: $select, $where, $group, $having, $order
  • Full-text search across all text columns via $q
  • Up to 5,000 rows per request with pagination
  • Returns the assembled SoQL query string for debugging
  • All response values are strings (per SODA v2.1) — parse based on column type metadata
  • domain selects the portal hosting the dataset: data.cdc.gov (default) or chronicdata.cdc.gov

---

cdc_query_wonder

Query CDC WONDER for national US mortality statistics from the Underlying Cause of Death database (D76, 1999–2020) — a separate CDC system from the Socrata datasets the other tools query.

  • Group results by any of year, age_group, sex, race (1–4 dimensions)
  • Filter by ICD-10 underlying cause, sex, ten-year age groups, and year range
  • Returns deaths, population, and crude death rate, plus age-adjusted rate when not grouping by age
  • National totals only — sub-national (state/county) breakdowns are not available through the WONDER API (CDC vital-statistics policy)
  • CDC suppresses any cell with fewer than 10 deaths (returned as null)
  • Rate-limited to one request per ~15 seconds; requests are spaced automatically

Resources and prompt

| Type | Name | Description | |:---|:---|:---| | Resource | cdc://datasets | Top 50 datasets by popularity for orientation | | Resource | cdc://datasets/{datasetId} | Dataset metadata and column schema (equivalent to schema tool) | | Prompt | analyze_health_trend | Guided 5-step workflow: discover, inspect, baseline query, compare, synthesize |

Features

Built on @cyanheads/mcp-ts-core:

  • Declarative tool definitions — single file per tool, framework handles registration and validation
  • Unified error handling across all tools
  • Pluggable auth (none, jwt, oauth)
  • Swappable storage backends: in-memory, filesystem, Supabase, Cloudflare KV/R2/D1
  • Structured logging with optional OpenTelemetry tracing
  • Runs locally (stdio/HTTP) or on Cloudflare Workers from the same codebase

CDC-specific:

  • Wraps the Socrata SODA API v2.1 — no auth required, optional app token for higher rate limits
  • Adds CDC WONDER mortality access (cdc_query_wonder) — national deaths, population, and crude/age-adjusted rates from the Underlying Cause of Death database (1999–2020), a separate XML-over-HTTP CDC system
  • Discovery-first approach for a heterogeneous catalog (~1,487 datasets across many health domains)
  • Two CDC Socrata portals via the domain input — data.cdc.gov (default) and chronicdata.cdc.gov (PLACES small-area estimates, the Heart Disease & Stroke Atlas, Environmental Public Health Tracking); restricted to this allowlist
  • Conservative request spacing for rate limit compliance (no rate-limit headers returned by Socrata)
  • Handles SODA string-typed responses — all values returned as strings, parsed via column type metadata

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

Installation

  1. Clone the repository:
git clone https://github.com/cyanheads/cdc-health-mcp-server.git
  1. Navigate into the directory:
cd cdc-health-mcp-server
  1. Install dependencies:
bun install

Configuration

All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:

| Variable | Description | Default | |:---|:---|:---| | MCP_TRANSPORT_TYPE | Transport: stdio or http | stdio | | MCP_HTTP_PORT | HTTP server port | 3010 | | 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 | none | | 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 |

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:stdio
  • Run checks and tests:
  bun run devcheck  # Lints, formats, type-checks, and more
  bun run test      # Runs the test suite

Project structure

| Directory | Purpose | |:---|:---| | src/mcp-server/tools | Tool definitions (*.tool.ts). Three 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/config | Server-specific environment variable parsing and validation with Zod. |

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

Contributing

Issues and pull requests are welcome. Run checks and tests before submitting:

bun run devcheck
bun run test

License

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

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use AI & ML servers.