# Census Population MCP

> U.S. Census Population — Demographics, Age & Diversity accesses American Community Survey data for precise demographic modeling. You can get total population counts, median age, and detailed breakdowns of race and ethnicity—including White, Black, Asian, Hispanic, and Foreign-born populations—for any U.S. state, county, or incorporated city.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** demographics, population-data, census-data, ethnic-breakdown, age-statistics, geographic-data

## Description

This server gives your agent direct access to granular American Community Survey (ACS) data from the U.S. Census Bureau. You don't have to click through a dozen government websites just to get reliable demographic numbers; you run an operation and get clean, structured metrics back.

When you need to compare headcounts across multiple states, use `get_population_by_state`. It pulls the total population count and median age for all fifty U.S. states plus D.C., letting you benchmark those national-level figures instantly.

To analyze diversity nationwide, run `get_demographics_by_state`. This tool generates a full breakdown of race and ethnicity—White, Black, Asian, Hispanic, and Foreign-born populations—across every single state, giving you a country-wide view of how these groups are distributed. You’ll get that data for all fifty states plus D.C.

Drilling down into county details is where this server shines. If you want to map out the racial and ethnic breakdown for *every* county within a single state, use `get_demographics_by_county`. This gives you granular segmentation—it’s far more specific than just knowing the total number of people in an area.

When your focus is strictly on population totals and median age for specific counties, not the full ethnic breakdown, you gotta use `get_population_by_county`. It requires the county's FIPS code as input, but it gives you exactly the headcount and median age data you need for that particular jurisdiction.

If your work involves small towns or designated non-county areas, like incorporated cities or Census Designated Places (CDPs), use `get_population_by_city`. This tool retrieves headcounts specifically for those smaller places, separating their population from the broader county averages. It’s key when you're analyzing specific market centers.

Understanding these differences is everything: if you want a pure count of residents in a city, use `get_population_by_city`; if you need to compare total headcounts and median ages across multiple states, stick with `get_population_by_state`. Conversely, if you're mapping out how different ethnic groups are spread county by county within one state—say, tracking the distribution of Asian or Hispanic residents across every county in California—you’ll want the detailed breakdown from `get_demographics_by_county`.

You can combine these calls to build sophisticated models. You might run `get_population_by_state` first for a high-level comparison, then use that knowledge to drill down on two key counties using `get_population_by_county`, and finish by checking the specific demographics of a single major city using `get_demographics_by_city`. It's about having access to every level of administrative data—from the national aggregate down to the smallest recognized CDP. You won't find this depth of structured Census access anywhere else.

## Tools

### get_population_by_state
Provides the total population and median age for all 50 U.S. states plus DC using ACS data.

### get_population_by_county
Gets the total population count and median age for specific counties in a state, requiring the county's FIPS code.

### get_population_by_city
Retrieves population counts for incorporated cities and Census Designated Places within a state.

### get_demographics_by_state
Gets the full racial and ethnic breakdown (White, Black, Asian, Hispanic, foreign-born) for all 50 U.S. states plus DC.

### get_demographics_by_county
Retrieves racial and ethnic demographics for every county within a state.

## Prompt Examples

**Prompt:** 
```
What is the population and median age of California vs Texas?
```

**Response:** 
```
📊 **U.S. Census Bureau: Population by State**

**California (06):**
- Population: 39,040,616
- Median Age: 37.8 years

**Texas (48):**
- Population: 29,730,311
- Median Age: 35.4 years
```

**Prompt:** 
```
Show the Hispanic and Asian population for Florida
```

**Response:** 
```
📊 **Demographics by State**

**Florida (12):**
- Total Population: 22,244,823
- Hispanic or Latino: 5,956,878 (26.8%)
- Asian Alone: 668,744 (3.0%)
```

**Prompt:** 
```
What is the most populated county in New York State?
```

**Response:** 
```
📊 **Population by County — State 36**

The most populated county is:
**Kings County (Brooklyn) (36-047)**
- Population: 2,590,516
- Median Age: 35.8

Followed by:
**Queens County (36-081)**
- Population: 2,278,029
```

## Capabilities

### Compare State-Wide Metrics
You can compare the total population and median age of multiple U.S. states using `get_population_by_state`.

### Drill Down to County Ethnicity
The agent uses `get_demographics_by_county` to map out the racial and ethnic breakdown for every county in a given state.

### Target City Populations
Use `get_population_by_city` to get headcount data specifically for small towns or incorporated places, separate from county averages.

### Analyze State-Level Diversity
Run `get_demographics_by_state` to generate a comprehensive list of how racial groups (like Asian or Hispanic) are distributed across the entire country.

### Determine County Headcount
The tool `get_population_by_county` provides population totals and median ages for specific counties, which is useful when you only care about headcounts, not ethnicity.

## Use Cases

### Planning a National Marketing Rollout
A brand manager needs to know where their primary target demographic (e.g., Asian or Hispanic) is concentrated across the country. They ask the agent to run `get_demographics_by_state`, which returns a state-by-state breakdown of ethnic populations, instantly identifying the top five markets for immediate focus.

### Analyzing Suburban Growth
A real estate developer needs to compare two adjacent suburbs. They use `get_population_by_county` and `get_demographics_by_county` on both counties, allowing them to analyze population growth rates alongside the specific median age of the local populace.

### Tracking Localized Infrastructure Needs
A municipal government needs to fund new facilities. They use `get_population_by_city` and `get_population_by_county` to calculate total headcount across multiple smaller towns, ensuring funding matches the actual residential count.

### Comparing State Health Risks
A public health official wants to see how median age correlates with overall population in different states. They run `get_population_by_state` first, then use the resulting state codes to pull specific demographic data for risk analysis.

## Benefits

- Compare multiple state totals instantly. Using `get_population_by_state` lets you run a direct comparison of median age and total population between, say, Texas and Florida—no spreadsheet needed.
- Drill down into local communities. If your target is a specific suburb, use `get_population_by_city`. This provides focused headcount data that often differs from the larger county average.
- Understand deep regional diversity. The combination of `get_demographics_by_county` and `get_demographics_by_state` lets you see how race and ethnicity shift dramatically, even across neighboring counties.
- Isolate population metrics only. If your goal is just knowing the total count or median age for a county, use `get_population_by_county`. This keeps your data clean by excluding unnecessary demographic fields.
- Build comprehensive reports quickly. The tools let you build complex reports—for example, comparing state-level diversity (`get_demographics_by_state`) against the specific population of major metro areas using `get_population_by_city`.

## How It Works

The bottom line is: you get clean, structured census data without having to manually navigate or download multiple CSV files from the Census Bureau website.

1. You specify the geographic scope (e.g., 'California') and the level of detail needed (e.g., 'county demographics').
2. Your AI client invokes the appropriate tool—like `get_demographics_by_county`—passing the necessary parameters, such as the state's FIPS code.
3. The server returns structured JSON data containing the requested population metrics and ethnic breakdowns directly to your agent.

## Frequently Asked Questions

**Can I use get_population_by_state to compare multiple states?**
Yes, absolutely. You can ask the agent to compare two or more states using `get_population_by_state`. It returns the total population and median age for each state you list in a single response.

**Do I need FIPS codes for get_population_by_county?**
Yes, the tool requires specific FIPS codes. You can't just use the county name; you must provide both the State FIPS code and the County FIPS code to pinpoint the correct data set.

**Does get_demographics_by_state cover all racial groups?**
Yes, `get_demographics_by_state` pulls the key breakdowns: White, Black, Asian, Hispanic, and Foreign-born populations across all 50 states plus DC.

**How do I get data for a small town that isn't a major county center?**
Use `get_population_by_city`. This tool specifically targets incorporated cities and Census Designated Places, giving you localized population numbers separate from the broader county statistics.

**Do I need to handle authentication for get_population_by_state?**
Yes, you must include a free API key from the Census Bureau. You pass this key as an authorization token in your request headers or during the initial setup phase. The service won't return data without valid credentials.

**What fields does get_demographics_by_county actually return?**
It returns a structured object containing race and ethnic counts for all counties in a state. Key metrics include population totals, along with specific breakdowns for White, Black, Asian, Hispanic, and Foreign-born groups.

**Can I combine results from get_population_by_county and get_demographics_by_county?**
You must run two separate calls. Use `get_population_by_county` for age and median population figures, then use `get_demographics_by_county`. Crucially, you pass the same county FIPS code to both tools to align the results.

**What should I do if get_population_by_city fails or returns no data?**
The server will return a specific API error code and an empty payload. Don't assume missing data means zero population; instead, check the response body for null values or defined API errors to handle the failure gracefully.

**What are FIPS codes?**
FIPS (Federal Information Processing Standard) codes are numbers used by the government to uniquely identify states, counties, and places. E.g., California is 06, Los Angeles County is 037.

**Which census survey do you use?**
We use the American Community Survey (ACS) 5-Year estimates, which provide the most reliable, detailed, and broad demographic data annually.

**Are undocumented immigrants counted?**
Yes, the Census Bureau attempts to count all residents regardless of immigration status, though this group is historically harder to count accurately.