@allratestoday/central-bank-mcp 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -11
- package/dist/banks.js +19 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +9 -5
- package/dist/index.js +6 -5
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Website: https://allratestoday.com/central-bank-rates-api/ · Hosted endpoint (n
|
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
[](https://modelcontextprotocol.io)
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
|
+
[](https://aiagentslisting.com/mcp/central-bank-mcp)
|
|
10
11
|
|
|
11
12
|
**Give your AI assistant the official exchange rates that compliance, tax, and accounting actually require. A Model Context Protocol server that lets Claude Code, Cursor, Claude Desktop, Windsurf, and any MCP-compatible client fetch published central-bank and tax-authority rates from 121 central banks and 3 tax authorities — ECB, Fed, Bank of Japan, HMRC, US Treasury, and more — via the [AllRatesToday API](https://allratestoday.com/central-bank-rates-api/).**
|
|
12
13
|
|
|
@@ -26,9 +27,9 @@ Everything this server returns is an **official published rate**: fixed once the
|
|
|
26
27
|
- 🏛️ **121 central banks + 3 tax authorities** — central banks (ECB, Fed, BOJ, SNB, RBI, …) plus tax authorities (HMRC, US Treasury, …), each served from its own published tables
|
|
27
28
|
- 📅 **Point-in-time correctness** — ask for any date; weekends and holidays roll back to the rate legally in force, and the response tells you which publication date applied
|
|
28
29
|
- 📊 **Cross-bank comparison** — one call returns every institution's rate for a pair, with min/max/median and spread stats
|
|
29
|
-
- 🧮 **Honest derivations** — pairs a bank doesn't publish directly are cross-computed only within that bank's own table and flagged `derived`; banks are never mixed
|
|
30
|
+
- 🧮 **Honest derivations** — with an API key, pairs a bank doesn't publish directly are cross-computed only within that bank's own table and flagged `derived`; banks are never mixed. Keyless serves only published pairs and their inverses
|
|
30
31
|
- 🔓 **Works with no API key** — installs and answers out of the box; the latest published table of every source is open
|
|
31
|
-
- 🧰 **
|
|
32
|
+
- 🧰 **Six focused tools** — small surface, easy for the model to use correctly
|
|
32
33
|
- 🔌 **Works everywhere MCP does** — stdio transport, MCP 1.x; Claude Code, Cursor, Claude Desktop, Windsurf, or any generic host
|
|
33
34
|
|
|
34
35
|
## 🔓 Keyless mode — what works with no setup
|
|
@@ -37,11 +38,11 @@ Install it with no configuration at all and it starts, connects, and answers:
|
|
|
37
38
|
|
|
38
39
|
| Tool | Keyless | What you get |
|
|
39
40
|
|---|---|---|
|
|
40
|
-
| `list_central_banks` | ✅ | Every covered institution, from a catalogue bundled with the package (no coverage dates). |
|
|
41
|
-
| `get_official_rates` | ✅ | The **latest published table** of any source, or one pair from it, with the publisher's own `rate_date`. |
|
|
42
|
-
| `get_official_rates` with a `date` | 🔑 | One sentence explaining
|
|
43
|
-
| `get_official_rate_history` | 🔑 | Same. |
|
|
44
|
-
| `compare_official_rates` | 🔑 |
|
|
41
|
+
| `list_central_banks` | ✅ | Every covered institution (121 central banks, 3 tax authorities and the composite), from a catalogue bundled with the package (no coverage dates). |
|
|
42
|
+
| `get_official_rates` | ✅ | The **latest published table** of any source, or one published pair (or its inverse) from it, with the publisher's own `rate_date`. Cross pairs need a key. |
|
|
43
|
+
| `get_official_rates` with a `date` | 🔑 | One sentence explaining that dated tables need a paid plan. |
|
|
44
|
+
| `get_official_rate_history` | 🔑 | Same (paid plan). |
|
|
45
|
+
| `compare_official_rates` | 🔑 | One sentence explaining how to get a free key. |
|
|
45
46
|
| `get_publication_calendar` | 🔑 | Same. |
|
|
46
47
|
| `request_trial_key` | ✅ | Self-issues a 100-call, 7-day key with no account and adopts it for the session. |
|
|
47
48
|
|
|
@@ -51,9 +52,9 @@ endpoint — free to use with a visible attribution link back to allratestoday.c
|
|
|
51
52
|
|
|
52
53
|
## 🔑 Get your API key (free)
|
|
53
54
|
|
|
54
|
-
A key adds
|
|
55
|
-
calendars
|
|
56
|
-
|
|
55
|
+
A free key adds cross-bank comparison, cross-computed pairs and publication
|
|
56
|
+
calendars — 300 lifetime calls, **no credit card required**. Dated (historical)
|
|
57
|
+
tables and time series need a paid plan: free and trial keys get a 403 for them.
|
|
57
58
|
|
|
58
59
|
1. Register at [allratestoday.com/register](https://allratestoday.com/register) — 30 seconds
|
|
59
60
|
2. Verify your email
|
|
@@ -80,7 +81,7 @@ Everything below still applies for other MCP clients.
|
|
|
80
81
|
|
|
81
82
|
## ☁️ Hosted endpoint — nothing to install
|
|
82
83
|
|
|
83
|
-
The same tools also run as a hosted **Streamable HTTP** MCP server
|
|
84
|
+
The same six tools also run as a hosted **Streamable HTTP** MCP server, together with the five tools of the sibling AllRatesToday server — eleven in total on the hosted endpoint (this npm package itself exposes six). Paste the URL into any client that supports remote MCP — Claude.ai and Claude Desktop connectors, ChatGPT, Cursor, VS Code, Codex, Gemini CLI:
|
|
84
85
|
|
|
85
86
|
```
|
|
86
87
|
https://allratestoday.com/api/mcp
|
package/dist/banks.js
CHANGED
|
@@ -106,6 +106,25 @@ export const BANK_CATALOG = [
|
|
|
106
106
|
{ "code": "boz", "name": "Bank of Zambia", "country": "Zambia", "home_ccy": "ZMW", "kind": "central_bank", "npm": "boz-exchange-rate" },
|
|
107
107
|
{ "code": "rbm", "name": "Reserve Bank of Malawi", "country": "Malawi", "home_ccy": "MWK", "kind": "central_bank", "npm": "rbm-exchange-rate" },
|
|
108
108
|
{ "code": "nbkr", "name": "National Bank of the Kyrgyz Republic", "country": "Kyrgyzstan", "home_ccy": "KGS", "kind": "central_bank", "npm": "nbkr-exchange-rate" },
|
|
109
|
+
{ "code": "lb", "name": "Bank of Lithuania", "country": "Lithuania", "home_ccy": "EUR", "kind": "central_bank", "npm": "bank-of-lithuania-exchange-rate" },
|
|
110
|
+
{ "code": "bcc", "name": "Banque Centrale du Congo", "country": "DR Congo", "home_ccy": "CDF", "kind": "central_bank", "npm": "banque-centrale-du-congo-exchange-rate" },
|
|
111
|
+
{ "code": "cbbd", "name": "Central Bank of Barbados", "country": "Barbados", "home_ccy": "BBD", "kind": "central_bank", "npm": "central-bank-of-barbados-exchange-rate" },
|
|
112
|
+
{ "code": "cbl", "name": "Central Bank of Libya", "country": "Libya", "home_ccy": "LYD", "kind": "central_bank", "npm": "central-bank-of-libya-exchange-rate" },
|
|
113
|
+
{ "code": "cbg", "name": "Central Bank of The Gambia", "country": "Gambia", "home_ccy": "GMD", "kind": "central_bank", "npm": "central-bank-of-the-gambia-exchange-rate" },
|
|
114
|
+
{ "code": "brh", "name": "Banque de la République d'Haïti", "country": "Haiti", "home_ccy": "HTG", "kind": "central_bank", "npm": "brh-exchange-rate" },
|
|
115
|
+
{ "code": "rma", "name": "Royal Monetary Authority of Bhutan", "country": "Bhutan", "home_ccy": "BTN", "kind": "central_bank", "npm": "rma-bhutan-exchange-rate" },
|
|
116
|
+
{ "code": "nbt", "name": "National Bank of Tajikistan", "country": "Tajikistan", "home_ccy": "TJS", "kind": "central_bank", "npm": "national-bank-of-tajikistan-exchange-rate" },
|
|
117
|
+
{ "code": "cbbz", "name": "Central Bank of Belize", "country": "Belize", "home_ccy": "BZD", "kind": "central_bank", "npm": "central-bank-of-belize-exchange-rate" },
|
|
118
|
+
{ "code": "rbf", "name": "Reserve Bank of Fiji", "country": "Fiji", "home_ccy": "FJD", "kind": "central_bank", "npm": "reserve-bank-of-fiji-exchange-rate" },
|
|
119
|
+
{ "code": "mma", "name": "Maldives Monetary Authority", "country": "Maldives", "home_ccy": "MVR", "kind": "central_bank", "npm": "maldives-monetary-authority-exchange-rate" },
|
|
120
|
+
{ "code": "bcm", "name": "Banque Centrale de Mauritanie", "country": "Mauritania", "home_ccy": "MRU", "kind": "central_bank", "npm": "banque-centrale-de-mauritanie-exchange-rate" },
|
|
121
|
+
{ "code": "rbz", "name": "Reserve Bank of Zimbabwe", "country": "Zimbabwe", "home_ccy": "ZWG", "kind": "central_bank", "npm": "reserve-bank-of-zimbabwe-exchange-rate" },
|
|
122
|
+
{ "code": "bon", "name": "Bank of Namibia", "country": "Namibia", "home_ccy": "NAD", "kind": "central_bank", "npm": "bank-of-namibia-exchange-rate" },
|
|
123
|
+
{ "code": "bfm", "name": "Central Bank of Madagascar (BFM)", "country": "Madagascar", "home_ccy": "MGA", "kind": "central_bank", "npm": "central-bank-of-madagascar-exchange-rate" },
|
|
124
|
+
{ "code": "cbt", "name": "Central Bank of Turkmenistan", "country": "Turkmenistan", "home_ccy": "TMT", "kind": "central_bank", "npm": "central-bank-of-turkmenistan-exchange-rate" },
|
|
125
|
+
{ "code": "bccu", "name": "Banco Central de Cuba", "country": "Cuba", "home_ccy": "CUP", "kind": "central_bank", "npm": "banco-central-de-cuba-exchange-rate" },
|
|
126
|
+
{ "code": "bsl", "name": "Bank of Sierra Leone", "country": "Sierra Leone", "home_ccy": "SLE", "kind": "central_bank", "npm": "bank-of-sierra-leone-exchange-rate" },
|
|
127
|
+
{ "code": "bcstp", "name": "Banco Central de São Tomé e Príncipe", "country": "São Tomé and Príncipe", "home_ccy": "STN", "kind": "central_bank", "npm": "bcstp-exchange-rate" },
|
|
109
128
|
{ "code": "hmrc", "name": "HM Revenue & Customs", "country": "United Kingdom", "home_ccy": "GBP", "kind": "tax", "npm": "hmrc-exchange-rate" },
|
|
110
129
|
{ "code": "bazg", "name": "Swiss Federal Office for Customs and Border Security", "country": "Switzerland", "home_ccy": "CHF", "kind": "tax", "npm": "bazg-exchange-rate" },
|
|
111
130
|
{ "code": "ustreasury", "name": "U.S. Department of the Treasury", "country": "United States", "home_ccy": "USD", "kind": "tax", "npm": "ustreasury-exchange-rate" },
|
package/dist/client.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class CentralBankApiError extends Error {
|
|
|
14
14
|
* instead of a bare 401.
|
|
15
15
|
*/
|
|
16
16
|
export declare class NeedsKeyError extends CentralBankApiError {
|
|
17
|
-
constructor(what: string);
|
|
17
|
+
constructor(what: string, paid?: boolean);
|
|
18
18
|
}
|
|
19
19
|
export interface CbRate {
|
|
20
20
|
base: string;
|
package/dist/client.js
CHANGED
|
@@ -17,9 +17,13 @@ export class CentralBankApiError extends Error {
|
|
|
17
17
|
* instead of a bare 401.
|
|
18
18
|
*/
|
|
19
19
|
export class NeedsKeyError extends CentralBankApiError {
|
|
20
|
-
constructor(what) {
|
|
21
|
-
super(`This lookup (${what}) needs an AllRatesToday API key.
|
|
22
|
-
|
|
20
|
+
constructor(what, paid = false) {
|
|
21
|
+
super(`This lookup (${what}) needs an AllRatesToday API key. ` +
|
|
22
|
+
(paid
|
|
23
|
+
? 'Dated tables and history series need a PAID plan (free and trial keys get a 403) — ' +
|
|
24
|
+
'see https://allratestoday.com/pricing, then set '
|
|
25
|
+
: 'The free tier covers it (300 lifetime calls) — sign up at ' +
|
|
26
|
+
'https://allratestoday.com/register (no card, under a minute), then set ') +
|
|
23
27
|
'ALLRATES_API_KEY in the MCP server config and restart. Without a key this server can ' +
|
|
24
28
|
'still return the latest published table for any source (get_official_rates) and the ' +
|
|
25
29
|
'source catalogue (list_central_banks).');
|
|
@@ -105,7 +109,7 @@ export class CentralBankClient {
|
|
|
105
109
|
url.searchParams.set(key, value);
|
|
106
110
|
}
|
|
107
111
|
if (!this.apiKey)
|
|
108
|
-
throw new NeedsKeyError(path);
|
|
112
|
+
throw new NeedsKeyError(path, /\/history$|\/\d{4}-\d{2}-\d{2}$/.test(path));
|
|
109
113
|
const headers = {
|
|
110
114
|
'Accept': 'application/json',
|
|
111
115
|
'User-Agent': `central-bank-mcp/${VERSION}`,
|
|
@@ -180,7 +184,7 @@ export class CentralBankClient {
|
|
|
180
184
|
// cost). A past date is not — that is the metered part.
|
|
181
185
|
if (this.keyless) {
|
|
182
186
|
if (opts.date)
|
|
183
|
-
return Promise.reject(new NeedsKeyError(`${bank} table for ${opts.date}
|
|
187
|
+
return Promise.reject(new NeedsKeyError(`${bank} table for ${opts.date}`, true));
|
|
184
188
|
return this.openRequest(`/open/central-bank/${encodeURIComponent(bank)}`, { source: opts.source, target: opts.target });
|
|
185
189
|
}
|
|
186
190
|
const path = `/v1/central-bank/${encodeURIComponent(bank)}/${opts.date ?? 'latest'}`;
|
package/dist/index.js
CHANGED
|
@@ -49,11 +49,12 @@ async function main() {
|
|
|
49
49
|
' • get_official_rates — the latest published table (any source)',
|
|
50
50
|
' • request_trial_key — self-issue a 100-call, 7-day key without an account',
|
|
51
51
|
'',
|
|
52
|
-
' Needs a free API key (
|
|
53
|
-
'
|
|
54
|
-
' 1. https://allratestoday.com/register — free tier, no card, under a minute',
|
|
52
|
+
' Needs a free API key (cross-bank compare, publication calendars):',
|
|
53
|
+
' 1. https://allratestoday.com/register — free tier (300 lifetime calls), no card',
|
|
55
54
|
' 2. Add to this server\'s MCP config: "env": { "ALLRATES_API_KEY": "art_live_..." }',
|
|
56
55
|
'',
|
|
56
|
+
' Needs a paid plan (dated tables, history series): https://allratestoday.com/pricing',
|
|
57
|
+
'',
|
|
57
58
|
].join('\n'));
|
|
58
59
|
}
|
|
59
60
|
const client = new CentralBankClient({
|
|
@@ -63,7 +64,7 @@ async function main() {
|
|
|
63
64
|
const server = new McpServer({ name: 'central-bank-mcp', version: VERSION });
|
|
64
65
|
server.registerTool('list_central_banks', {
|
|
65
66
|
title: 'List covered central banks & tax authorities',
|
|
66
|
-
description: "Call this FIRST when you need a bank code, or when the user asks 'which central banks do you cover?' or 'do you have rates from X?'. Returns { banks: [{ code, name, country, home_ccy, rate_types, latest date, ... }], disclaimer } for
|
|
67
|
+
description: "Call this FIRST when you need a bank code, or when the user asks 'which central banks do you cover?' or 'do you have rates from X?'. Returns { banks: [{ code, name, country, home_ccy, rate_types, latest date, ... }], disclaimer } for 121 central banks + 3 tax authorities (plus a composite) — central banks (ECB, Fed, BOJ, ...) plus tax authorities (HMRC, US Treasury, ...). The `code` field is what every other tool takes as its `bank` parameter. Cheap to call.",
|
|
67
68
|
inputSchema: {},
|
|
68
69
|
annotations: READ_ONLY,
|
|
69
70
|
}, async () => {
|
|
@@ -76,7 +77,7 @@ async function main() {
|
|
|
76
77
|
});
|
|
77
78
|
server.registerTool('get_official_rates', {
|
|
78
79
|
title: "Get a bank's official published rates",
|
|
79
|
-
description: "Use this for OFFICIAL rates a specific institution published — 'what is the ECB rate for USD?', 'Bank of Japan official rate on 2026-03-14', 'HMRC rate for invoicing'. These are the fixed rates in force for compliance, tax, customs, and accounting — NOT live market rates. Omit `date` for the newest published table; give `date` (paid plans) for the table in force on that day (weekends/holidays roll back to the last published date — the response's rate_date says which). Omit source/target for the bank's full table { rates: [{ base, quote, type, value }] }; give both for one pair — cross-computed via the bank's own home currency
|
|
80
|
+
description: "Use this for OFFICIAL rates a specific institution published — 'what is the ECB rate for USD?', 'Bank of Japan official rate on 2026-03-14', 'HMRC rate for invoicing'. These are the fixed rates in force for compliance, tax, customs, and accounting — NOT live market rates. Omit `date` for the newest published table; give `date` (paid plans) for the table in force on that day (weekends/holidays roll back to the last published date — the response's rate_date says which). Omit source/target for the bank's full table { rates: [{ base, quote, type, value }] }; give both for one pair — with an API key, pairs not directly published are cross-computed via the bank's own home currency and flagged `derived`; keyless serves only published pairs and their inverses. For live mid-market rates use the @allratestoday/mcp-server package instead.",
|
|
80
81
|
inputSchema: {
|
|
81
82
|
bank,
|
|
82
83
|
date: isoDate
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allratestoday/central-bank-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"mcpName": "com.allratestoday/central-bank-mcp",
|
|
5
5
|
"description": "MCP server for official central-bank and tax-authority exchange rates — let AI tools (Claude Code, Cursor, Claude Desktop) fetch published rates from 120+ institutions (ECB, Fed, HMRC, BOJ, ...) via the AllRatesToday API.",
|
|
6
6
|
"keywords": [
|
|
@@ -15,7 +15,15 @@
|
|
|
15
15
|
"tax",
|
|
16
16
|
"allratestoday",
|
|
17
17
|
"exchangerate",
|
|
18
|
-
"exchange rate"
|
|
18
|
+
"exchange rate",
|
|
19
|
+
"currency-api",
|
|
20
|
+
"currency-exchange-rates",
|
|
21
|
+
"forex-api",
|
|
22
|
+
"currency-conversion",
|
|
23
|
+
"currency-exchange",
|
|
24
|
+
"currency-rates",
|
|
25
|
+
"currency",
|
|
26
|
+
"forex"
|
|
19
27
|
],
|
|
20
28
|
"license": "MIT",
|
|
21
29
|
"homepage": "https://allratestoday.com/central-bank-rates-api/",
|