The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Bls Labor MCP Server listing page.
Fetch US Bureau of Labor Statistics data — CPI, unemployment, wages, JOLTS, and more via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://bls-labor.caseyjhand.com/mcp
Four BLS data tools are always available. Setting CANVAS_PROVIDER_TYPE=duckdb adds two DataCanvas SQL tools; setting BLS_DATAFRAME_DROP_ENABLED=true as well adds the seventh, destructive cleanup tool.
| Tool | Description |
|---|---|
bls_list_surveys | List BLS survey programs (CPI, CPS, CES, JOLTS, PPI, OEWS, …) with codes, descriptions, and calculation-support flags. |
bls_search_series | Search the BLS series catalog by natural language, survey, area, or keywords to resolve cryptic SeriesIDs. |
bls_get_series | Fetch time-series data for 1–50 BLS series by SeriesID, with optional year range and period-over-period calculations. |
bls_get_latest | Return the single most recent observation for one or more BLS series. |
bls_dataframe_describe | List canvas dataframes registered by bls_get_series — provenance, TTL, row count, column schema. Available when CANVAS_PROVIDER_TYPE=duckdb. |
bls_dataframe_query | Run a SELECT against canvas dataframes registered by bls_get_series. Supports JOINs, aggregates, window functions, CTEs. Available when CANVAS_PROVIDER_TYPE=duckdb. |
bls_dataframe_drop | Drop a canvas dataframe by name. Available when CANVAS_PROVIDER_TYPE=duckdb and BLS_DATAFRAME_DROP_ENABLED=true; TTL handles cleanup by default. |
bls_list_surveysList available BLS survey programs and their metadata.
category filter (prices, employment, wages, productivity, injuries, time_use)allowsNetChange, allowsPercentChange, hasAnnualAverages)bls_search_seriesThe entry point for most BLS workflows. Resolves human concepts to BLS SeriesIDs.
LNS14000000 and CES0000000001 encode survey + area + item + seasonal flag in opaque positional codes — this tool decodes thembls_get_series or bls_get_latest when you have a concept but not a SeriesIDbls_get_seriesFetch historical time-series data for one or more BLS series.
start_year / end_year window (BLS caps history at 20 years per request)calculations: true for BLS-server-side net change and percent change — a survey returns whichever it supports (CPI/PPI return percent change only); check bls_list_surveys for per-survey supportannual_average: true adds each year's annual-average row (period M13, Q05 or S03) — the mean of that year's real periods, not an additional one. enrichment.annualAverageRows reports how many were addedavailable; BLS's raw - missing-value sentinel is preserved but excluded from availableObservationCount and called out in the noticeCANVAS_PROVIDER_TYPE=duckdb, spills to a DataCanvas dataframe when the observation count exceeds the inline context budget. Rows preserve raw value and add available plus nullable numeric value_numeric for safe SQL arithmetic. Call bls_dataframe_describe with the returned dataset.name to inspect column_schema, then use that table name in bls_dataframe_query SQL. Without DataCanvas, narrow oversized requests with start_year / end_year.bls_get_latestGet the current value for one or more BLS series.
bls_get_series with a narrow year window is more quota-efficient (one API query regardless of series count)failed[] array alongside successful resultsavailable; a BLS - value renders explicitly as unavailable with its footnote reasonbls_dataframe_describeInspect canvas dataframes registered by bls_get_series.
Available only when CANVAS_PROVIDER_TYPE=duckdb.
bls_dataframe_queryRun SQL against canvas dataframes registered by bls_get_series.
Available only when CANVAS_PROVIDER_TYPE=duckdb.
register_as persists the query result as a new named dataframe with a fresh TTL — useful for chaining analyses without re-consuming BLS API quotaregister_as is setbls_dataframe_dropDrop a canvas dataframe by name. Idempotent — returns dropped: false when nothing matched.
CANVAS_PROVIDER_TYPE=duckdb and must be explicitly enabled via BLS_DATAFRAME_DROP_ENABLED=true (TTL handles cleanup by default)Built on @cyanheads/mcp-ts-core:
none, jwt, oauth)in-memory, filesystem, Supabase, Cloudflare KV/R2/D1BLS-specific:
bls_get_series / bls_get_latest without the 500/day API cap (opt-in, off by default)BLS_CATALOG_INCLUDE_OESAdd the following to your MCP client configuration file. A free BLS API key unlocks 500 queries/day — register at bls.gov/developers. The server works without a key at 25 req/day.
Or with npx (no Bun required):
Or with Docker:
For Streamable HTTP, set the transport and start the server:
All configuration is validated at startup via Zod schemas in src/config/server-config.ts.
| Variable | Description | Default |
|---|---|---|
BLS_API_KEY | BLS v2 API key. Optional — 25 req/day without, 500 req/day with. Register free at bls.gov/developers. | — |
BLS_BASE_URL | BLS API v2 base URL. | https://api.bls.gov/publicAPI/v2 |
BLS_CATALOG_BASE_URL | LABSTAT flat-file base URL. Override to point at a local mirror. | https://download.bls.gov/pub/time.series |
BLS_CATALOG_DB_PATH | On-disk SQLite catalog index — queried on demand and persisted across restarts. Empty uses an in-memory DB (re-harvested each boot). Mount a volume here in containers. | .cache/bls-catalog.db |
BLS_CATALOG_CACHE_TTL_HOURS | Catalog freshness window in hours — re-harvest once the index is older. | 168 (7 days) |
BLS_CATALOG_INCLUDE_OES | Include the OES/OEWS wage survey (~6M series / ~1.2 GB; multi-minute first harvest). Off by default — OES series stay fetchable by ID. | false |
BLS_OBSERVATIONS_MIRROR_ENABLED | Serve observations from a local SQLite mirror instead of the live API (requires a one-time bootstrap — see below). | false |
BLS_DATASET_TTL_SECONDS | Per-dataframe TTL for canvas-registered tables, in seconds. | 86400 (24 h) |
BLS_DATAFRAME_DROP_ENABLED | Expose bls_dataframe_drop. TTL handles cleanup by default. | false |
CANVAS_PROVIDER_TYPE | Set to duckdb to enable DataCanvas tabular spillover for large result sets. | none |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_SESSION_MODE | Session mode. This server uses stateless; valid schema values are auto, stateful, and stateless. Schema-default auto resolves to stateful. | stateless |
MCP_AUTH_MODE | Auth mode: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (RFC 5424). | 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.
For high-volume workloads, an opt-in local mirror serves bls_get_series / bls_get_latest from an embedded SQLite store instead of the BLS API — eliminating the 500/day quota cap. It is off by default. To enable:
Set BLS_OBSERVATIONS_MIRROR_ENABLED=true (and review the BLS_OBSERVATIONS_MIRROR_* vars in .env.example).
Run the one-time bootstrap out-of-band — it downloads the full LABSTAT observation set and can take a while:
Until the bootstrap completes, requests fall back to the live API (unless BLS_OBSERVATIONS_MIRROR_FALLBACK_LIVE=false). On HTTP transport, an incremental refresh runs on the BLS_OBSERVATIONS_MIRROR_REFRESH_CRON schedule. In containers, mount a persistent volume at BLS_OBSERVATIONS_MIRROR_PATH.
Build and run:
Run checks and tests:
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/bls-labor-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools and initializes services. |
src/config | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools | Tool definitions (*.tool.ts). |
src/services/bls-api | BLS API v2 service — batch fetch, latest-value GET, surveys metadata. |
src/services/bls-catalog | LABSTAT flat-file catalog — offline series index and search. |
src/services/bls-observations | Optional LABSTAT observation mirror — embedded SQLite store, ingester, and refresh subprocess. |
src/services/canvas-bridge | DataCanvas bridge — dataframe registration, SQL gate, lifecycle management. |
docs/design.md | Full tool surface specification, service architecture, and error contracts. |
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 storagebls_search_series is the anchor tool — design workflows to call it before the API toolsIssues and pull requests are welcome. Run checks and tests before submitting:
Apache-2.0 — see LICENSE for details.