- Explore MCP Servers
- mcp_census_server
Mcp Census Server
What is Mcp Census Server
mcp_census_server is a robust Model Context Protocol (MCP) server designed to access data from the US Census Bureau via JSON-RPC over HTTP.
Use cases
Use cases for mcp_census_server include retrieving demographic data for analysis, integrating Census data into applications, and providing data access for research projects.
How to use
To use mcp_census_server, clone the repository, set up your environment variables with your API keys, install the dependencies, and start the server. You can then send JSON-RPC requests to the server endpoint with the required headers.
Key features
Key features include support for JSON-RPC 2.0, Pydantic models for request/response validation, caching of Census API responses, structured logging, API key authentication, a health check endpoint, and interactive API documentation via Swagger UI.
Where to use
mcp_census_server can be used in various fields that require access to US Census Bureau data, including research, data analysis, and application development.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Census Server
mcp_census_server is a robust Model Context Protocol (MCP) server designed to access data from the US Census Bureau via JSON-RPC over HTTP.
Use cases
Use cases for mcp_census_server include retrieving demographic data for analysis, integrating Census data into applications, and providing data access for research projects.
How to use
To use mcp_census_server, clone the repository, set up your environment variables with your API keys, install the dependencies, and start the server. You can then send JSON-RPC requests to the server endpoint with the required headers.
Key features
Key features include support for JSON-RPC 2.0, Pydantic models for request/response validation, caching of Census API responses, structured logging, API key authentication, a health check endpoint, and interactive API documentation via Swagger UI.
Where to use
mcp_census_server can be used in various fields that require access to US Census Bureau data, including research, data analysis, and application development.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP Census Server
A robust Model Context Protocol (MCP) server for accessing US Census Bureau data via JSON-RPC over HTTP.
Features
- JSON-RPC 2.0 (single and batch requests)
- Pydantic models for request/response validation
- Caching of Census API responses (TTL 5 minutes)
- Structured logging (via Python
logging) - API key authentication via
X-API-Keyheader - Health check endpoint (
/health) - Interactive API docs (Swagger UI available at
/docs) - MCP methods:
initialize: negotiate protocol version and capabilitiesnotifications/initialized: client ready notificationtools/list: list available tools (census/get)tools/call: invokecensus/getto retrieve Census Bureau data
Quickstart
- Clone the repository and enter the directory:
git clone https://github.com/kaman1/mcp_census_server.git cd mcp_census_server - Copy the environment template and set your keys:
cp .env.example .env # Edit .env: # CENSUS_API_KEY=<your_census_api_key> # SERVER_API_KEY=<your_mcp_server_secret_key> - Install dependencies:
pip install -r requirements.txt - Start the server:
uvicorn app:app --host 0.0.0.0 --port 8000 --reload - Send JSON-RPC requests to
http://localhost:8000/with headerX-API-Key: <SERVER_API_KEY>.
Example tools/list call:
curl -X POST http://localhost:8000/ \
-H "Content-Type: application/json" \
-H "X-API-Key: $SERVER_API_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Development
- Tests:
pytest - Formatting:
black . - Imports:
isort . - Linting:
flake8 . - CI pipeline configured in
.github/workflows/ci.yml
Documentation
- Architecture:
docs/architecture.md - Usage Examples:
docs/usage.md - Authentication:
docs/authentication.md - Styled Documentation (MDX + Mintlify):
npm install npm run serve:docs
Hosted Documentation
You can publish these docs via GitHub Pages:
- In your GitHub repository, go to Settings > Pages.
- Under Source, choose the main branch and
/docsfolder. - Click Save.
The docs will be available at:
https://<username>.github.io/mcp_census_server/
You can add this URL in the repository About section as the project website.
Client Application
The client/ directory contains a Next.js-based MCP client that can interact with this server.
- Change into the client folder:
cd client - Copy the example environment file and fill in your keys and server URL:
cp .env.example .env.local # Set OPENAI_API_KEY, MCP_SERVER_URL (e.g. https://your-server), SERVER_API_KEY - Install dependencies and start the development server:
npm install npm run dev - Open http://localhost:3000 to use the client UI.
Quick Start Script
You can configure environments and launch both server and client in one step:
chmod +x start.sh
./start.sh
This will prompt for all required keys and run the MCP server and client concurrently.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










