Skip to content
Agentmart
Submit a tool

NHANES (design-correct survey analysis)

Design-correct NHANES analysis: survey weights, pooled cycles, CIs and NCHS reliability flags.

Connector by blackswancausallabs.com · Domain verified by the MCP Registry

IndexedMITLocal (stdio)★ 2
Write a review

Chalk Labs

Need help deploying NHANES (design-correct survey analysis)?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.

npx agentmarket install connector/blackswancausallabs-com-nhanes-mcp

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Design-correct NHANES analysis: survey weights, pooled cycles, CIs and NCHS reliability flags.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this server can do and what it asks for, from its tool list, install config and code. Checked Oct 26, 2026.

Tools
7 read · 6 write · 0 delete · 4 not yet classified
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Tools by what they do 17

Read from the source code; the running server may list different tools.

Read 7 · Look things up without changing anything.

  • describe_dataset
  • describe_variable
  • list_cycles
  • list_files
  • search_variables
  • show_results
  • survey_estimate

Write 6 · Create, change, send or run things.

  • build_dataset
  • derive_variable
  • export_dataset
  • flag_from_long_table
  • set_missing
  • set_weight

Not yet classified 4 · We could not tell from the name and description.

  • analysis_guidance
  • survey_cox
  • survey_frequency
  • survey_regression

Secrets and settings it asks for

Other settings (environment variables or headers).

  • NHANES_MCP_CACHE
  • NHANES_MCP_DATA_DIR

Network hosts it talks to 4

  • blackswancausallabs.com · found in code
  • ftp.cdc.gov · found in code
  • github.com · found in code
  • wwwn.cdc.gov · found in code

Files it touches

  • Your home directory (~)
  • Any path the agent passes to its tools

Tools (17)

Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].

  • analysis_guidance

    Rules for valid NHANES estimation that this server enforces. Read before analyzing.

  • build_dataset

    Build an analysis-ready dataset: DEMO universe (all participants, needed for valid domain estimation) left-joined to the requested tables on SEQN, for one or more cycles. tables: base names without cycle suffix, e.g. ["BMX", "TCHOL", "BPQ"] (DEMO is always included). variables: columns to keep from those tables (default: all). Weight/design variables are always kept. The analysis weight is chosen and rescaled automatically -> column WT_ANALYSIS. Subsample weights carried by a file (fasting WTSAF2YR, phlebotomy WTPH2YR, surplus serum WTSSMC2Y/4Y, ...) are detected. weight: optional weight kind…

  • derive_variable

    Create a variable from an expression over existing columns, e.g. name='OBESE', expression='BMXBMI >= 30' (booleans become 0/1). missing: 'any' -> result missing if ANY referenced column is missing (default, conservative); 'all' -> missing only if ALL referenced columns are missing (for OR-type definitions); 'none' -> no propagation. Missing-aware functions: coalesce(a, b, ...), fillna(x, value), isna(x), notna(x), where(cond, a, b). Columns used only inside them are exempt from the missing rule. Design columns (WT_ANALYSIS, strata, PSU, SEQN, CYCLE) cannot be overwritten her…

  • describe_dataset

    Columns, non-missing counts, weight choice, derived-variable definitions and warnings.

  • describe_variable

    Codebook entry (label, question text, target population, value codes) plus observed distribution. Flags codes that look like refused/don't-know so they can be set to missing.

  • export_dataset

    Write the analytic dataset (with WT_ANALYSIS, SDMVSTRA_U, SDMVPSU) to CSV plus a provenance sidecar.

  • flag_from_long_table

    Add a per-person 0/1 indicator from a file with several rows per participant (e.g. RXQ_RX prescriptions, DR1IFF foods). Flag = 1 if ANY row's value in ANY of `columns` matches the regex `pattern` (case-insensitive), e.g. table='RXQ_RX', columns=['RXDRSC1','RXDRSC2','RXDRSC3'], pattern='^G40' for ICD-10 epilepsy as the reason for use. People absent from the file are missing.

  • list_cycles

    List NHANES cycles this server supports, their file-name conventions and weight rules.

  • list_files

    List data files for a cycle and component (Demographics, Dietary, Examination, Laboratory, Questionnaire).

  • search_variables

    Search NHANES variable names/descriptions (regex, case-insensitive) across cycles/components. Defaults to the 2017-2018 cycle and all components.

  • set_missing

    Recode sentinel values (e.g. 7, 9, 77, 99 for refused/don't know) to missing.

  • set_weight

    Replace the analysis weight with a custom expression over existing columns, e.g. 'coalesce(WTSSMC4Y * 4/6, WTSSMC2Y * 2/6)'. Use only when build_dataset cannot select the right weight. The change is recorded and reported (weight kind 'CUSTOM' + a warning) in every later result. Negative or missing weights become 0 (out of sample).

  • show_results

    Present design-based results: headline estimate, subgroup panels, the analysis plan (so the user can check how the question was interpreted), server warnings, NCHS benchmarks and provenance. Returns a text summary plus structured data; when the optional NHANES Results Explorer add-on is installed, MCP Apps hosts also render it as an interactive view. Same estimation arguments as survey_estimate (dataset_id, variable, statistic, domain, age_adjust); by: one panel per grouping variable, e.g. ['RIAGENDR', 'RIDRETH3', 'AGEGRP'] (age-adjustment is skipped for age groupings -- names starting with A…

  • survey_cox

    Survey-weighted Cox proportional hazards model (Breslow ties, Binder linearized variance; same estimator as SUDAAN SURVIVAL / R svycoxph). Typical use with include_mortality=True: time='PERMTH_INT' (or PERMTH_EXM), event='MORTSTAT', domain including 'ELIGSTAT == 1'. Categorical predictors must be dummy-coded first with derive_variable.

  • survey_estimate

    Design-based estimate (Taylor linearization) of a mean, proportion (0/1 variable) or total. domain: expression defining the subpopulation, e.g. 'RIDAGEYR >= 20 & RIDEXPRG != 1' (the design is NOT subset; out-of-domain records get zero weight). by: grouping variables, e.g. ['RIAGENDR']. age_adjust: a preset name ('nchs_adults_20plus': 2000 census, 20-39/40-59/60+) or a custom standard {"groups": [[6,11],[12,19],[20,29]], "population": [24.6, 32.5, 38.3]} (or "proportions"), optionally "age_var" (default RIDAGEYR) and "note" naming the source of the standard. Proportions come wit…

Show 2 more tools
  • survey_frequency

    Weighted distribution of a categorical variable (Table 1 style): for each level, unweighted n, weighted percent, SE and Korn-Graubard CI, within the domain and optionally by group. labels: optional {code: label} map, e.g. {"1": "Male", "2": "Female"}.

  • survey_regression

    Survey-weighted linear ('gaussian') or logistic ('binomial') regression with design-based SEs. Categorical predictors must be dummy-coded first with derive_variable.

Signals

Stars
2
Forks
0
Open issues
0
Weekly downloads
33
Last commit
Oct 5, 2026 (28 days ago)
Last release
Oct 5, 2026 (28 days ago)
Last package publish
Oct 5, 2026 (28 days ago)

From GitHub (fetched Oct 24, 2026) and the package registry.

Details

Registry name
com.blackswancausallabs/nhanes-mcp
Version
0.5.1
Auth
No auth
Packages
pypi nhanes-mcp
License
MIT
First seen
Oct 24, 2026
Last checked
Nov 1, 2026

More from blackswancausallabs.com

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get NHANES (design-correct survey analysis) running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying NHANES (design-correct survey analysis)?

CallGet help
Cite this page

NHANES (design-correct survey analysis) MCP server. Agent Mart. https://agentmart.dev/connectors/blackswancausallabs-com-nhanes-mcp (last updated 2026-11-01)