{"name":"com.blackswancausallabs/nhanes-mcp","slug":"blackswancausallabs-nhanes-mcp","title":"NHANES (design-correct survey analysis)","description":"Design-correct NHANES analysis: survey weights, pooled cycles, CIs and NCHS reliability flags.","url":"https://mcp.market/server/blackswancausallabs-nhanes-mcp","rating":null,"grade":"A","score":89,"certified":false,"status":"active","category":"media","tags":["media"],"presence":{"score":25,"stars":0,"forks":0,"downloads_week":30,"last_push_at":"2026-10-05T03:01:00.000Z","license":"MIT"},"uptime":null,"claimed":false,"transport":"pypi","callable_via_gateway":false,"default_price_micros":0,"repository":"https://github.com/Black-Swan-Causal-Labs/nhanes-mcp","website":"https://blackswancausallabs.com/blog.html","version":"0.5.1","remotes":[],"packages":[{"registryType":"pypi","registryBaseUrl":"https://pypi.org","identifier":"nhanes-mcp","version":"0.5.1","transport":{"type":"stdio"},"environmentVariables":[{"description":"Folder for downloaded NHANES files (default ~/.cache/nhanes-mcp)","name":"NHANES_MCP_CACHE"},{"description":"Folder of manually downloaded .xpt files, for offline use","name":"NHANES_MCP_DATA_DIR"}]}],"tools":[{"name":"analysis_guidance","description":"Rules for valid NHANES estimation that this server enforces. Read before analyzing.","write_action":false,"price_micros":0,"input_schema":null},{"name":"build_dataset","description":"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.","write_action":false,"price_micros":0,"input_schema":null},{"name":"derive_variable","description":"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), i","write_action":true,"price_micros":0,"input_schema":null},{"name":"describe_dataset","description":"Columns, non-missing counts, weight choice, derived-variable definitions and warnings.","write_action":false,"price_micros":0,"input_schema":null},{"name":"describe_variable","description":"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.","write_action":false,"price_micros":0,"input_schema":null},{"name":"export_dataset","description":"Write the analytic dataset (with WT_ANALYSIS, SDMVSTRA_U, SDMVPSU) to CSV plus a provenance sidecar.","write_action":true,"price_micros":0,"input_schema":null},{"name":"flag_from_long_table","description":"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.","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_cycles","description":"List NHANES cycles this server supports, their file-name conventions and weight rules.","write_action":false,"price_micros":0,"input_schema":null},{"name":"list_files","description":"List data files for a cycle and component (Demographics, Dietary, Examination, Laboratory, Questionnaire).","write_action":false,"price_micros":0,"input_schema":null},{"name":"search_variables","description":"Search NHANES variable names/descriptions (regex, case-insensitive) across cycles/components. Defaults to the 2017-2018 cycle and all components.","write_action":false,"price_micros":0,"input_schema":null},{"name":"set_missing","description":"Recode sentinel values (e.g. 7, 9, 77, 99 for refused/don't know) to missing.","write_action":false,"price_micros":0,"input_schema":null},{"name":"set_weight","description":"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).","write_action":false,"price_micros":0,"input_schema":null},{"name":"show_results","description":"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.","write_action":false,"price_micros":0,"input_schema":null},{"name":"survey_cox","description":"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.","write_action":false,"price_micros":0,"input_schema":null},{"name":"survey_estimate","description":"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\": [[","write_action":false,"price_micros":0,"input_schema":null},{"name":"survey_frequency","description":"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\"}.","write_action":false,"price_micros":0,"input_schema":null},{"name":"survey_regression","description":"Survey-weighted linear ('gaussian') or logistic ('binomial') regression with design-based SEs. Categorical predictors must be dummy-coded first with derive_variable.","write_action":false,"price_micros":0,"input_schema":null}],"scan":{"score":89,"grade":"A","scanned_at":"2026-10-14T12:21:37.594Z","report":{"scannerVersion":"0.1.10","scannedAt":"2026-10-14T12:21:37.542Z","components":{"code":{"score":25,"max":25,"notes":["7 source files scanned"]},"reliability":{"score":-1,"max":20,"notes":["no gateway calls yet and no remote to probe"]},"poisoning":{"score":-1,"max":15,"notes":["tools not inspected (local package is not executed); not counted"]},"auth":{"score":12,"max":15,"notes":["local package, no credentials required"]},"maintenance":{"score":15,"max":15,"notes":["last push 9 days ago"]},"identity":{"score":6,"max":10,"notes":["namespace and repository owner differ","website matches verified namespace"]}},"findings":[],"inputs":{"packages":[{"registryType":"pypi","identifier":"nhanes-mcp","version":"0.5.1","found":true,"weeklyDownloads":30,"license":"MIT","dependencyCount":8,"publishedAt":"2026-10-05T03:01:36.537499Z","repositoryUrl":"https://github.com/Black-Swan-Causal-Labs/nhanes-mcp"}],"repo":{"found":true,"owner":"Black-Swan-Causal-Labs","repo":"nhanes-mcp","archived":false,"pushedAt":"2026-10-05T03:01:00Z","stars":0,"forks":0,"openIssues":0,"ownerType":"Organization","ownerAvatarUrl":"https://avatars.githubusercontent.com/u/281048007?v=4","ownerCreatedAt":"2026-05-01T21:08:07Z","license":"MIT"},"icon":{"url":"https://blackswancausallabs.com/favicon.png","source":"site","width":533,"height":300},"presence":{"stars":0,"forks":0,"downloadsWeek":30,"license":"MIT","lastPushAt":"2026-10-05T03:01:00.000Z","score":25}}}},"grade_history":[],"reviews":[]}