MCP
Connect an agent to Bonds API
Seven tools for sovereign yields, spreads, and curves. The server is
https://mcp.bonds-api.com/mcp.
Without a credential, initialize and tools/list answer 401 so the client knows auth is required.
That is not a browser login.
Tools
-
latestGet the latest bond yields for specified countries and maturities, with the session date, currency, source, and the daily, weekly, monthly and annual change of each series. Maps to GET /api/v1/latest.
-
historicalGet the bond yield for a specific country, maturity, and date. On a weekend or holiday it returns the last session that is still current: up to 4 days back for a daily series, 2 months for a monthly one. date is the session returned and requested_date is the date you asked for. Maps to GET /api/v1/historical.
-
timeseriesGet daily closes over a date range. Ask for several maturities of one country, or one maturity across several countries, in a single call (up to 80 series). Maps to GET /api/v1/timeseries.
-
spreadCalculate the yield spread between a country and a benchmark. Both legs use the last close they share; country_date and benchmark_date say which closes were used. Maps to GET /api/v1/spread.
-
curveGet the full yield curve for a country (all available maturities). Maps to GET /api/v1/curve.
-
intradayGet the intraday yield snapshots stored for a country, maturity, and date. Professional plan. Sources are worldgovbonds, investing.com, tradingeconomics, and us_treasury. The number of prints depends on what was stored that day. Maps to GET /api/v1/intraday.
-
fluctuationGet yield change, min, max, and percentage change over a date range. Unknown codes are listed in unsupported_countries, and known countries with no data in countries_without_data. Maps to GET /api/v1/fluctuation.
-
countriesList every country in the catalog with the series it actually has: maturity, first and last date, daily or monthly frequency, status (active, stale, or discontinued once a series has not closed for a year) and source. A listed country with no yields comes back with an empty series list. Maps to GET /api/v1/countries.
-
maturitiesThe same coverage grouped by maturity: which countries publish each tenor, since when, and from which source. Maps to GET /api/v1/maturities.
-
curve-spreadsThe 3M-10Y and 5s30s slopes of a country curve, in percentage points and basis points. A slope whose leg is missing is listed in missing. Maps to GET /api/v1/curve-spreads.
-
interpolatedA yield for any maturity inside the curve, linear in months between the two stored tenors around it. A stored tenor comes back as is; a maturity outside the curve is a 404 (no extrapolation). Maps to GET /api/v1/interpolated.
-
discount-curveDiscount factors, zero rates and one-year forwards bootstrapped from the annual par yields, starting at 1Y with annual compounding. The first missing year stops the bootstrap; later tenors are listed in skipped. Maps to GET /api/v1/discount-curve.
-
billsOn-the-run US Treasury bill quotes by term, with CUSIP, discount rate, yield and maturity date. Terms: 4W, 6W, 8W, 13W, 17W, 26W, 52W. The 1M of /curve remains the constant-maturity rate. Maps to GET /api/v1/bills.
-
auctionsUS Treasury auction results with CUSIP, awarded rate or yield, price, bid-to-cover and offering amount. Without a date it returns the newest auction date. TIPS carry inflation_linked: true. Maps to GET /api/v1/auctions.
-
real-yieldsUS Treasury real (TIPS) par yields for 5Y, 7Y, 10Y, 20Y and 30Y. They are a separate curve and never mix with the nominal yields. Maps to GET /api/v1/real-yields.
-
breakevensBreakeven inflation: the nominal Treasury yield minus the real yield on the same day, for 5Y, 7Y, 10Y, 20Y and 30Y. A day missing either leg has no breakeven. Maps to GET /api/v1/breakevens.
Authentication
Two credentials work. There is no browser login and no public client ID to paste.
- API key. Create one after register, on API keys. Send it as
X-API-Key: YOUR_API_KEY. A raw key inAuthorization: Beareris rejected. - OAuth client credentials.
POST https://bonds-api.com/oauth/tokenwithgrant_type=client_credentials.client_idis shown next to the key;client_secretis the key. The response is a one-hour access token. Send that token, and only that token, asAuthorization: Bearer.
?apikey= on the MCP URL is accepted and forwarded as X-API-Key, but Claude Desktop and claude.ai strip query credentials from the saved connector URL. Do not use npx or mcp-remote.
Claude
- Settings → Connectors → Add custom connector.
- Name:
Bonds API. Remote server URL:https://mcp.bonds-api.com/mcp. No key in the URL. - Claude will notice the 401 and may offer to connect. There is no Bonds login screen behind that button, and no client ID to fill in. Use Claude Code (or Cursor) to send
X-API-Key.
claude mcp add --transport http bonds-api https://mcp.bonds-api.com/mcp --header "X-API-Key: YOUR_API_KEY"
Cursor
Cursor Settings → MCP, or ~/.cursor/mcp.json. Header, not query string.
{
"mcpServers": {
"bonds-api": {
"url": "https://mcp.bonds-api.com/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
ChatGPT
Settings → Connectors → custom MCP connector, remote URL https://mcp.bonds-api.com/mcp.
Do not proxy this endpoint through the OpenAI API.
A connector that only knows browser OAuth cannot attach an X-API-Key header; use Cursor or Claude Code for keyed calls.
FAQ
Why does initialize return 401? So clients know a credential is required before listing tools. tools/call does not 401: a missing key comes back as a tool error.
Does a call count against my quota? Yes. Each tool call is one REST request.
Discovery: /.well-known/mcp.json. Token details: /auth.md.