NHANES (design-correct survey analysis) MCP server
Design-correct NHANES analysis: survey weights, pooled cycles, CIs and NCHS reliability flags.
0 stars30 downloads/wk
Reviews
Write oneNobody has reviewed NHANES (design-correct survey analysis) yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
NHANES (design-correct survey analysis) tools (17, 2 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
analysis_guidanceRules for valid NHANES estimation that this server enforces. Read before analyzing.
build_datasetBuild 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.
derive_variablewrite actionCreate 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), i
describe_datasetColumns, non-missing counts, weight choice, derived-variable definitions and warnings.
describe_variableCodebook 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_datasetwrite actionWrite the analytic dataset (with WT_ANALYSIS, SDMVSTRA_U, SDMVPSU) to CSV plus a provenance sidecar.
flag_from_long_tableAdd 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_cyclesList NHANES cycles this server supports, their file-name conventions and weight rules.
list_filesList data files for a cycle and component (Demographics, Dietary, Examination, Laboratory, Questionnaire).
search_variablesSearch NHANES variable names/descriptions (regex, case-insensitive) across cycles/components. Defaults to the 2017-2018 cycle and all components.
set_missingRecode sentinel values (e.g. 7, 9, 77, 99 for refused/don't know) to missing.
set_weightReplace 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_resultsPresent 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.
survey_coxSurvey-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_estimateDesign-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": [[
survey_frequencyWeighted 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_regressionSurvey-weighted linear ('gaussian') or logistic ('binomial') regression with design-based SEs. Categorical predictors must be dummy-coded first with derive_variable.
Public scan report
scanner v0.1.10 · 2026-10-14 · same rubric, same numbers if you re-run it
- Code scan7 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 9 days ago15/15
- Maintainer identitynamespace and repository owner differ; website matches verified namespace6/10
How NHANES (design-correct survey analysis) compares
Against every graded Media MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 89/100
- higher than 80% of 1,337 Media servers
- Tools
- 17
- the typical Media server has 7
- Tools that change things
- 12%
- typical: 4%. Fewer write tools means less an agent can break
- Downloads a week
- 30
- more than 15% of 365 Media servers with a package
What its tools let an agent do: 13 read · 4 change
Install NHANES (design-correct survey analysis) in Claude Code, Cursor or VS Code
claude mcp add nhanes-mcp -- uvx nhanes-mcp
What the publisher says
From the NHANES (design-correct survey analysis) repository's README, as published. We do not edit it. Read it on GitHub
nhanes-mcp
<!-- mcp-name: com.blackswancausallabs/nhanes-mcp -->
An MCP server for design-correct, conversational access to NHANES public-use data. Black Swan Causal Labs · MIT license · v0.5 · PyPI · MCP Registry
Most "chat with a dataset" layers let an agent compute an unweighted mean. With NHANES that answer is wrong. This server makes the defensible analysis the default: the agent asks a question in plain language, and the server finds the files, merges them on SEQN, picks the right weight, keeps the full survey design, and reports design-based estimates with NCHS reliability flags.
Not affiliated with, or endorsed by, NCHS or CDC. Data are the public-use NHANES files
published by the National Center for Health Statistics and downloaded directly from cdc.gov.
Users are responsible for following the NCHS data use agreement.
What it handles for you
Tools (17)
Cycles: 1999–2000 through 2017–2018, 2017–March 2020 (pre-pandemic, P_ files) and August 2021–August 2023.
Results Explorer (optional add-on)
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
NHANES (design-correct survey analysis): common questions
- Is NHANES (design-correct survey analysis) MCP server safe?
- Yes, by our scan: it is graded A (89/100). Read the NHANES (design-correct survey analysis) safety report
- How do I install NHANES (design-correct survey analysis)?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does NHANES (design-correct survey analysis) need an API key?
- No secret keys are declared. It reads 2 settings from the environment.
- Is NHANES (design-correct survey analysis) maintained?
- The last commit was 30 days ago (2026-10-05). The latest release is v0.5.1.
- What can I use instead of NHANES (design-correct survey analysis)?
- Servers from other publishers that do the same job: Dembrandt MCP server, KiCad MCP Pro MCP server and Figma MCP Server.
- How does NHANES (design-correct survey analysis) compare with other Media MCP servers?
- safety score 89/100 (higher than 80% of 1,337 Media servers); tools 17 (the typical Media server has 7); tools that change things 12% (typical: 4%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to NHANES (design-correct survey analysis)
Same job from other publishers: the closest match first, then the best rated.
- DembrandtDesign tokens from any live site: colours, type, spacing, components, drift against a baseline.not reviewedWidely usedB
KiCad MCP ProProduction-grade MCP server for KiCad EDA—PCB design, DRC, simulation, BOM, DFM, and manufacturing.not reviewedEstablishedA- Figma MCP ServerThe Figma MCP server brings Figma design context directly into your AI workflow.not reviewedEstablishedA
- melta UIAI-Ready design system MCP: melta UI tokens, component contracts, 107 rules, check_html self-verifynot reviewedEstablishedA
- Figma UIBidirectional Figma MCP — AI draws UI on Figma canvas, reads designs backnot reviewedEstablishedA