fema-mcp-server
Can be used as a swappable storage backend, supporting Cloudflare KV, R2, and D1 for persisting data.
Provides in-conversation SQL analytics over NFIP Claims data staged by fema_search_nfip using DuckDB-backed DataCanvas.
Can be used as a swappable storage backend for persistent storage of data.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@fema-mcp-serverShow me hurricane disasters in Texas in 2025"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public Hosted Server: https://fema.caseyjhand.com/mcp
Tools
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 |
| Search federal disaster declarations by state, incident type, declaration type, date range, and county |
| Fetch all designated-area records for a specific disaster by disaster number |
| Public assistance funded projects for a disaster or state — where federal recovery money went |
| Individual assistance housing data for a disaster — owner and renter breakdowns by county/ZIP |
| NFIP flood insurance claims for a state, county, or ZIP, with optional DataCanvas spillover for SQL analytics |
| List columns and row counts for DataCanvas tables staged by |
| Run a SELECT query against a DataCanvas table staged by |
| Generic OData query against any OpenFEMA v2 dataset — escape hatch for datasets the convenience tools don't cover |
fema_search_disasters
The primary entry point — "what disasters were declared in Texas in 2025?"
Filter by state (2-letter code), incident type (Hurricane, Flood, Wildfire, etc.), declaration type (
DR/EM/FM), date range, and countyReturns deduplicated declaration-level summaries — one row per declaration, not per designated area
Includes disaster number (the join key for PA and housing tools), title, state, incident type, declaration/incident dates, programs declared (IA/PA/HM), and
designatedAreaCountPaginated via
limit/offset
fema_get_disaster
Fetch all designated-area records for a specific FEMA disaster number.
Returns every county/municipality row for the declaration with programs activated, incident period, and FIPS codes
Use after
fema_search_disastersto drill into a specific event; the disaster number chains to PA and housing toolsDisasterDeclarationsSummariesreturns one row per designated area — a single declaration can span dozens of counties
fema_get_public_assistance
Retrieve PA funded project details — where federal recovery money went after a disaster.
Filter by
disaster_number,state, orcounty; at least one ofdisaster_numberorstateis requiredReturns applicant, damage category, project size/status, federal share obligated, and total obligated
Useful for journalists, researchers, and oversight analysts tracking federal grant flows
fema_get_housing_assistance
Individual assistance housing data for a disaster, broken down by county and ZIP.
Returns owner and renter breakdowns via
typeparam (owners/renters/both)Fields include valid registrations, total inspected, total damage, approved IHP amounts, repair/rental/other-needs amounts, and max grants
Covers
HousingAssistanceOwnersandHousingAssistanceRentersdatasets in a single call
fema_search_nfip
NFIP flood insurance claims with optional DuckDB-backed SQL analytics for large result sets.
Requires at minimum a
statefilter — unfiltered NFIP Claims is 2.7M rowsAdditional filters:
county_code,zip_code,year_from,year_to; pagination vialimitWhen
CANVAS_PROVIDER_TYPE=duckdbis set and results exceed the inline cap, the full result set spills to a DataCanvas table and returns acanvas_idhandleUse
fema_dataframe_describeto inspect the schema, thenfema_dataframe_queryfor aggregation, grouping, and time-series analysis without re-fetching
fema_dataframe_describe / fema_dataframe_query
In-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)Workflow:
fema_search_nfip(with canvas enabled) →fema_dataframe_describe→fema_dataframe_queryRead-only — writes, DDL, and DROP are rejected by the framework SQL gate
fema_query_dataset
Generic OData query against any OpenFEMA v2 dataset — the escape hatch for datasets the convenience tools don't cover.
Accepts raw
$filter,$select,$orderby,limit, andoffsetparamsDataset name must match an actual OpenFEMA endpoint (e.g.
FimaNfipPolicies,IndividualAssistanceHousingRegistrantsLargeDisasters)Validates that the API returns JSON (Content-Type check) and surfaces structured error codes on 400 responses
Related MCP server: @cyanheads/eia-energy-mcp-server
Resources and prompts
Type | Name | Description |
Resource |
| 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.
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation
Unified error handling — handlers throw, framework catches, classifies, and formats
Pluggable auth:
none,jwt,oauthSwappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1Structured logging with optional OpenTelemetry tracing
STDIO and Streamable HTTP transports
FEMA/OpenFEMA-specific:
Typed OpenFEMA REST client with OData parameter building (
%24-encoded to satisfy Akamai's Drupal layer), response parsing, and structured error classification (JSON 400 vs HTML 404)Automatic deduplication of
DisasterDeclarationsSummaries— one row per designated area collapsed to declaration-level summaries withdesignatedAreaCountNFIP Claims guard:
statefilter is required to prevent unbounded 2.7M-row fetchesDataCanvas spillover for NFIP analytics — large NFIP result sets materialize as DuckDB tables queryable via SQL without re-fetching
No API keys required — OpenFEMA is a free, public API
Agent-friendly output:
Disaster number is the explicit join key across all datasets — every tool that touches a disaster surfaces it prominently so agents can chain calls without re-searching
Typed error contracts on every tool —
invalid_state,no_results,missing_filter,unknown_dataset,invalid_filter,canvas_unavailable— with recovery hints telling agents the concrete next stepdesignatedAreaCounton search results so agents know whether to drill in withfema_get_disasterwithout having to fetch the full record first
Getting started
Public Hosted Instance
A 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"
}
}
}Self-Hosted / Local
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/mcpTo 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"
}
}
}
}Prerequisites
Bun v1.3.0 or higher (or Node.js v24+).
No API keys required — OpenFEMA is a free, public API.
Optional: set
CANVAS_PROVIDER_TYPE=duckdbto enable SQL analytics over large NFIP Claims result sets.
Installation
Clone the repository:
git clone https://github.com/cyanheads/fema-mcp-server.gitNavigate into the directory:
cd fema-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env — no required vars, but CANVAS_PROVIDER_TYPE=duckdb enables SQL analyticsConfiguration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
Variable | Description | Default |
| Override the OpenFEMA API base URL. |
|
| Per-request HTTP timeout in milliseconds. NFIP county queries can be slow. |
|
| Set to | — |
| Transport: |
|
| HTTP server port. |
|
| Auth mode: |
|
| Log level ( |
|
| Directory for log files (Node.js only). |
|
| Enable OpenTelemetry instrumentation. |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun 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
docker build -t fema-mcp-server .
docker run --rm -e MCP_TRANSPORT_TYPE=stdio fema-mcp-serverThe 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.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing and validation with Zod. |
| Tool definitions ( |
| Resource definitions ( |
| OpenFEMA REST API client — OData param builder, response parser, error classifier, retry wrapper. |
| DataCanvas integration — DuckDB spillover for large NFIP result sets. |
| Unit and integration tests mirroring |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources via the barrels in
src/mcp-server/*/definitions/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testData source
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>.License
Apache-2.0 — see LICENSE for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityAmaintenanceAccess FEC campaign finance data through MCP. Query data about candidates, money trails, and election filings. STDIO & Streamable HTTP.Last updated1,0492Apache 2.0
- Alicense-qualityAmaintenanceBrowse and query the U.S. Energy Information Administration API v2 — electricity, petroleum, natural gas, coal, forecasts, and more via MCP. STDIO or Streamable HTTP.Last updated481Apache 2.0
- Alicense-qualityAmaintenanceSearch and fetch ~800K Federal Reserve economic time-series from the FRED API via MCP, with STDIO or Streamable HTTP transport.Last updated511Apache 2.0
- Alicense-qualityAmaintenanceExposes the FBI Crime Data Explorer API — crime estimates, agency offense rates, and LEOKA officer safety data via MCP. Supports STDIO or Streamable HTTP transport.Last updated1051Apache 2.0
Related MCP Connectors
OpenFEMA MCP — US Federal Emergency Management Agency open data.
Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.
Query FDA data on drugs, food, devices, and recalls via openFDA. STDIO or Streamable HTTP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/fema-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server