Prepare the server locally
Run this once before adding it to Claude Code.
git clone https://github.com/PetrefiedThunder/mcp-census.git
cd mcp-census
npm install
npm run buildRegister it in Claude Code
claude mcp add -e "CENSUS_API_KEY=${CENSUS_API_KEY}" mcp-census -- node /path/to/mcp-census/dist/index.jsReplace any placeholder paths in the command with the real path on your machine.
CENSUS_API_KEYMake your agent remember this setup
mcp-census's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- Search across thousands of US Census Bureau datasets
- Discover variable codes for precise data extraction
- Query geographic data including states, counties, and tracts
- Convenience tool for quick total population lookups
Tools 5
search_datasetsSearch available US Census Bureau datasets by keyword.get_variablesList variables available in a Census dataset to discover codes.get_geographiesList supported geography levels for a Census dataset.query_dataQuery Census Bureau data for specified variables and geography.get_populationConvenience tool to get total population for a specific geography.Environment Variables
CENSUS_API_KEYrequiredAPI key required for querying specific Census Bureau data.Try it
Original README from PetrefiedThunder/mcp-census
mcp-census
Query the US Census Bureau API for demographic, economic, and geographic data.
Free API — No API key required.
Tools
| Tool | Description |
|---|---|
search_datasets |
Search available US Census Bureau datasets by keyword (e.g. 'acs', 'decennial', 'business patterns') |
get_variables |
List variables available in a Census dataset. Use to discover variable codes before querying data. |
get_geographies |
List supported geography levels for a Census dataset (state, county, tract, etc.) |
query_data |
Query Census Bureau data. Returns tabular data for specified variables and geography. Requires CENSUS_API_KEY. |
get_population |
Convenience tool: get total population (B01001_001E) for a geography. Defaults to ACS 5-year 2022. |
Installation
git clone https://github.com/PetrefiedThunder/mcp-census.git
cd mcp-census
npm install
npm run build
Usage with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"census": {
"command": "node",
"args": ["/path/to/mcp-census/dist/index.js"]
}
}
}
Usage with npx
npx mcp-census
License
MIT