MCP server by sechan9999
US Data.gov MCP Servers
US government public data portal (data.gov) API Model Context Protocol (MCP) servers.
Table of Contents
- What is MCP?
- Why US Public Data MCP Servers?
- Available MCP Servers
- Installation & Setup
- Usage for Each Server
- Developer Guide
- Contributing
- License
What is MCP?
Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
MCP servers are lightweight programs that expose specific functionality through the Model Context Protocol. AI tools like Claude Desktop, Cline, Cursor, and Windsurf can communicate with these servers as MCP clients.
Why US Public Data MCP Servers?
The US government's data.gov portal provides access to thousands of datasets from various federal agencies through APIs. This project wraps these APIs as MCP servers, enabling AI tools to easily access and utilize US public data.
Key Benefits:
- Standardized Access: Use various public APIs through a unified MCP interface
- AI Tool Integration: Direct access to public data from Claude, Cline, and other AI assistants
- Easy Installation: Install via pip or uv
- Type Safety: Strong type validation using Pydantic
- Developer Friendly: Template-based rapid server creation
Available MCP Servers
Phase 1 - Core Servers
us-data-mcp.census-data
US Census Bureau demographic and economic data
us-data-mcp.sec-edgar
SEC EDGAR company filings and financial information
us-data-mcp.fda-drugs
FDA drug approvals, recalls, and safety information
us-data-mcp.bls-labor
Bureau of Labor Statistics employment and economic data
us-data-mcp.epa-airquality
EPA air quality and environmental monitoring
Phase 2 - Extended Servers (Coming Soon)
us-data-mcp.usa-spending
Federal spending, contracts, and grants
Installation & Setup
Using UV (Recommended)
# Census data server
uv pip install us-data-mcp.census-data
# SEC EDGAR server
uv pip install us-data-mcp.sec-edgar
# FDA drugs server
uv pip install us-data-mcp.fda-drugs
# BLS labor statistics server
uv pip install us-data-mcp.bls-labor
# EPA air quality server
uv pip install us-data-mcp.epa-airquality
Using pip
# Census data server
pip install us-data-mcp.census-data
# SEC EDGAR server
pip install us-data-mcp.sec-edgar
# FDA drugs server
pip install us-data-mcp.fda-drugs
# BLS labor statistics server
pip install us-data-mcp.bls-labor
# EPA air quality server
pip install us-data-mcp.epa-airquality
Claude Desktop Configuration
Add MCP servers to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"us-data-mcp.census-data": {
"command": "uvx",
"args": ["us-data-mcp.census-data@latest"],
"env": {
"CENSUS_API_KEY": "your-api-key-here"
}
},
"us-data-mcp.sec-edgar": {
"command": "uvx",
"args": ["us-data-mcp.sec-edgar@latest"]
},
"us-data-mcp.fda-drugs": {
"command": "uvx",
"args": ["us-data-mcp.fda-drugs@latest"]
},
"us-data-mcp.bls-labor": {
"command": "uvx",
"args": ["us-data-mcp.bls-labor@latest"],
"env": {
"BLS_API_KEY": "your-api-key-here"
}
},
"us-data-mcp.epa-airquality": {
"command": "uvx",
"args": ["us-data-mcp.epa-airquality@latest"],
"env": {
"EPA_AQS_EMAIL": "your-email@example.com",
"EPA_AQS_KEY": "your-api-key-here"
}
}
}
}
Note: Using @latest ensures you always run the latest version.
Cline Configuration
Configure MCP servers in VS Code's Cline extension:
.vscode/cline_mcp_settings.json:
{
"mcpServers": {
"us-data-mcp.census-data": {
"command": "python",
"args": ["-m", "us_data_mcp.census_data.server"],
"env": {
"CENSUS_API_KEY": "your-api-key-here"
}
}
}
}
Usage for Each Server
Census Bureau Data (us-data-mcp.census-data)
Access US Census Bureau demographic and economic data.
Environment Variables
export CENSUS_API_KEY="your-api-key-here" # Get from https://api.census.gov/data/key_signup.html
Available Tools
search_population: Search population data by geography
Parameters:
year: Year of data (e.g., 2020)state: State FIPS code (2 digits)county: County FIPS code (3 digits, optional)variables: List of census variables to retrieve
search_economic: Search economic indicators
Parameters:
year: Year of datadataset: Dataset name (e.g., "acs/acs5")variables: List of economic variablesgeography: Geographic level (state, county, etc.)
Usage Examples
"Get population data for California in 2020"
"Find median household income for New York County"
"Show employment statistics for Texas"
SEC EDGAR (us-data-mcp.sec-edgar)
Access SEC company filings and financial information.
Environment Variables
No API key required - uses public SEC EDGAR API.
Available Tools
search_company: Search for companies by name, ticker, or CIK
Parameters:
query: Company name, ticker symbol, or CIK
get_company_facts: Get company financial facts (XBRL data)
Parameters:
cik: Central Index Key
get_insider_trades: Get recent insider trading reports (Form 4)
Parameters:
cik: Central Index Keylimit: Number of trades to retrieve (default: 20)
get_form_types: Get reference list of SEC form types
Usage Examples
"Find recent 10-K filings for Apple"
"Search for company with ticker MSFT"
"Get financial facts for CIK 0000320193"
"Show recent insider trades for Tesla"
FDA Drug Information (us-data-mcp.fda-drugs)
Access FDA drug approvals, recalls, and safety information.
Environment Variables
No API key required - uses public openFDA API.
Available Tools
search_drugs: Search drug database
Parameters:
brand_name: Brand name of drug (optional)generic_name: Generic name (optional)application_number: FDA application number (optional)limit: Max results (default: 10)
search_recalls: Search drug recalls
Parameters:
product_description: Product descriptionclassification: Recall classification (I, II, III)status: Recall status (ongoing, completed)limit: Max results (default: 10)
search_adverse_events: Search adverse event reports
Parameters:
drug_name: Drug namereaction: Specific reaction/side effect (optional)limit: Max results (default: 10)
search_devices: Search for medical devices
Parameters:
device_name: Device namelimit: Max results (default: 10)
search_all_recalls: Search all FDA recalls (food, drug, device)
Parameters:
category: Category (food, drug, device)product_description: Product name or keywordslimit: Max results (default: 10)
Usage Examples
"Find FDA approval info for Lipitor"
"Search for recent food recalls"
"Get information on heart valve devices"
"Get adverse event reports for aspirin"
BLS Labor Statistics (us-data-mcp.bls-labor)
Access Bureau of Labor Statistics employment and economic data.
Environment Variables
export BLS_API_KEY="your-api-key-here" # Get from https://www.bls.gov/developers/api_signature_v2.htm
Available Tools
get_series_data: Fetch data for BLS series IDs
Parameters:
series_ids: List of series IDs (e.g., ["LNS14000000"])start_year: Start yearend_year: End year
get_common_series: Get reference list of common series IDs
Usage Examples
"Get national unemployment rate from 2020 to 2023"
"Find CPI data for inflation analysis"
"Show total nonfarm employment statistics"
EPA Air Quality (us-data-mcp.epa-airquality)
Access EPA Air Quality System (AQS) environmental data.
Environment Variables
export EPA_AQS_EMAIL="your-email@example.com"
export EPA_AQS_KEY="your-api-key-here" # Get from https://aqs.epa.gov/data/api/signup
Available Tools
get_daily_air_quality: Fetch daily air quality summaries
Parameters:
param_code: Pollutant parameter code (e.g., "44201" for Ozone)bdate: Begin date (YYYYMMDD)edate: End date (YYYYMMDD)state: 2-digit State FIPS codecounty: 3-digit County FIPS code (optional)
get_common_aqs_parameters: Get reference list of pollutant codes
Usage Examples
"Get Ozone levels in California for July 2023"
"Find PM2.5 levels in Los Angeles County"
"Show common air pollutant codes for EPA data"
Developer Guide
Development Environment Setup
# Clone repository
git clone https://github.com/sechan9999/us-data-mcp-servers.git
cd us-data-mcp-servers
# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync --dev
🚀 Quickly Create a New MCP Server
Using Automation Script (Recommended)
The fastest way is to use the provided template generation script:
# Run interactive script
uv run python scripts/create_mcp_server.py
The script will guide you through the process step-by-step and generate a new MCP server in minutes.
Manual Template Usage
# Install Cookiecutter (if needed)
uv pip install cookiecutter
# Create new server from template
uv run cookiecutter template/ -o src/
For detailed template usage, see TEMPLATE_USAGE.md.
For the complete developer guide, see CONTRIBUTING.md.
Running Tests
# Run all tests
uv run pytest
# Run tests for specific server
uv run pytest src/census-data/tests/
API Keys
| Service | API Key Required | Documentation/Sign Up Link | |---------|------------------|----------------------------| | Census Bureau | Recommended | Census API Key | | SEC EDGAR | No | SEC EDGAR API | | FDA openFDA | No | openFDA API | | BLS | Yes | BLS API Key | | EPA AQS | Yes | EPA AQS Sign Up |
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details.
Acknowledgments
Inspired by the Korean data.go.kr MCP servers project.