Fema Mcp Server
БесплатноПоддерживаетсяQuery FEMA disaster declarations, public assistance grants, housing aid, and NFIP flood insurance claims via MCP. STDIO or Streamable HTTP.
Описание
Query FEMA disaster declarations, public assistance grants, housing aid, and NFIP flood insurance claims via MCP. STDIO or Streamable HTTP.
README
@cyanheads/fema-mcp-server
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
Overview
Federal disaster recovery data from FEMA: disaster declarations, public assistance grants, individual housing assistance, and NFIP flood insurance claims. Search declarations by state or incident, see the public and housing assistance behind any disaster, and run SQL over staged PA projects, housing records, and flood claims.
Tools
| Tool | Description |
|---|---|
fema_search_disasters |
Search federal disaster declarations by title, state, incident type, declaration type, date range, and county |
fema_get_disaster |
Look up disaster-wide funding and designated areas with their program flags |
fema_get_public_assistance |
Find PA project obligations, applicants, mitigation amounts, and county FIPS by disaster or state |
fema_get_housing_assistance |
Individual assistance housing data for a disaster — owner and renter breakdowns and inspection counts by county/ZIP, filterable by county or ZIP |
fema_search_nfip |
Filter NFIP flood insurance claims by location, loss year, and named flood event |
fema_dataframe_describe |
List columns and row counts for staged PA, housing, and NFIP tables |
fema_dataframe_query |
Run a SELECT query against staged FEMA records |
fema_dataframe_drop |
Remove a staged DataCanvas table or view — opt-in, absent from tools/list by default |
fema_query_dataset |
Generic OData query against any dataset in the OpenFEMA catalog — escape hatch for datasets the convenience tools don't cover |
fema_dataframe_drop is opt-in: it appears in tools/list only when FEMA_ENABLE_CANVAS_DROP=true. The other eight tools are always listed.
Resources
| Resource | Description |
|---|---|
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 designated-area detail (up to 1,000 rows).
Skills
| Skill | Description |
|---|---|
fema-guide |
Gates, identifier sources, and OData syntax for the fema_* tools: county naming across datasets, dollar totals, NFIP scoping, and fema_query_dataset filters |
Plugin installs pick up the root skills/ tree; MCP clients that support the Skills extension read it as skill://fema-guide/SKILL.md.
Capability reference
fema_search_disasters tool
- Filters:
title,state,incident_type,declaration_type(DR/EM/FM), inclusivedate_from/date_to(YYYY-MM-DD), andcounty.title,incident_type, andcountyare case-insensitive substring matches. A title such asharveyalso matches unrelated names such as HARVEYTOWN FIRE. Page withlimit(1–1000, default 50) andoffset; a page stops at 100,000 characters andnext_offsetsays where to resume. - Returns one summary per disaster number with
designated_area_count, program flags, and declaration totals. Withcounty,total_area_rowsandmatched_areas(FIPS codes and per-area flags) show the matching areas. Errors:invalid_state,invalid_range(date_fromafterdate_to),request_too_long. - Searches the most recent 10,000 designated-area rows. When capped, results are marked
truncated, totals are lower bounds, andnoticenames the nextdate_to.
County filters across declarations, housing, and PA recognize terminal County, Parish, Borough, and Census Area forms with or without parentheses (Harris County and Harris (County)). Recognized names use the stored counterpart spelling; unknown names retain exact/case fallbacks. Bare harris still matches Harrison; a suffixed name retains its type. IA flags combine legacy IA and IHP declarations; they do not guarantee housing records.
fema_get_disaster tool
- Requires
disaster_numberfromfema_search_disasters. fundingreports the IA approval count, IHP/HA/ONA approved dollars, PA and HMGP obligations, and IA/PA load dates fromFemaWebDisasterSummaries. A null field means FEMA has no reported value. An absent summary or failed funding lookup gets a notice.- Returns up to 1,000 designated-area records with FIPS codes and each area's
ia_declared,pa_declared, andhm_declaredflags, incident period, and program flags combined across fetched areas; a missing disaster returnsnot_found. When more rows exist,areas_truncated,total_designated_area_count, andnoticedisclose partial coverage. False flags do not exclude programs in unfetched rows; usefema_query_datasetfor the full declaration.
fema_get_public_assistance tool
- Requires
disaster_numberorstate; optionalcounty(case-insensitive substring),limit(1–10000, default 100), andoffset. A page stops at 100,000 characters;next_offsetsays where to resume. - Returns applicant IDs and available names, project titles, damage categories, obligations, mitigation amounts, county FIPS, process steps, and obligation dates. Errors include
invalid_state,missing_filter,not_found,request_too_long, andcanvas_not_found.
fema_get_housing_assistance tool
- Requires
disaster_number; optionalstate,county(case-insensitive substring),zip_code(5 digits),type(owners/renters/both, defaultboth),limit(1–10000, default 100), andoffset. A page stops at 100,000 characters; onenext_offsetcontinues both owners and renters. - On the first page, both assistance tools stage the match when it exceeds the inline page and DataCanvas is enabled. PA stages one table. Housing stages one table per nonempty selected dataset. Pass an earlier
canvas_idto keep tables together. Readcanvas_tablesfor each dataset’stable_name,staged_count, andtruncatedflag. Each table holds up to 50,000 records. Checktruncatedbefore treating a SQL aggregate as the total for the entire match. Inlinenext_offsetstill works. - Returns separate
ownersandrentersarrays with county/ZIP registrations, approved amounts, and inspection counts, plusowners_count/renters_count. Owners also carry inspected damage in USD; renters carry damage-degree counts only. Errors includeinvalid_state,not_found,request_too_long, andcanvas_not_found.
fema_search_nfip tool
- Requires
state; optionalcounty_code(5-digit FIPS like48201, or a 3-digit code like201that gets the state prefix),zip_code,year_from/year_to, exact-caseflood_event(such asHurricane Harvey),limit(1–10000, default 1000), andoffset. Results come newest loss first. - Inline claims stop at 100,000 characters;
next_offsetandnoticesay how to continue. Errors:invalid_state,invalid_county_code(anything but 1–5 digits, or a short code for FM, MH, or PW),invalid_range(year_fromafteryear_to). - County searches check for claims without a county code across the same state, loss-year range, and optional flood event, using one count-only exchange with no retries and a two-second deadline. The response uses the count only if ready with the primary page; otherwise it says coverage was not checked. These claims cannot be allocated to the selected county or ZIP. Removing
county_codeand optionally searching known ZIPs may help; ZIP results are not guaranteed complete or equivalent to a county. - With DataCanvas on (the default), a first-page match over the character budget stages up to 50,000 rows.
canvas_id,canvas_table, andstaged_countidentify the stage,truncated: truemarks its cap, andtotal_countis the full match. Inspect it withfema_dataframe_describe, then query it withfema_dataframe_query.
fema_dataframe_describe tool
- Requires
canvas_idfrom an assistance or NFIP staging response. - Lists table/view names, column types, nullability, and staged row counts. Typed errors:
canvas_not_found,canvas_unavailable.
fema_dataframe_query tool
- Requires
canvas_idand one read-only SQLquery. UseSELECTto query staged data orSHOW <table>to inspect its schema. Constantrange()andgenerate_series()can supply a series for gap-filling. - Rows are capped at the canvas row limit and 100,000 characters;
truncated/shownand OFFSET guidance appear when the result is cut. Errors:canvas_unavailable,canvas_not_found,missing_table,invalid_sql,non_select_statement,multi_statement,denied_function,plan_operator_not_allowed,sql_read_only,sql_execution_error(useTRY_CASTor filter incompatible values).
fema_dataframe_drop tool
- Requires
canvas_idand the exacttable_namefromfema_dataframe_describe. - Removes one staged table or view;
dropped: falsemeans the name did not exist. Errors:canvas_not_found,canvas_unavailable. - Opt-in through
FEMA_ENABLE_CANVAS_DROP=true.
fema_query_dataset tool
- Requires a case-sensitive OpenFEMA
dataset; optional ODatafilter/select/orderby,limit(1–10000, default 100), andoffset. A page stops at 100,000 characters;next_offsetsays where to resume. - Returns records and
total_count. Errors:unknown_dataset,dataset_not_served,catalog_unavailable(retryable),invalid_filter,invalid_select,invalid_orderby,invalid_odata_syntax,request_too_long(URL past about 8,900 characters),filter_too_complex(nested more than 100 levels). - For a list of values, use
field in ('a','b')instead of chainedorcomparisons (about 90 allowed). ForNfipPolicies, usepropertyStateandreportedZipCode, and always include a ZIP filter to avoid timeout.
fema://disaster/{disasterNumber} resource
- Requires
disasterNumberas a string of digits. - Returns title, state, incident type, declaration type/date, incident period,
programs_declared, and fetcheddesignated_area_count(up to 500). When more rows exist, the summary includesareas_truncated,total_designated_area_count, andnotice: programs describe only fetched rows, and an empty list does not establish absence. Usefema_query_datasetfor full rows.not_foundpoints tofema_search_disasters.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
OpenFEMA-specific:
- Case-insensitive county and incident type filters, using bundled declaration names plus exact PA county spellings. Refresh with
bun run vocabulary:build: sequential full exports read declarations in ID order and nonnull PA counties without a sort, with bounded transient retries. Each export must match its reported count; a failed or incomplete refresh leaves the snapshot unchanged. DisasterDeclarationsSummariesrows collapse to one summary per declaration, withdesignated_area_countfema_search_nfiprequiresstate, which prevents unbounded 2.7M-row fetches- Aggregate PA obligations, housing assistance, and NFIP losses in DuckDB through DataCanvas
- No API keys required — OpenFEMA is a free, public API
Agent-friendly output:
- Disaster number is the join key across tools, so calls chain without re-searching
- Empty searches return empty arrays, zero totals, and a
noticewith guidance for supplied filters on both response surfaces; assistance calls can check declared programs withfema_get_disaster. Paging past a nonzero total has separate offset guidance. - Typed errors on every tool (
invalid_state,invalid_county_code,invalid_range,not_found,missing_filter,unknown_dataset,dataset_not_served,invalid_filter,invalid_select,invalid_orderby,invalid_odata_syntax,request_too_long,filter_too_complex,canvas_unavailable), each with a recovery hint designated_area_counton search results shows whetherfema_get_disasteris worth a follow-up
Getting started
Connect to the hosted instance, no install:
claude mcp add --transport http fema-mcp-server https://fema.caseyjhand.com/mcp
Or run it locally:
claude mcp add fema-mcp-server -- npx -y @cyanheads/fema-mcp-server
For other clients, add this to the MCP config file:
{
"mcpServers": {
"fema-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/fema-mcp-server"]
}
}
}
No API key is required — OpenFEMA is a free, public API. For Docker or a source build, see Running the server.
Configuration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
| Variable | Description | Default |
|---|---|---|
FEMA_BASE_URL |
OpenFEMA API root. | https://www.fema.gov/api/open |
FEMA_REQUEST_TIMEOUT_MS |
Total time budget in milliseconds for one upstream request, including retries. | 30000 |
CANVAS_PROVIDER_TYPE |
Set duckdb for SQL over assistance and NFIP records or none for inline paging. The Claude Desktop bundle uses none. |
duckdb |
FEMA_ENABLE_CANVAS_DROP |
Enable the fema_dataframe_drop tool. |
false |
MCP_TRANSPORT_TYPE |
Transport: stdio or http. |
stdio |
MCP_SESSION_MODE |
Session mode: auto, stateful, or stateless. |
stateless |
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 |
LOG_TOOL_FAILURE_PAYLOADS |
Log failed-call arguments and results, redacted by key name. Secrets in free-form values are retained. | false |
LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES |
Byte cap per logged payload. | 16384 |
OTEL_EXPORTER_OTLP_ENDPOINT |
OTLP base URL for traces and metrics. | — |
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT |
Traces endpoint, used as-is. | — |
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT |
Metrics endpoint, used as-is. | — |
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT |
Log export endpoint; logs export only when this is set. | — |
LOGS_DIR |
Directory for log files (Node.js only). | <server-package-root>/logs |
OTEL_ENABLED |
Enable OpenTelemetry instrumentation. | false |
See .env.example for the full list of optional overrides.
Running the server
Local development
Requires Bun v1.4.4 or higher (or Node.js v24+).
Clone and install:
git clone https://github.com/cyanheads/fema-mcp-server.git cd fema-mcp-server && bun install cp .env.example .env # no required variablesBuild 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 run --rm -p 3010:3010 ghcr.io/cyanheads/fema-mcp-server:latest
The image defaults to HTTP transport, stateless session mode, and logs to /var/log/fema-mcp-server. To run it over stdio from an MCP client, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/fema-mcp-server:latest"]. To build locally, docker build -t fema-mcp-server .; OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
| 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, plus the case-insensitive name matcher and its bundled name vocabulary. |
src/services/canvas |
DataCanvas integration for PA, housing, and NFIP analytics. |
skills/ |
Published agent skill (fema-guide), served over MCP via createApp({ skills }). |
tests/ |
Unit and integration tests mirroring src/. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - Register new tools and resources in
src/index.ts - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
Data 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.
Установить Fema Mcp Server в Claude Desktop, Claude Code, Cursor
unyly install fema-mcp-serverСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add fema-mcp-server --env CANVAS_PROVIDER_TYPE="" --env MCP_LOG_LEVEL="" --env MCP_TRANSPORT_TYPE="" -- npx -y @cyanheads/fema-mcp-serverПошаговые гайды: как установить Fema Mcp Server
FAQ
Fema Mcp Server MCP бесплатный?
Да, Fema Mcp Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Fema Mcp Server?
Да, требуются переменные окружения: CANVAS_PROVIDER_TYPE, MCP_LOG_LEVEL, MCP_TRANSPORT_TYPE. Unyly подставит их в конфиг при установке.
Fema Mcp Server — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Fema Mcp Server в Claude Desktop, Claude Code или Cursor?
Открой Fema Mcp Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Изменения
Версии и запрашиваемые доступы со временем.
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
Похожие MCP
Opencode Omniroute Plugin
OpenCode plugin for the OmniRoute AI Gateway. Drives dynamic model discovery, /connect auth flow, and multi-instance OmniRoute providers via the official @openc
автор: GitHub ActionsRoblox Studio
Enables AI coding tools to control Roblox Studio for workspace exploration, instance manipulation, and script management. It provides tools for playtesting, sce
автор: paralovAntigravity Drawio
MCP server that enables AI assistants to create, parse, render, and validate Draw.io diagrams programmatically.
автор: S-SUJAN-SFetch
Web content fetching and conversion for efficient LLM usage.
Mcp
ModelContextProtocol server for enhancing JSON Resumes
автор: mcpflow.ioVault
Bitwarden/Vaultwarden MCP server — BYOK vault access with 6 tools, Send-based reveal, TOTP, and safe agent-write
автор: agbergsmannAWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzMCP-Agent
A simple, composable framework to build agents using Model Context Protocol by [LastMile AI](https://www.lastmileai.dev)
автор: lastmile-aiCompare Fema Mcp Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
