MCP server for querying Census American Community Survey data.
Supports two transport modes:
- Stdio - Local CLI, for use with Claude Desktop
- SSE - Remote HTTP server, for hosting and sharing with others
- Node.js 24+ (LTS)
- DuckDB production databases from census_acs_duckdb_importer
npm install
npm run buildCreate a symlink to the database directory:
ln -s /path/to/census_acs_duckdb_importer/output dbThe db/ directory should contain:
census_acs.production.json_summaries.dbcensus_acs.production.percentiles.db
Environment variables:
| Variable | Default | Description |
|---|---|---|
CENSUS_ACS_TRANSPORT |
stdio |
Transport mode: stdio or sse |
CENSUS_ACS_PORT |
3000 |
HTTP port (SSE mode only) |
CENSUS_ACS_DB_PATH |
./db |
Path to database directory |
CENSUS_ACS_DB_MEMORY_LIMIT |
4GB |
DuckDB memory limit |
CENSUS_ACS_DB_THREADS |
4 |
DuckDB parallel threads |
CENSUS_ACS_QUERY_TIMEOUT_MS |
120000 |
Query timeout in milliseconds |
For use with Claude Desktop or other local MCP clients:
npm run startFor hosting as an HTTP server:
CENSUS_ACS_TRANSPORT=sse npm run startOr with a custom port:
CENSUS_ACS_TRANSPORT=sse CENSUS_ACS_PORT=8080 npm run startThe server will be available at http://localhost:3000/sse.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"census-acs": {
"command": "node",
"args": ["/path/to/census_acs_mcp/dist/index.js"]
}
}
}Connect MCP clients to: http://your-server:3000/sse
For remote hosting:
- Deploy to a server with the databases
- Set environment variables:
export CENSUS_ACS_TRANSPORT=sse export CENSUS_ACS_PORT=3000
- Run the server:
npm run start - Users connect via the SSE endpoint URL
lookup_location- Get census data for lat/lng coordinatessearch_locations- Search for locations by namelist_geographies- List all geographies at a summary level (states, counties, etc.)
rank_areas_by_metric- Rank areas by metric or computed rate (supports compound metrics)get_area_summary- Get full summary for a geographic areacompare_areas- Compare two geographic areas
list_topics- Browse available data categoriessearch_data- Search table metadata by keyworddescribe_table- Get details about a specific ACS tablelist_universes- List all data universes (populations)list_population_groups- List available population group codes (race/ethnicity)
get_interesting_facts- Find outlier statistics for an area
| Document | Description |
|---|---|
| docs/PROJECT_SUMMARY.md | Architecture overview, database schema, geographic levels, and population groups |
| docs/TOOL_DEFINITIONS.md | Detailed specifications for all tools, parameters, and return types |
| docs/IMPLEMENTATION_DETAILS.md | Technical implementation details, SQL patterns, and error handling |