@allratestoday/mcp-server 0.7.3 → 0.7.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 +8 -7
- package/dist/client.d.ts +1 -1
- package/dist/client.js +8 -5
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ Install it with no configuration at all and it starts, connects, and answers:
|
|
|
45
45
|
| `get_official_rates` | ✅ | Latest **official table** (or one pair) published by any of them. A dated table needs the key. |
|
|
46
46
|
| `get_reference_rate` | ✅ | The **Daily Reference Rate**: one never-revised table per business day, fixed at 16:00 London. A past date needs the key. |
|
|
47
47
|
| `request_trial_key` | ✅ | Self-issues a 100-call, 7-day key with no account and adopts it for the session. |
|
|
48
|
-
| `get_historical_rates` | 🔑 | Returns one sentence explaining how to get a
|
|
48
|
+
| `get_historical_rates` | 🔑 | Returns one sentence explaining how to get a key. Needs a paid plan. |
|
|
49
49
|
| `get_rates_authenticated` | 🔑 | Same. |
|
|
50
50
|
|
|
51
51
|
The keyless path reads the open, edge-cached `/api/open/central-bank/ecb`
|
|
@@ -53,9 +53,10 @@ endpoint — no upstream cost, no rate limit to trip over, nothing to sign up fo
|
|
|
53
53
|
|
|
54
54
|
## 🔑 Get your API key (free)
|
|
55
55
|
|
|
56
|
-
A key unlocks **real-time mid-market rates across 160+ currencies
|
|
57
|
-
|
|
58
|
-
development and personal use — **no credit card required**.
|
|
56
|
+
A key unlocks **real-time mid-market rates across 160+ currencies** and
|
|
57
|
+
multi-target lookups. The free tier (300 requests, one-time) is enough for
|
|
58
|
+
development and personal use — **no credit card required**. Historical series
|
|
59
|
+
and point-in-time lookups need a paid plan from €4.99/month.
|
|
59
60
|
|
|
60
61
|
1. Register at [allratestoday.com/register](https://allratestoday.com/register) — 30 seconds
|
|
61
62
|
2. Verify your email
|
|
@@ -205,7 +206,7 @@ After configuring your client, test in this order:
|
|
|
205
206
|
- [`get_reference_rate`](#get_reference_rate) — the Daily Reference Rate, one fixed mid-market table per business day (16:00 London)
|
|
206
207
|
- [`request_trial_key`](#request_trial_key) — self-issue a 100-call, 7-day trial key, no account needed
|
|
207
208
|
|
|
208
|
-
`get_historical_rates` and `get_rates_authenticated` require `ALLRATES_API_KEY`; the other six work keyless.
|
|
209
|
+
`get_historical_rates` and `get_rates_authenticated` require `ALLRATES_API_KEY`; the other six work keyless. History (`get_historical_rates`, and `time` on `get_rates_authenticated`) needs a paid plan.
|
|
209
210
|
|
|
210
211
|
---
|
|
211
212
|
|
|
@@ -234,7 +235,7 @@ Current mid-market rate between two currencies.
|
|
|
234
235
|
|
|
235
236
|
### `get_historical_rates`
|
|
236
237
|
|
|
237
|
-
Time-series data points for a currency pair over a fixed period.
|
|
238
|
+
Time-series data points for a currency pair over a fixed period. Needs an API key on a paid plan (free and trial keys get a 403).
|
|
238
239
|
|
|
239
240
|
**Input**
|
|
240
241
|
|
|
@@ -284,7 +285,7 @@ Multiple targets in one call, with optional historical timestamp or grouping win
|
|
|
284
285
|
|---|---|---|---|
|
|
285
286
|
| `source` | string | yes | Source currency code |
|
|
286
287
|
| `target` | string | yes | One or more codes, comma-separated (`EUR,GBP,JPY`) |
|
|
287
|
-
| `time` | string (ISO 8601) | no | Historical point in time |
|
|
288
|
+
| `time` | string (ISO 8601) | no | Historical point in time (paid plans) |
|
|
288
289
|
| `group` | string | no | One of `hour`, `day`, `week`, `month` |
|
|
289
290
|
|
|
290
291
|
**Example call**
|
package/dist/client.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class AllRatesTodayError extends Error {
|
|
|
14
14
|
* rather than a bare 401.
|
|
15
15
|
*/
|
|
16
16
|
export declare class NeedsKeyError extends AllRatesTodayError {
|
|
17
|
-
constructor(what: string);
|
|
17
|
+
constructor(what: string, paid?: boolean);
|
|
18
18
|
}
|
|
19
19
|
export declare class AllRatesTodayClient {
|
|
20
20
|
private apiKey?;
|
package/dist/client.js
CHANGED
|
@@ -16,8 +16,11 @@ export class AllRatesTodayError extends Error {
|
|
|
16
16
|
* rather than a bare 401.
|
|
17
17
|
*/
|
|
18
18
|
export class NeedsKeyError extends AllRatesTodayError {
|
|
19
|
-
constructor(what) {
|
|
20
|
-
super(
|
|
19
|
+
constructor(what, paid = false) {
|
|
20
|
+
super((paid
|
|
21
|
+
? `${what} needs an AllRatesToday API key on a paid plan (from €4.99/month, ` +
|
|
22
|
+
'https://allratestoday.com/pricing). Free and trial keys get latest rates only. Get a key at '
|
|
23
|
+
: `${what} needs an AllRatesToday API key. The free tier covers it — sign up at `) +
|
|
21
24
|
'https://allratestoday.com/register (no card, under a minute), then set ALLRATES_API_KEY ' +
|
|
22
25
|
"in this MCP server's config and restart. Without a key the server still answers " +
|
|
23
26
|
'get_exchange_rate for ~30 major currencies (official ECB daily reference rate), ' +
|
|
@@ -97,7 +100,7 @@ export class AllRatesTodayClient {
|
|
|
97
100
|
const pair = { source: params.source?.toUpperCase(), target: params.target?.toUpperCase() };
|
|
98
101
|
if (params.date) {
|
|
99
102
|
if (this.keyless)
|
|
100
|
-
return Promise.reject(new NeedsKeyError(`The reference-rate table for ${params.date}
|
|
103
|
+
return Promise.reject(new NeedsKeyError(`The reference-rate table for ${params.date}`, true));
|
|
101
104
|
return this.request(`/v1/reference-rate/${encodeURIComponent(params.date)}`, pair);
|
|
102
105
|
}
|
|
103
106
|
return this.request('/open/reference-rate', pair);
|
|
@@ -160,7 +163,7 @@ export class AllRatesTodayClient {
|
|
|
160
163
|
}
|
|
161
164
|
getHistoricalRates(source, target, period = '7d') {
|
|
162
165
|
if (this.keyless)
|
|
163
|
-
return Promise.reject(new NeedsKeyError('Historical time-series'));
|
|
166
|
+
return Promise.reject(new NeedsKeyError('Historical time-series', true));
|
|
164
167
|
return this.request('/historical-rates', { source, target, period });
|
|
165
168
|
}
|
|
166
169
|
getAuthenticatedRates(params) {
|
|
@@ -188,7 +191,7 @@ export class AllRatesTodayClient {
|
|
|
188
191
|
const pair = { source: params.source?.toUpperCase(), target: params.target?.toUpperCase() };
|
|
189
192
|
if (this.keyless) {
|
|
190
193
|
if (params.date)
|
|
191
|
-
return Promise.reject(new NeedsKeyError(`The ${code} table for ${params.date}
|
|
194
|
+
return Promise.reject(new NeedsKeyError(`The ${code} table for ${params.date}`, true));
|
|
192
195
|
return this.request(`/open/central-bank/${encodeURIComponent(code)}`, pair);
|
|
193
196
|
}
|
|
194
197
|
return this.request(`/v1/central-bank/${encodeURIComponent(code)}/${params.date ?? 'latest'}`, pair);
|
package/dist/index.js
CHANGED
|
@@ -48,8 +48,8 @@ async function main() {
|
|
|
48
48
|
' • get_reference_rate — Daily Reference Rate, one fixed table per business day (16:00 London)',
|
|
49
49
|
' • request_trial_key — self-issue a 100-call, 7-day key without an account',
|
|
50
50
|
'',
|
|
51
|
-
' Needs a free API key (real-time mid-market rates for 160+ currencies
|
|
52
|
-
'
|
|
51
|
+
' Needs a free API key (real-time mid-market rates for 160+ currencies and',
|
|
52
|
+
' multi-target lookups). Historical series and point-in-time lookups need a paid plan:',
|
|
53
53
|
' 1. https://allratestoday.com/register — free tier, no card, under a minute',
|
|
54
54
|
' 2. Add to this server\'s MCP config: "env": { "ALLRATES_API_KEY": "art_live_..." }',
|
|
55
55
|
'',
|
|
@@ -84,7 +84,7 @@ async function main() {
|
|
|
84
84
|
});
|
|
85
85
|
server.registerTool('get_historical_rates', {
|
|
86
86
|
title: 'Get historical rate time-series',
|
|
87
|
-
description: "Use this for fixed-window time-series questions like 'how has EUR/USD moved this week', 'show me the last month of GBP/JPY', or 'chart 1-year history of AUD/USD'. Returns { source, target, period, data: [{ date, rate, timestamp }, ...] } — sampling is fixed per period (1d=hourly, 7d/30d=daily, 1y=weekly) and the window always ends NOW. For a specific past datetime use get_rates_authenticated with `time`. For a single live rate use get_exchange_rate.",
|
|
87
|
+
description: "Use this for fixed-window time-series questions like 'how has EUR/USD moved this week', 'show me the last month of GBP/JPY', or 'chart 1-year history of AUD/USD'. Returns { source, target, period, data: [{ date, rate, timestamp }, ...] } — sampling is fixed per period (1d=hourly, 7d/30d=daily, 1y=weekly) and the window always ends NOW. Needs an API key on a paid plan; free and trial keys get a 403. For a specific past datetime use get_rates_authenticated with `time`. For a single live rate use get_exchange_rate.",
|
|
88
88
|
inputSchema: {
|
|
89
89
|
source: ccy,
|
|
90
90
|
target: ccy,
|
|
@@ -115,7 +115,7 @@ async function main() {
|
|
|
115
115
|
});
|
|
116
116
|
server.registerTool('get_rates_authenticated', {
|
|
117
117
|
title: 'Get multi-target or point-in-time rates',
|
|
118
|
-
description: "Use this for (a) one source against multiple targets in a single call ('USD vs EUR, GBP, JPY'), or (b) the rate at a specific past datetime ('EUR/USD at 2025-03-14T12:00Z'), optionally bucketed by hour/day/week/month. Returns { rates: [{ rate, source, target, time }, ...] } — one row per target × time bucket. For a single live pair use get_exchange_rate. For fixed lookback windows (1d/7d/30d/1y ending now) use get_historical_rates.",
|
|
118
|
+
description: "Use this for (a) one source against multiple targets in a single call ('USD vs EUR, GBP, JPY'), or (b) the rate at a specific past datetime ('EUR/USD at 2025-03-14T12:00Z'), optionally bucketed by hour/day/week/month. Returns { rates: [{ rate, source, target, time }, ...] } — one row per target × time bucket. Multi-target latest rates work on any key; a past datetime (`time`) needs a paid plan. For a single live pair use get_exchange_rate. For fixed lookback windows (1d/7d/30d/1y ending now) use get_historical_rates.",
|
|
119
119
|
inputSchema: {
|
|
120
120
|
source: ccy,
|
|
121
121
|
target: ccyList,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allratestoday/mcp-server",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"mcpName": "io.github.cahthuranag/mcp-server",
|
|
5
5
|
"description": "MCP server for AllRatesToday — let AI coding tools (Claude Code, Cursor, Claude Desktop) fetch real-time and historical currency exchange rates.",
|
|
6
6
|
"keywords": [
|