us-layoff-warnings
# US Layoff Warnings — MCP Server
Every WARN layoff and plant-closure notice we could assemble from
state-published lists, as a **self-contained MCP server**: the data
ships inside this repo, so it runs standalone — no API key, no live
backend, nothing to sign up for.
**This repo carries a sample: the complete calendar-2022 slice of
the full dataset — 1,496 company-level notices · 18 states · notice
dates 2022-01-03 to 2022-12-30 · 116,427 workers affected** (3
notices carry no worker count and add nothing to that total).
Why a sample, and why 2022: people pay for *new* layoffs, so the
current data is the product and it is not given away here. The full
dataset — **35,031 notices, 27 states + DC, notice dates 1998 to
2026, 3,320,613 workers affected** — is available from Second Desk
as data packs and API access. This repo lets anyone run the real
server against a real, complete past year, free, and see exactly
how it behaves before buying the current file.
Built for people who track layoffs for a living — journalists
writing the story before the press release, recruiters and staffing
firms who need to know which workforces are about to move, workforce
boards planning response services, and investors watching for
distress signals in a sector or a state.
## Tools
| Tool | What it does |
|---|---|
| `search_layoffs(company, state, city)` | Search notices: company is a substring match on the employer name, state a 2-letter code, city an exact site city. Filters compose. |
| `layoffs_by_state(state, year)` | Every notice in one state, optionally narrowed to one notice year, with the workers-affected total for the same filter. |
| `layoffs_by_industry(industry)` | Notices whose published industry text contains the word or phrase — "Manufacturing", "Health Care", "Retail Trade". |
| `recent_layoffs(days, limit)` | Notices from the newest N days **of the sample** (see the honesty note below). |
| `layoff_count(state, year)` | Notice count and workers-affected total for a state and/or notice year — or the whole sample with no filters. |
Every result row carries the fields exactly as the dataset holds
them: `employer`, `site_city`, `site_state`, `county`,
`workers_affected`, `notice_date`, `effective_date`, `notice_type`
(layoff / closure / unspecified), `notice_type_raw`, `industry_raw`,
`locations_raw`, `workers_note`, `short_notice`, `source_url`, and
`source_state` — so every row can be traced back to the state list
it came from.
## Coverage of the sample (2022)
Notice counts by state, as assembled:
| State | Notices | State | Notices |
|---|---|---|---|
| CA | 856 | NC | 43 |
| FL | 102 | NV | 42 |
| IA | 96 | SC | 35 |
| TX | 86 | IN | 32 |
| WI | 59 | VA | 30 |
| MA | 46 | NY | 17 |
| OR | 15 | KY | 15 |
| AL | 9 | UT | 7 |
| SD | 5 | AK | 1 |
Notice types in the sample: 700 layoffs, 498 closures, 298 where
the state did not specify. The full dataset covers 27 states + DC
back to 1998; this sample is one year of it, complete for that year
for the states listed.
## Run it
```bash
pip install -r requirements.txt
python3 mcp_server.py # stdio (default)
python3 mcp_server.py --transport streamable-http --port 8793
```
The HTTP transport also answers `GET /health` with the record
count, covered states, and newest notice date. Set `WARN_DB` to
point at a different SQLite store; rebuild the bundled store from
the bundled CSV any time with `python3 build_db.py`. Tests:
`python3 -m unittest discover -s tests -v`.
## Source
The Worker Adjustment and Retraining Notification (WARN) Act
requires employers to file advance notice of plant closures and
mass layoffs; US states publish those notices as public lists. The
full dataset was assembled by Second Desk on 2026-11-26 from the
state-published lists (each row's `source_url` names the list it
came from); this sample is its complete 2022 slice. Rows are
company-level only — source columns naming individual contact
persons were dropped at ingest and are never carried.
## Honest limits
- **It is a sample of one past year, not a feed.** The sample's
newest notice is dated 2022-12-30. `recent_layoffs` counts back
from that date and says so in every response. Notices from any
other year — including everything current — are in the full
dataset, not here.
- **Depth varies by state, because states publish differently.**
California's archive is the deepest in the full dataset (17,610
notices); in this sample it contributes 856. An empty answer for
a state usually means the state did not publish it, not that
nothing happened.
- **Fields are blank where the state left them blank** — never
guessed, never backfilled. In the sample: 3 rows have no worker
count, 203 no county.
- **Industry is the state's own text** (`industry_raw`), present on
300 of the sample's 1,496 rows and not normalized to one taxonomy
— the same sector appears as both "Manufacturing" and "31-33
Manufacturing". `layoffs_by_industry` substring-matches that
text, so it finds both, but it cannot find a notice whose state
published no industry.
- **A few dates are wrong in the source and are carried as
published** in the full dataset. Notice dates are the reliable
timeline; effective dates are as filed.
## License
MIT — see `LICENSE`. The dataset is compiled from public
government-published notices; if you reuse the rows, crediting the
state list in each row's `source_url` is the honest way to pass
them on.
TDQS
Scored across 5 tools
The state filter appears in three separate tools (search_layoffs, layoffs_by_state, layoff_count), and layoff_count duplicates the count/workers_affected_total fields already returned by search_layoffs, so an agent can plausibly pick the wrong entry point. Descriptions do clarify the special cases (industry coverage caveats, static snapshot date), which keeps this from being worse than moderate overlap.
All names are snake_case, but the patterns are mixed: a verb_noun tool (search_layoffs), dimension tools (layoffs_by_state, layoffs_by_industry), an adjective_noun tool (recent_layoffs), and a bare noun+count tool (layoff_count). Readable and domain-coherent, but there is no predictable verb_noun convention an agent can rely on.
Five tools is well within the ideal range for a single read-only dataset. The surface is small and focused, with no filler tools that don't map to a query pattern on the WARN notice data.
The surface covers the main query axes — company substring, state, city, year, industry, recency, and aggregate counts — which is solid coverage for this dataset. Gaps are minor but real: no arbitrary date-range filter, no company-level aggregation or per-employer rollup, and no fetch-by-id for a single notice.