cyanheads avatar

Census Mcp Server

cyanheads/census-mcp-server

Connects Claude to the U.S. Census Bureau's data APIs with a workflow built for interactive queries. Seven tools cover dataset discovery, variable search, geography resolution, and data retrieval. You can search variables by keyword, convert place names or addresses to FIPS codes via TIGERweb and the Census Geocoder, then pull estimates with margins of error. The compare tool ranks geographies in a single call, useful for state by state or county by county analysis. Variables are cached locally with configurable TTL to avoid repeated fetches. Suppression codes get decoded to readable reasons instead of raw sentinel values. Requires a free Census API key for data queries but not for browsing datasets or searching variables.

GitHub stars
3
tools
8
transport
STDIO, HTTP
env vars
7
last updated
Nov 4, 2026

Install

From registry metadata
$ npx add-mcp https://census.caseyjhand.com/mcp --name census

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http census https://census.caseyjhand.com/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 8 tools

Verified live against the running server on Nov 6, 2026.

census_list_datasetsBrowse available Census Bureau datasets with their supported vintage years. Use as the starting point when the right dataset is unknown — ACS5, ACS1, and their profile, subject, and comparison tables, population estimates, the decennial census files, and the business datasets...1 params

Browse available Census Bureau datasets with their supported vintage years. Use as the starting point when the right dataset is unknown — ACS5, ACS1, and their profile, subject, and comparison tables, population estimates, the decennial census files, and the business datasets...

Parameters* required
filterstring
Keyword to filter datasets by name or description. Omit to list all datasets.
census_list_geographiesList the geography levels available for a given Census dataset and year, along with the parent geographies each level requires. Use before querying to confirm that the target geography level exists — ACS1 omits many sub-state levels, and not all datasets support tracts or bloc...2 params

List the geography levels available for a given Census dataset and year, along with the parent geographies each level requires. Use before querying to confirm that the target geography level exists — ACS1 omits many sub-state levels, and not all datasets support tracts or bloc...

Parameters* required
dataset*string
Dataset code (e.g., "acs/acs5", "acs/acs1"). Use census_list_datasets to discover valid values. Case is ignored, and a two-part code can be given by its last part alone — "acs5" is acs/acs5, "pl" i...
yearnumber
Vintage year. Defaults to the latest available year for the dataset.
census_search_variablesSearch Census variables by keyword across variable labels and concept groups, or look one up by its code. Returns variable codes with human-readable labels — use this to go from a concept like "median household income" to the variable code B19013_001E needed for data queries....5 params

Search Census variables by keyword across variable labels and concept groups, or look one up by its code. Returns variable codes with human-readable labels — use this to go from a concept like "median household income" to the variable code B19013_001E needed for data queries....

Parameters* required
datasetstring
Dataset to search within (default: "acs/acs5"). Use census_list_datasets to discover options. Case is ignored, and a two-part code can be given by its last part alone — "acs5" is acs/acs5, "pl" is...
limitinteger
Maximum results per page (default: 20, max: 100). Follow nextOffset to continue the same search.
offsetinteger
Matching variables to skip in the existing rank order (default: 0). Keep query, dataset, year and limit unchanged when following nextOffset.
query*string
Keywords to search (e.g., "median household income", "poverty", "bachelor's degree"), or one variable or table code (e.g., "B19013_001E", "B19013"). Each word must match a whole word of the label o...
yearnumber
Vintage year to search (default: latest available for the dataset).
census_get_variableFetch full metadata for one or more Census variable codes — label, concept group, predicate type, the table's universe, and margin-of-error sibling references. Use to confirm a variable code before building a query, or to look up what a known code means. On ACS datasets it ret...3 params

Fetch full metadata for one or more Census variable codes — label, concept group, predicate type, the table's universe, and margin-of-error sibling references. Use to confirm a variable code before building a query, or to look up what a known code means. On ACS datasets it ret...

Parameters* required
datasetstring
Dataset the variables belong to (default: "acs/acs5"). Use census_list_datasets to discover valid values. Case is ignored, and a two-part code can be given by its last part alone — "acs5" is acs/ac...
variables*array
One or more variable codes to look up (e.g., ["B19013_001E", "B19013_001M"]). Codes are trimmed and matched regardless of case, and the response echoes the dataset's own spelling — uppercase everyw...
yearnumber
Vintage year (default: latest available for the dataset).
census_list_predicate_valuesList the codes a Census filter dimension accepts, so a predicates map can be written without guessing. Answers the question left open when census_query_data or census_compare_geographies reports that a dimension was left unset. Which route a dimension takes depends on the vint...8 params

List the codes a Census filter dimension accepts, so a predicates map can be written without guessing. Answers the question left open when census_query_data or census_compare_geographies reports that a dimension was left unset. Which route a dimension takes depends on the vint...

Parameters* required
dataset*string
Dataset the dimension belongs to (e.g., "cbp", "nonemp", "ecnbasic", "dec/ddhca", "dec/ddhcb", "pep/charv", "acs/acs1/spp"). Use census_list_datasets to discover valid values. Case is ignored, and...
geography_levelstring
Geography level for live enumeration (default: "us"). Codes can differ by level. Only levels whose dataset/year geography metadata permits a wildcard without concrete parents are supported, such as...
limitinteger
Maximum codes per page (default: 50, max: 500). totalCount counts matches before offset and limit; nextOffset continues the list.
offsetinteger
Matching codes to skip in code order (default: 0). Follow nextOffset with the same predicate, dataset, year, query, geography_level and within_naics.
predicate*string
Filter dimension code to enumerate (e.g., "EMPSZES", "LFO", "POPGROUP", "NAICS2017"). Trimmed and uppercased, and the response echoes that spelling. The response notice of census_query_data names t...
querystring
Keyword to narrow the list, matched case-insensitively against each code and label (e.g., "software" against NAICS2017, "exempt" against TAXSTAT). Omit to list from the start. NAICS and POPGROUP ru...
within_naicsvalue
Industry code to scope the enumeration by, for dimensions the Census publishes per industry. On ecnbasic, TAXSTAT and TYPOP return only the all-establishments row until a NAICS sector is named — pa...
yearnumber
Vintage year (default: latest available for the dataset).
census_resolve_geographyResolve a place name, ZIP code, or street address to Census FIPS identifiers. Converts names like "King County, WA", "Seattle, WA", or "Seattle-Tacoma-Bellevue, WA", and ZIPs like "98109", to the codes required by census_query_data and census_compare_geographies. Use before qu...3 params

Resolve a place name, ZIP code, or street address to Census FIPS identifiers. Converts names like "King County, WA", "Seattle, WA", or "Seattle-Tacoma-Bellevue, WA", and ZIPs like "98109", to the codes required by census_query_data and census_compare_geographies. Use before qu...

Parameters* required
county_fipsstring
County FIPS code to resolve within — 1 to 3 digits, zero-padded here to the 3 the Census stores. A tract name is unique only inside its county, so a bare tract name matching two counties comes back...
geography_typestring
Geography level to resolve to, named exactly as census_query_data's geography_level and census_list_geographies name it. Auto-detection covers only state, county, place, tract, and zip code tabulat...one of state · county · place · tract · metropolitan statistical area/micropolitan statistical area · combined statistical area
name*string
Place name (e.g., "King County, WA", "Seattle, WA", "California"), 5-digit ZIP code (e.g., "98109", resolved to its ZIP Code Tabulation Area), or street address (e.g., "1600 Pennsylvania Ave NW, Wa...
census_query_dataQuery a Census dataset for one or more variables at one geography, a list of geographies at the same level, or every geography at a level. Accepts FIPS codes for the target geography — use census_resolve_geography to convert place names to FIPS when needed. On ACS datasets, la...11 params

Query a Census dataset for one or more variables at one geography, a list of geographies at the same level, or every geography at a level. Accepts FIPS codes for the target geography — use census_resolve_geography to convert place names to FIPS when needed. On ACS datasets, la...

Parameters* required
county_fipsvalue
County FIPS code when querying tracts or block groups within a specific county (e.g., "033" for King County within WA). Required for tract and block-group queries scoped to a county — use alongside...
datasetstring
Dataset to query (default: "acs/acs5"). Use census_list_datasets to discover valid values. Case is ignored, and a two-part code can be given by its last part alone — "acs5" is acs/acs5, "pl" is dec...
geography_fips*string
FIPS code for the target geography (e.g., "033" for a county, "*" for every geography at the level within the parent, returned up to limit rows per call and paged with offset). Use census_resolve_g...
geography_level*string
Level of the target geography (e.g., "county", "tract", "state", "zip code tabulation area"). Use census_list_geographies to see valid values for the dataset.
limitinteger
Most rows to return (default: 50, max: 500). Rows come in GEOID order, whether geography_fips is "*" or a comma-separated list, a geography's records or categories in code order, and each one count...
offsetinteger
Rows to skip before returning up to limit (default: 0). Pages run in GEOID order, so offset 50 with limit 50 returns rows 51–100, and the notice names the offset of the next page. An offset at or p...
parent_fipsvalue
State FIPS code when querying sub-state levels (e.g., "53" for Washington). Required for county, tract, and block-group queries. census_resolve_geography returns this as state_fips. Pass "*" to spa...
predicatesobject
Filter values keyed by variable code, sent as extra query parameters — e.g. {"NAICS2017": "5112"} to count only software publishers in cbp. The business datasets (cbp, ecnbasic, nonemp), pep/charv,...
tract_fipsvalue
Census tract code scoping the query to one tract (e.g., "007101" for Census Tract 71.01), for the levels that sit within a tract — block group on acs/acs5, block group and block on dec/pl. census_r...
variables*array
Variable codes to retrieve (e.g., ["B19013_001E", "B19013_001M"]). Codes are matched regardless of case and sent in the dataset's own spelling, which keys the response: "b19013_001e" reads as B1901...
yearnumber
Vintage year (default: latest available for the dataset).
census_compare_geographiesCompare one or more variables across multiple geographies at the same level — all counties in a state, all states nationally, or a named set of specific geographies — ranked on the value of one of them. Covers queries like "compare median income across WA counties" or "which s...12 params

Compare one or more variables across multiple geographies at the same level — all counties in a state, all states nationally, or a named set of specific geographies — ranked on the value of one of them. Covers queries like "compare median income across WA counties" or "which s...

Parameters* required
datasetstring
Dataset to query (default: "acs/acs5"). Use census_list_datasets for valid values. Case is ignored, and a two-part code can be given by its last part alone — "acs5" is acs/acs5, "pl" is dec/pl. Thr...
geographiesarray
Optional list of specific geographies to include; only these are returned. Prefer full GEOIDs — the level concatenated with its parents, e.g. "53033" for King County WA and "06037" for Los Angeles...
geography_level*string
The level to compare across (e.g., "state", "county", "tract"). Use census_list_geographies to see valid values for the dataset.
limitinteger
Maximum geographies per page (default: 50, max: 500). totalCount counts the matched set before paging; nextOffset reaches the next page.
offsetinteger
Rows to skip in the sorted matched set (default: 0), not a rank. Equal numeric estimates share competition ranks and are ordered by GEOID. An offset at or past totalCount returns no rows.
predicatesobject
Filter values keyed by variable code, applied to every geography in the comparison — e.g. {"NAICS2017": "5112"} to rank counties by their software-publisher establishment count in cbp. The business...
sort_bystring
Variable code to rank on (default: the first code in variables), matched regardless of case like the variables. Must be one of the requested codes, or the call fails with sort_by_not_requested. Geo...
sort_dirstring
Sort direction (default: "desc" — highest value first).one of asc · desc
variables*array
Variable codes to compare (e.g., ["B19013_001E", "B19013_001M"]); the ranking is on one of them, set by sort_by. Codes are matched regardless of case and sent in the dataset's own spelling, which k...
withinvalue
State FIPS to constrain results (e.g., "53" to compare counties or tracts within WA only). Omit to compare all geographies at the level nationally. Use census_resolve_geography to get state_fips. P...
within_countyvalue
County FIPS to constrain tract or block-group comparisons to a single county within the state specified by within (e.g., "033" for King County). Required when geography_level is "tract" or "block g...
yearnumber
Vintage year (default: latest available for the dataset).

Sponsors

Configuration

CENSUS_API_KEY

Census Bureau API key from api.census.gov/data/key_signup.html. Required for census_query_data and census_compare_geographies, and for census_list_predicate_values on a dimension it enumerates live; variable search and geography resolution work without it.

MCP_LOG_LEVELdefault: info

Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').

MCP_TRANSPORT_TYPEdefault: http

Selects the HTTP transport.

MCP_HTTP_HOSTdefault: 127.0.0.1

The hostname for the HTTP server.

MCP_HTTP_PORTdefault: 3010

The port to run the HTTP server on.

MCP_HTTP_ENDPOINT_PATHdefault: /mcp

The endpoint path for the MCP server.

MCP_AUTH_MODEdefault: none

Authentication mode to use: 'none', 'jwt', or 'oauth'.

Readme

@cyanheads/census-mcp-server

Query U.S. Census Bureau data, variables, and geography via MCP. STDIO or Streamable HTTP.

8 Tools

Version License Docker MCP SDK npm TypeScript Bun

Details

Repository
github.com/cyanheads/census-mcp-server
Category
Data & Analytics
Package
@cyanheads/census-mcp-server
Transport
STDIO, HTTP
Registry
MCP registry, active
Resources
1
Tools verified
Nov 6, 2026

More from cyanheads

Related Data & Analytics MCP servers

View all
1cyanheads avatarEarthquake Mcp Servercyanheads/earthquake-mcp-serverSearch USGS and EMSC seismic data — real-time feeds, event queries, and earthquake counts.3stars
2cyanheads avatarUsgs Water Mcp Servercyanheads/usgs-water-mcp-serverQuery real-time and historical USGS water data from ~8,000 stream gages and groundwater wells.3stars
3jasonwilbur avatarOCI Pricingjasonwilbur/oci-pricing-mcpOracle Cloud Infrastructure pricing data with cost calculators and comparisons3stars
4jessiejanie avatarSkim402jessiejanie/skim402Clean markdown and structured web data. Free card API key; wallet/x402 pay-per-call optional.3stars
5kemalersin avatarFonparam Mcpkemalersin/fonparam-mcpMCP server for FonParam API - Turkish mutual funds data3stars
6localseodata avatarMcp Serverlocalseodata/mcp-server53 local SEO data tools: rankings, reviews, audits, keywords, AI visibility.0stars