Connects Claude to FEMA's OpenFEMA API for querying disaster declarations, public assistance grants, housing aid, and NFIP flood insurance claims. Eight tools cover the main datasets: search disasters by state, incident type, or date range; fetch designated areas and funded projects; pull housing assistance breakdowns by county and ZIP; and query NFIP claims with optional DuckDB spillover for SQL analytics on large result sets. When NFIP queries exceed the inline cap, results land in a DataCanvas table you can aggregate and filter with standard SQL. Generic OData query tool included for datasets the convenience wrappers don't cover. Useful for journalists, researchers, and anyone tracking federal disaster response or flood insurance payouts.
MCP_LOG_LEVELdefault: infoSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
MCP_HTTP_HOSTdefault: 127.0.0.1The hostname for the HTTP server.
MCP_HTTP_PORTdefault: 3010The port to run the HTTP server on.
MCP_HTTP_ENDPOINT_PATHdefault: /mcpThe endpoint path for the MCP server.
MCP_AUTH_MODEdefault: noneAuthentication mode to use: 'none', 'jwt', or 'oauth'.
Query FEMA disaster declarations, public assistance grants, housing aid, and NFIP flood insurance claims via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://fema.caseyjhand.com/mcp
Eight tools covering the OpenFEMA data surface — convenience tools for the headline datasets, SQL analytics over large NFIP result sets via DuckDB canvas, and a generic escape hatch for datasets the convenience tools don't cover:
| Tool | Description |
|---|---|
fema_search_disasters | Search federal disaster declarations by state, incident type, declaration type, date range, and county |
fema_get_disaster | Fetch all designated-area records for a specific disaster by disaster number |
fema_get_public_assistance | Public assistance funded projects for a disaster or state — where federal recovery money went |
fema_get_housing_assistance | Individual assistance housing data for a disaster — owner and renter breakdowns by county/ZIP |
fema_search_nfip | NFIP flood insurance claims for a state, county, or ZIP, with optional DataCanvas spillover for SQL analytics |
fema_dataframe_describe | List columns and row counts for DataCanvas tables staged by fema_search_nfip |
fema_dataframe_query | Run a SELECT query against a DataCanvas table staged by fema_search_nfip |
fema_query_dataset | Generic OData query against any OpenFEMA v2 dataset — escape hatch for datasets the convenience tools don't cover |
fema_search_disastersThe primary entry point — "what disasters were declared in Texas in 2025?"
DR/EM/FM), date range, and countydesignatedAreaCountlimit / offsetfema_get_disasterFetch all designated-area records for a specific FEMA disaster number.
fema_search_disasters to drill into a specific event; the disaster number chains to PA and housing toolsDisasterDeclarationsSummaries returns one row per designated area — a single declaration can span dozens of countiesfema_get_public_assistanceRetrieve PA funded project details — where federal recovery money went after a disaster.
disaster_number, state, or county; at least one of disaster_number or state is requiredfema_get_housing_assistanceIndividual assistance housing data for a disaster, broken down by county and ZIP.
type param (owners/renters/both)HousingAssistanceOwners and HousingAssistanceRenters datasets in a single callfema_search_nfipNFIP flood insurance claims with optional DuckDB-backed SQL analytics for large result sets.
state filter — unfiltered NFIP Claims is 2.7M rowscounty_code, zip_code, year_from, year_to; pagination via limitCANVAS_PROVIDER_TYPE=duckdb is set and results exceed the inline cap, the full result set spills to a DataCanvas table and returns a canvas_id handlefema_dataframe_describe to inspect the schema, then fema_dataframe_query for aggregation, grouping, and time-series analysis without re-fetchingfema_dataframe_describe / fema_dataframe_queryIn-conversation SQL analytics over NFIP Claims data staged by fema_search_nfip on a DuckDB-backed DataCanvas.
fema_dataframe_describe: lists columns, types, and row count for a canvas table — use before writing a queryfema_dataframe_query: runs a single SELECT statement against the staged table; standard DuckDB SQL (GROUP BY, SUM, window functions, time-series)fema_search_nfip (with canvas enabled) → fema_dataframe_describe → fema_dataframe_queryfema_query_datasetGeneric OData query against any OpenFEMA v2 dataset — the escape hatch for datasets the convenience tools don't cover.
$filter, $select, $orderby, limit, and offset paramsFimaNfipPolicies, IndividualAssistanceHousingRegistrantsLargeDisasters)| Type | Name | Description |
|---|---|---|
| Resource | fema://disaster/{disasterNumber} | Summary for a specific FEMA disaster declaration — title, state, incident type, programs, incident period |
All resource data is also reachable via tools. Use fema_get_disaster for the same data with pagination and full designated-area detail.
Built on @cyanheads/mcp-ts-core:
none, jwt, oauthin-memory, filesystem, Supabase, Cloudflare KV/R2/D1FEMA/OpenFEMA-specific:
%24-encoded to satisfy Akamai's Drupal layer), response parsing, and structured error classification (JSON 400 vs HTML 404)DisasterDeclarationsSummaries — one row per designated area collapsed to declaration-level summaries with designatedAreaCountstate filter is required to prevent unbounded 2.7M-row fetchesAgent-friendly output:
invalid_state, no_results, missing_filter, state_required, unknown_dataset, invalid_filter — with recovery hints telling agents the concrete next stepdesignatedAreaCount on search results so agents know whether to drill in with fema_get_disaster without having to fetch the full record firstA public instance is available at https://fema.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"fema-mcp-server": {
"type": "streamable-http",
"url": "https://fema.caseyjhand.com/mcp"
}
}
}
Add the following to your MCP client configuration file.
{
"mcpServers": {
"fema-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/fema-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"fema-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/fema-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"fema-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/fema-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp
To enable DuckDB-backed SQL analytics for NFIP Claims:
{
"mcpServers": {
"fema-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/fema-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"CANVAS_PROVIDER_TYPE": "duckdb"
}
}
}
}
CANVAS_PROVIDER_TYPE=duckdb to enable SQL analytics over large NFIP Claims result sets.git clone https://github.com/cyanheads/fema-mcp-server.git
cd fema-mcp-server
bun install
cp .env.example .env
# edit .env — no required vars, but CANVAS_PROVIDER_TYPE=duckdb enables SQL analytics
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
| Variable | Description | Default |
|---|---|---|
FEMA_BASE_URL | Override the OpenFEMA API base URL. | https://www.fema.gov/api/open/v2 |
FEMA_REQUEST_TIMEOUT_MS | Per-request HTTP timeout in milliseconds. NFIP county queries can be slow. | 30000 |
CANVAS_PROVIDER_TYPE | Set to duckdb to enable DataCanvas for NFIP Claims analytics. Without it, fema_search_nfip inlines results up to the cap. | — |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_AUTH_MODE | Auth mode: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, warning, error, etc.). | info |
LOGS_DIR | Directory for log files (Node.js only). | <project-root>/logs |
OTEL_ENABLED | Enable OpenTelemetry instrumentation. | false |
See .env.example for the full list of optional overrides.
Build and run:
# One-time build
bun run rebuild
# Run the built server
bun run start:stdio
# or
bun run start:http
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security
bun run test # Vitest test suite
bun run lint:mcp # Validate MCP definitions against spec
docker build -t fema-mcp-server .
docker run --rm -e MCP_TRANSPORT_TYPE=stdio fema-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/fema-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them. The @duckdb/node-api native binary is copied from the build stage, so the production image doesn't need build tools.
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools/resources and inits services. |
src/config | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools | Tool definitions (*.tool.ts) — one file per tool. |
src/mcp-server/resources | Resource definitions (*.resource.ts). |
src/services/openfema | OpenFEMA REST API client — OData param builder, response parser, error classifier, retry wrapper. |
src/services/canvas | DataCanvas integration — DuckDB spillover for large NFIP result sets. |
tests/ | Unit and integration tests mirroring src/. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for request-scoped logging, ctx.state for tenant-scoped storagesrc/mcp-server/*/definitions/index.tsIssues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
Data is provided by the OpenFEMA API, a free public API maintained by the Federal Emergency Management Agency. Usage is subject to OpenFEMA Terms and Conditions.
This product uses the Federal Emergency Management Agency's OpenFEMA API, but is not endorsed by FEMA. The Federal Government or FEMA cannot vouch for the data or analyses derived from these data after the data have been retrieved from the Agency's website(s).
When citing OpenFEMA datasets in research or publications, use the format FEMA specifies:
Federal Emergency Management Agency (FEMA), OpenFEMA Dataset: <name>. Retrieved from <URL> on <date>.
Apache-2.0 — see LICENSE for details.