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
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.
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.
About
Reviews
Write a reviewNo 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_datasetdescribe_variablelist_cycleslist_filessearch_variablesshow_resultssurvey_estimate
Write 6 · Create, change, send or run things.
build_datasetderive_variableexport_datasetflag_from_long_tableset_missingset_weight
Not yet classified 4 · We could not tell from the name and description.
analysis_guidancesurvey_coxsurvey_frequencysurvey_regression
Secrets and settings it asks for
Other settings (environment variables or headers).
NHANES_MCP_CACHENHANES_MCP_DATA_DIR
Network hosts it talks to 4
blackswancausallabs.com· found in codeftp.cdc.gov· found in codegithub.com· found in codewwwn.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_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. 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_variableCreate 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_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 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. 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_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": [[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_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.
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
- 0.582score
Docket Lens
blackswancausallabs.com
Retrieve FDA docket comments, attachments and draft/final guidance for reviewable analysis.
ConnectorAFreshness: ALocalClaude Desktop - 0.501score
TARGET Checklist MCP
blackswancausallabs.com
Score how completely a target-trial-emulation study reports what the TARGET guideline requires.
ConnectorBFreshness: BLocal↓ 41/wkClaude Code +5 - 0.498score
ROBINS-I V2 MCP
blackswancausallabs.com
ROBINS-I V2 (not V1): risk of bias in one result of a non-randomized cohort study
ConnectorBFreshness: BLocal↓ 28/wkClaude Code +5 - 0.497score
openFDA Regulatory Metadata
blackswancausallabs.com
Resolve FDA application numbers and product names to regulatory metadata (CDER, CBER, CDRH).
ConnectorBFreshness: BLocal↓ 24/wkClaude Code +5 - 0.472score
DAG Studio MCP
blackswancausallabs.com
Causal DAG analysis: backdoor paths, adjustment sets, bias simulation.
ConnectorBFreshness: BRemoteClaude Code +3
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.
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)