cyanheads avatar

Treasury Fiscaldata Mcp Server

cyanheads/treasury-fiscaldata-mcp-server

Connects Claude to the US Treasury's Fiscal Data API with seven tools covering 80+ datasets. The main workhorse is a generic query builder that takes filters, sorts, and pagination for any endpoint. Three convenience tools handle the most common asks: national debt since 1993, average interest rates on Treasury securities, and statutory exchange rates for 130 countries. Results can spill into DuckDB backed DataCanvas dataframes, letting you run SQL joins and aggregates across multiple queries in the same conversation. Ships with an embedded catalog so you can browse available endpoints without hitting the network. Built on the mcp-ts-core framework with both STDIO and streamable HTTP transports.

GitHub stars
3
tools
7
transport
STDIO, HTTP
env vars
8
last updated
Oct 28, 2026

Install

From registry metadata
$ npx add-mcp https://treasury-fiscaldata.caseyjhand.com/mcp --name treasury-fiscaldata

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http treasury-fiscaldata https://treasury-fiscaldata.caseyjhand.com/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 7 tools

Verified live against the running server on Nov 6, 2026.

treasury_list_datasetsBrowse the curated catalog of US Treasury Fiscal Data API endpoints. Returns endpoint paths, field names, descriptions, and update cadence for each dataset. Use this tool before treasury_query_dataset to discover the correct endpoint path and field names — a typo in either cau...2 params

Browse the curated catalog of US Treasury Fiscal Data API endpoints. Returns endpoint paths, field names, descriptions, and update cadence for each dataset. Use this tool before treasury_query_dataset to discover the correct endpoint path and field names — a typo in either cau...

Parameters* required
categorystring
Filter by category. Omit to list all datasets. Options: debt, interest_rates, exchange_rates, revenue_spending, savings_bonds, securities, other.one of debt · interest_rates · exchange_rates · revenue_spending · savings_bonds · securities
searchstring
Keyword filter against dataset name and description (case-insensitive substring match). Useful for narrowing results when the category is uncertain.
treasury_query_datasetQuery any Treasury Fiscal Data endpoint by path, field list, filters, sort, and page. Call treasury_list_datasets first to get the correct endpoint path and exact field names — a typo in either causes a 400. Filter syntax: each condition is { field, operator, value } where ope...7 params

Query any Treasury Fiscal Data endpoint by path, field list, filters, sort, and page. Call treasury_list_datasets first to get the correct endpoint path and exact field names — a typo in either causes a 400. Filter syntax: each condition is { field, operator, value } where ope...

Parameters* required
canvas_idstring
Set any non-empty value to stage this page as a DataCanvas table for SQL analysis — the value only requests staging; the server picks the table name. The assigned name (df_XXXXX_XXXXX) comes back i...
endpoint*string
Endpoint path returned by treasury_list_datasets (e.g., "/v2/accounting/od/debt_to_penny"). Include the leading slash.
fieldsarray
Fields to return. Omit to return all fields. Specify field names exactly as listed by treasury_list_datasets — a typo causes a 400.
filtersarray
Filter conditions (ANDed together). Multiple filters on different fields are combined in one filter= parameter.
page_numberinteger
Page to fetch (1-indexed). Check total_pages in the response to know if more pages exist.default: 1
page_sizeinteger
Rows per page. Default 100. Raise to 10000 to minimize round trips for small datasets. For large time-series pulls, use canvas_id with treasury_dataframe_query instead.default: 100
sortstring
Sort expression: field name optionally prefixed with "-" for descending (e.g., "-record_date" for newest-first).
treasury_get_debtFetch national debt (Debt to the Penny) — total public debt outstanding broken into publicly-held debt and intragovernmental holdings. Three modes: "latest" returns the most recent business day's record; "date" returns the record for a specific date (must be a business day — t...5 params

Fetch national debt (Debt to the Penny) — total public debt outstanding broken into publicly-held debt and intragovernmental holdings. Three modes: "latest" returns the most recent business day's record; "date" returns the record for a specific date (must be a business day — t...

Parameters* required
canvas_idstring
Set any non-empty value to stage mode=series results as a DataCanvas table for SQL analysis — the value only requests staging; the server picks the table name. Staging also happens on its own when...
datestring
ISO 8601 date (YYYY-MM-DD) for mode=date. Must be a business day; the API only records debt on days the market is open.
end_datestring
ISO 8601 end date for mode=series (inclusive). Defaults to today.
modestring
"latest" returns the most recent day's record. "date" returns the record for a specific date. "series" returns a date range — use with start_date and end_date.one of latest · date · seriesdefault: latest
start_datestring
ISO 8601 start date for mode=series (inclusive). Fiscal Data has daily debt records back to 1993-04-01.
treasury_get_interest_ratesAverage interest rates Treasury pays on its outstanding securities by security type. Answers "what is the government's cost of borrowing?" Covers every type Treasury reports — marketable issues, non-marketable series, and the aggregate totals — and which types it reports chang...5 params

Average interest rates Treasury pays on its outstanding securities by security type. Answers "what is the government's cost of borrowing?" Covers every type Treasury reports — marketable issues, non-marketable series, and the aggregate totals — and which types it reports chang...

Parameters* required
canvas_idstring
Set any non-empty value to stage mode=series results as a DataCanvas table for SQL analysis — the value only requests staging; the server picks the table name. Staging also happens on its own when...
end_datestring
ISO 8601 end date for mode=series. Defaults to today.
modestring
"latest" returns the most recent month's rates. "series" returns a time range.one of latest · seriesdefault: latest
security_typestring
Filter to one security type, matched exactly against the security_desc field — full case and punctuation, as in "Treasury Inflation-Protected Securities (TIPS)". Omit for every type in the period,...
start_datestring
ISO 8601 start date for mode=series (YYYY-MM-DD, must be end-of-month for meaningful results).
treasury_get_exchange_ratesOfficial Treasury reporting exchange rates for ~165 countries — the rates US federal agencies are required to use when converting foreign currency to USD for official reporting. Published quarterly (March 31, June 30, Sep 30, Dec 31); mode "latest" returns the most recently pu...5 params

Official Treasury reporting exchange rates for ~165 countries — the rates US federal agencies are required to use when converting foreign currency to USD for official reporting. Published quarterly (March 31, June 30, Sep 30, Dec 31); mode "latest" returns the most recently pu...

Parameters* required
canvas_idstring
Set any non-empty value to stage mode=series results as a DataCanvas table for SQL analysis — the value only requests staging; the server picks the table name. Staging also happens on its own when...
countriesarray
Filter to specific countries by exact country name (e.g., ["Japan", "Germany", "France"]). Case-sensitive, matches the "country" field. Omit for every country in the quarter (~165).
end_datestring
ISO 8601 end date for mode=series.
modestring
"latest" returns the most recently published quarter's rates. "series" returns a date range of quarterly reports.one of latest · seriesdefault: latest
start_datestring
ISO 8601 start date for mode=series. Rates are published end-of-quarter (March 31, June 30, Sep 30, Dec 31).
treasury_dataframe_describeList DataCanvas dataframes materialized by treasury_query_dataset, treasury_get_debt, treasury_get_interest_rates, and treasury_get_exchange_rates. Each entry surfaces source tool, query parameters, creation/expiry timestamps, row count, and column schema. Use this tool before...1 params

List DataCanvas dataframes materialized by treasury_query_dataset, treasury_get_debt, treasury_get_interest_rates, and treasury_get_exchange_rates. Each entry surfaces source tool, query parameters, creation/expiry timestamps, row count, and column schema. Use this tool before...

Parameters* required
namestring
Optional dataframe table name (df_XXXXX_XXXXX) to describe a single dataframe. Omit to list all active dataframes.
treasury_dataframe_queryRun a single-statement SELECT against DataCanvas dataframes registered by treasury_query_dataset, treasury_get_debt, treasury_get_interest_rates, and treasury_get_exchange_rates. Read-only: writes, DDL, DROP, COPY, PRAGMA, ATTACH, and external-file table functions are rejected...4 params

Run a single-statement SELECT against DataCanvas dataframes registered by treasury_query_dataset, treasury_get_debt, treasury_get_interest_rates, and treasury_get_exchange_rates. Read-only: writes, DDL, DROP, COPY, PRAGMA, ATTACH, and external-file table functions are rejected...

Parameters* required
previewinteger
Rows in the immediate response. Defaults to row_limit and may not exceed it. Set lower when using register_as.
register_asstring
Persist the result as a new dataframe under this exact name, to chain analyses. The name is used verbatim — any name works, and a df_ prefix keeps it consistent with the tables the data tools mint....
row_limitinteger
Hard cap on rows the query may produce. Default 1000, max 10000. A query matching more rows than this stops at the cap and row_count_capped comes back true — raise it, or use register_as to materia...default: 1000
sql*string
Single-statement SELECT against df_<id> tables. All values in Treasury dataframes are VARCHAR (strings) per the API contract — CAST to DECIMAL or DATE for arithmetic and date comparisons. Example:...

Sponsors

Configuration

TREASURY_DATAFRAME_DROP_ENABLEDdefault: false

Enable treasury_dataframe_drop to delete staged dataframes. Requires CANVAS_PROVIDER_TYPE=duckdb.

CANVAS_PROVIDER_TYPEdefault: duckdb

Canvas engine for DataCanvas SQL tools. Set to 'duckdb' to enable treasury_dataframe_* tools. Set to 'none' to disable.

MCP_LOG_LEVELdefault: info

Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').

MCP_TRANSPORT_TYPEdefault: http

Selects the HTTP transport.

MCP_HTTP_HOSTdefault: 127.0.0.1

The hostname for the HTTP server.

MCP_HTTP_PORTdefault: 3010

The port to run the HTTP server on.

MCP_HTTP_ENDPOINT_PATHdefault: /mcp

The endpoint path for the MCP server.

MCP_AUTH_MODEdefault: none

Authentication mode to use: 'none', 'jwt', or 'oauth'.

Readme

@cyanheads/treasury-fiscaldata-mcp-server

Query US Treasury national debt, interest rates, exchange rates, and fiscal datasets via MCP.

8 Tools · dataframe drop is opt-in

Details

Repository
github.com/cyanheads/treasury-fiscaldata-mcp-server
Package
@cyanheads/treasury-fiscaldata-mcp-server
Transport
STDIO, HTTP
Registry
MCP registry, active
Resources
1
Tools verified
Nov 6, 2026

More from cyanheads