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's OpenFEMA API — disaster declarations, public assistance grants, individual housing assistance, and NFIP flood insurance claims. Search declarations by state or incident, drill into public assistance and housing assistance by disaster number, and run SQL analytics over large NFIP result sets via DataCanvas. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
Tools
| 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_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 OpenFEMA v2 dataset — escape hatch for datasets the convenience tools don't cover |
fema_dataframe_drop is registered only when FEMA_ENABLE_CANVAS_DROP=true; the other eight tools are always advertised.
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 the same data with pagination and full designated-area detail.
Capability reference
fema_search_disasters tool
- Filters:
state(2-letter code),incident_type(substring match),declaration_type(DR/EM/FM),date_from/date_to(declaration date range),county(substring); paginated vialimit(1–1000, default 50) /offset - Returns deduplicated declaration-level summaries — one row per unique disaster number, with
designated_area_countand program flags (ia_declared/pa_declared/hm_declared) - Deduplicates the most recent 10,000 designated-area rows before paging; when
total_area_rowsexceeds 10,000, unique-declaration totals are lower bounds - Typed errors:
invalid_state,no_results
fema_get_disaster tool
- Input:
disaster_number(positive integer), obtained fromfema_search_disasters - Returns every designated county/municipality row for the declaration, with FIPS codes, incident period, and program flags OR'd across all areas
- Disaster numbers above 32767 (OpenFEMA's Int16 field limit) return
not_foundrather than a raw API type-mismatch error
fema_get_public_assistance tool
- Requires
disaster_numberorstate— at least one; optionalcountysubstring filter; paginated vialimit(1–1000, default 100) /offset - Returns applicant, damage category, project size/status, federal share obligated, and total obligated per project
- Typed errors:
invalid_state,missing_filter(neitherdisaster_numbernorstategiven),no_results
fema_get_housing_assistance tool
- Input:
disaster_number(required), optionalstatefilter,type(owners/renters/both, defaultboth); paginated vialimit(1–1000, default 100) /offset - Returns separate
ownersandrentersarrays — registrations, approved amounts, and repair/rental/other-needs breakdowns by county and ZIP - Typed errors:
invalid_state,no_results(IA housing data can take weeks to appear after a declaration)
fema_search_nfip tool
stateis required — the unfiltered NFIP Claims dataset is 2.7M rows; optionalcounty_code(5-digit FIPS or a bare 3-digit code, auto-prefixed with the state FIPS),zip_code,year_from/year_to; inline preview capped atlimit(1–10000, default 1000)- When
CANVAS_PROVIDER_TYPE=duckdbis set and results exceed the 100,000-character inline preview budget, the matching set spills to a DataCanvas table (up to 50,000 rows) and the response carriescanvas_id/canvas_table;truncated: truemarks a partial stage at that cap - Without canvas enabled, results return inline only, bounded by
limit - Typed errors:
invalid_state,no_results
fema_dataframe_describe tool
All four canvas inputs (fema_search_nfip, fema_dataframe_describe, fema_dataframe_query, and fema_dataframe_drop) require a server-issued 10-character URL-safe ID matching [A-Za-z0-9_-]{10} when supplied. Omit it on the first NFIP search.
- Input:
canvas_idfrom afema_search_nfipresponse - Lists table/view names, DuckDB column types, and nullability; row count reflects what was actually staged, not the inline preview
- Typed errors:
canvas_not_found,canvas_unavailable(DataCanvas not enabled on this deployment)
fema_dataframe_query tool
- Input:
canvas_idplus a single SQLquery; only SELECT statements are permitted — DDL, DML, COPY, and file-reading functions are blocked - Results are capped at the canvas row limit; a capped response sets
truncated/shown/capenrichment fields with LIMIT/OFFSET paging guidance - Typed errors:
canvas_not_found,canvas_unavailable,invalid_query,sql_execution_error(useTRY_CASTor filter incompatible values)
fema_dataframe_drop tool
- Opt-in: not registered (absent from
tools/list) unlessFEMA_ENABLE_CANVAS_DROP=true - Input:
canvas_idand the exacttable_namefromfema_dataframe_describe - Removes one staged table or view only — never changes FEMA source data;
dropped: falsewhen the name doesn't exist - Typed errors:
canvas_not_found,canvas_unavailable
fema_query_dataset tool
- Input:
dataset(case-sensitive OpenFEMA v2 entity name), optional raw ODatafilter/select/orderby,limit(1–10000, default 100) /offset - Escape hatch for datasets the convenience tools don't cover (e.g.
FimaNfipPolicies,IndividualAssistanceHousingRegistrantsLargeDisasters); for NFIP Policies usepropertyState(notstate) and always include a county or ZIP filter to avoid timeout - Typed errors:
unknown_dataset(name not recognized),invalid_filter(OData syntax error)
fema://disaster/{disasterNumber} resource
- Params:
disasterNumberas a string - Returns title, state, incident type, declaration type/date, incident period,
programs_declaredarray, anddesignated_area_count - Disaster numbers above 32767 return not-found, same as
fema_get_disaster
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:
- Typed OpenFEMA REST client with
%24-prefixed OData parameter encoding (an Akamai requirement) and structured error classification distinguishing JSON 400 responses from HTML Drupal error pages - Automatic deduplication of
DisasterDeclarationsSummaries— one row per designated area collapsed to declaration-level summaries withdesignated_area_count - NFIP Claims guard:
statefilter is required to prevent unbounded 2.7M-row fetches - DataCanvas 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 step designated_area_counton 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/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"
}
}
}
}
Prerequisites
- Bun v1.4.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.git
- Navigate into the directory:
cd fema-mcp-server
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
# edit .env — no required vars, but CANVAS_PROVIDER_TYPE=duckdb enables SQL analytics
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 |
Override the OpenFEMA API base URL. | https://www.fema.gov/api/open/v2 |
FEMA_REQUEST_TIMEOUT_MS |
Total budget in milliseconds for one upstream exchange, including response body, retries, and backoff. 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. |
— |
FEMA_ENABLE_CANVAS_DROP |
Enable the destructive fema_dataframe_drop tool for removing staged tables and views. |
false |
MCP_TRANSPORT_TYPE |
Transport: stdio or http. |
stdio |
MCP_SESSION_MODE |
Session mode: auto, stateful, or stateless. Overrides this server's explicit stateless default. The framework schema default auto resolves to stateful. |
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 |
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.
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-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. Production dependencies, including the DuckDB native binding, are installed directly in the runtime stage without lifecycle scripts.
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 — 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/. |
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
Fetch
Web content fetching and conversion for efficient LLM usage.
Roblox Studio
Enables AI coding tools to control Roblox Studio for workspace exploration, instance manipulation, and script management. It provides tools for playtesting, sce
автор: paralovOpencode 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 ActionsAWS 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-aiSpring AI MCP Client
Provides auto-configuration for MCP client functionality in Spring Boot applications.
mcp.natoma.ai
A Hosted MCP Platform to discover, install, manage and deploy MCP servers by [Natoma Labs](https://www.natoma.ai)
MCPHub
Website to list high quality MCP servers and reviews by real users. Also provide online chatbot for popular LLM models with MCP server support.
Compare Fema Mcp Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
