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.
Query U.S. Census Bureau data, variables, and geography via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://census.caseyjhand.com/mcp
7 tools covering the full Census data workflow — from dataset discovery and variable search through geography resolution and ranked comparisons:
| Tool | Description |
|---|---|
census_list_datasets | Browse available Census Bureau datasets (ACS5, ACS1, Population Estimates, Decennial) with vintage years and dataset codes. |
census_list_geographies | List the geography levels supported by a dataset and year, with parent requirements and example FIPS values. |
census_search_variables | Keyword search across variable labels and concept groups. Returns estimate and margin-of-error codes together. |
census_get_variable | Fetch full metadata for one or more variable codes — label, concept, predicate type, universe, MOE sibling. |
census_resolve_geography | Convert place names (e.g., "King County, WA") or street addresses to Census FIPS identifiers via TIGERweb and Census Geocoder. |
census_query_data | Query a Census dataset for variables at a specific geography. Returns estimates with MOE, suppression codes resolved to readable reasons. |
census_compare_geographies | Rank and compare variables across multiple geographies — all counties in a state, all states nationally, or a named set. Sorted table output. |
census_list_datasetsBrowse available Census Bureau datasets.
acs/acs5) are the values to pass to other toolscensus_search_variablesSearch Census variables by keyword.
total_matches indicates how many matched before the limitcensus_resolve_geographyConvert place names and addresses to Census FIPS identifiers.
geography_type overridestate_fips (→ parent_fips) and fips_summary (→ geography_fips) ready to pass to other toolscensus_query_dataQuery a Census dataset for one or more variables at a specific geography.
census_resolve_geography first for place namesgeography_fips: "*" to return all geographies at the level within the parentCENSUS_API_KEYcensus_compare_geographiesRank and compare variables across multiple geographies.
within parameter to constrain to a parent FIPS; omit for national comparisongeographies list to filter to specific FIPS valuesCENSUS_API_KEYBuilt on @cyanheads/mcp-ts-core:
Census-specific:
Agent-friendly output:
fips_summary and state_fips return values are ready to pass as geography_fips and parent_fips to the next tool-666666666) surfaced as human-readable reasons instead of raw numbersAPI key: Register a free key at api.census.gov/data/key_signup.html. Variable search and geography resolution work without a key; data queries (
census_query_data,census_compare_geographies) require one.
Add the following to your MCP client configuration file:
{
"mcpServers": {
"census-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/census-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"CENSUS_API_KEY": "your-census-api-key"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"census-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/census-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"CENSUS_API_KEY": "your-census-api-key"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"census-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-e", "CENSUS_API_KEY=your-census-api-key",
"ghcr.io/cyanheads/census-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 CENSUS_API_KEY=... bun run start:http
# Server listens at http://localhost:3010/mcp
census_query_data and census_compare_geographies; other tools work without it.git clone https://github.com/cyanheads/census-mcp-server.git
cd census-mcp-server
bun install
cp .env.example .env
# edit .env and set CENSUS_API_KEY
| Variable | Description | Default |
|---|---|---|
CENSUS_API_KEY | Required for data queries. Register free at api.census.gov/data/key_signup.html. | — |
CENSUS_DEFAULT_YEAR | Default vintage year when no year is specified. | 2024 |
CENSUS_VARIABLE_CACHE_TTL_HOURS | Hours to cache variables.json per dataset+year in memory. | 24 |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | Port for HTTP server. | 3010 |
MCP_AUTH_MODE | Auth mode: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, notice, warning, error). | info |
OTEL_ENABLED | Enable OpenTelemetry instrumentation. | false |
See .env.example for the full list of optional overrides.
# One-time build
bun run rebuild
# Run the built server
bun run start:stdio
# or
bun run start:http
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security audit
bun run test # Vitest test suite
bun run lint:mcp # Validate MCP definitions against spec
docker build -t census-mcp-server .
docker run --rm -e CENSUS_API_KEY=your-key -p 3010:3010 census-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/census-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
| Path | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools and initializes services. |
src/config/server-config.ts | Census-specific env var parsing and validation with Zod. |
src/mcp-server/tools/definitions/ | Tool definitions (*.tool.ts). |
src/services/census-api/ | Census Data API client — data queries, suppression code mapping, retry logic. |
src/services/geography/ | Geography resolution — TIGERweb named-place lookup and Census Geocoder address-to-tract. |
src/services/variable-cache/ | In-process variables.json cache with TTL and keyword search. |
tests/ | Vitest tests mirroring src/ structure. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for request-scoped logging, ctx.state for tenant-scoped storagesrc/mcp-server/tools/definitions/index.tsIssues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
Apache-2.0 — see LICENSE for details.
CENSUS_API_KEYCensus Bureau API key from api.census.gov/data/key_signup.html. Required for census_query_data and census_compare_geographies; variable search and geography resolution work without it.
MCP_LOG_LEVELdefault: infoSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
MCP_HTTP_HOSTdefault: 127.0.0.1The hostname for the HTTP server.
MCP_HTTP_PORTdefault: 3010The port to run the HTTP server on.
MCP_HTTP_ENDPOINT_PATHdefault: /mcpThe endpoint path for the MCP server.
MCP_AUTH_MODEdefault: noneAuthentication mode to use: 'none', 'jwt', or 'oauth'.
com.mcparmory/google-sheets
domdomegg/google-sheets-mcp
henilcalagiya/google-sheets-mcp
cct15/war-dashboard-data
moooonad/mcp-google-sheets-full
io.github.br0ski777/csv-to-json