| title | emoji | colorFrom | colorTo | sdk | sdk_version | python_version | app_file | pinned | short_description |
|---|---|---|---|---|---|---|---|---|---|
🏘️ Mcp Census |
🏘️ |
yellow |
indigo |
gradio |
5.34.0 |
3.13 |
gradio_app.py |
false |
MCP server leveraging U.S. Census Bureau tooling |
A work-in-progress MCP server leveraging U.S. Census Bureau tooling for LLM interoperability.
Though we recommend installing this server locally, a deployed census MCP server is available at https://abrezey-mcp-census.hf.space/gradio_api/mcp/sse. Pushes to the main branch of this repo will trigger a redeployment of this resource via GitHub Actions.
This repo was originally built for the Gradio/Hugging Face Agents MCP Hackathon.
Right now, we recommend using mcp-census in conjunction with an MCP Client running a strong foundation model like Claude Desktop or Cursor.
To connect Claude Desktop to the mcp-census server hosted on Hugging Face (requires Claude Pro tier and above):

To locally run mcp-census directly in Claude Desktop (you'll need uv), modify your claude_desktop_config.json:
{
"mcpServers": {
"mcp-census": {
"command": "uvx",
"args": [
"--env-file",
"/path/to/mcp-census/.env",
"/path/to/mcp-census",
"mcp-census"
]
}
}
}If you prefer to run your own client application and LLM, check out Local Agent Quickstart.
What is the population of Hennepin County, MN for those who are 65 and older?
demo1_age.mov
What is the racial/ethnic breakdown of Yolo County?
demo2_race.mov
Lookup data from the US 2020 Decennial Census and provide a CSV containing data about the number of housing units, total population, and median age for all counties in New York State. For the column containing the county identifier, please provide a complete FIPS containing the state and county as a joined value.
demo3_csv.mov
We suggest using uv to manage dependencies, but you can install the required packages directly from the pyproject.toml file
Linting and formatting provided by ruff and pre-commit
uv run pre-commit installThe mcp package provides a handy dev server where you can test functions via UI.
npx @modelcontextprotocol/inspector uv run mcp-censusmcp-census requires an API key in order to request data from U.S. Census Bureau servers.
cp .env.example .envThen fill out your API keys
To request a census API key, visit https://api.census.gov/data/key_signup.html. To request a Hugging Face token, visit https://huggingface.co/docs/hub/security-tokens.
The MCP server does not require a Hugging Face token, though it becomes useful during agent development.
uv run --group gradio-deployment python gradio_app.pyAssuming you have no other Gradio applications running, this will serve your MCP server at http://localhost:7860/gradio_api/mcp/sse
To update dependencies for the Gradio deployment
uv export --group gradio-deployment > requirements.txtNote: for now you have to remove the -e . that the above command generates.
You need to start all three applications (MCP server, Agent, Phoenix) for the system to work at the moment.
uv run --group agent python agent.pyWhen debugging Agents, observability is key. The agent is currently configured to send logs to a phoenix server.
uv run python -m phoenix.server.main serveThe agent will not work without this server running.
- Create a benchmark with which to evaluate MCP server utilization by host application
- Improve MCP feature reliability via Unit Testing
- The Census Bureau publishes myriad documentation. Enabling semantic retrieval via RAG should provide agents with information to better respond to user queries.
- Experiment with MCP "Prompts" to better guide LLM question answering
- This should include strong citation of process
- Experiment with MCP "Ellicitation" to make question answering process more interactive/guided.
- MCP server installation through desktop extension.
