@allratestoday/mcp-server 0.3.2 → 0.3.3
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 +18 -38
- package/dist/client.js +1 -1
- package/dist/index.js +7 -7
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Realtime Exchange Rate MCP Server
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@allratestoday/mcp-server)
|
|
4
4
|
[](https://www.npmjs.com/package/@allratestoday/mcp-server)
|
|
@@ -9,7 +9,7 @@ English | [简体中文](./README-zh-CN.md)
|
|
|
9
9
|
|
|
10
10
|
> Give your AI coding assistant a live window into the foreign-exchange market.
|
|
11
11
|
|
|
12
|
-
A Model Context Protocol server that lets **Claude Code**, **Cursor**, **Claude Desktop**, **Windsurf**, and any other MCP-compatible client fetch real-time currency rates, historical data, and multi-currency lookups
|
|
12
|
+
A Model Context Protocol server that lets **Claude Code**, **Cursor**, **Claude Desktop**, **Windsurf**, and any other MCP-compatible client fetch real-time currency rates, historical data, and multi-currency lookups.
|
|
13
13
|
|
|
14
14
|
After installation, your assistant can answer questions like:
|
|
15
15
|
|
|
@@ -35,7 +35,6 @@ After installation, your assistant can answer questions like:
|
|
|
35
35
|
- [Verify it works](#verify-it-works)
|
|
36
36
|
- [Tools reference](#tools-reference)
|
|
37
37
|
- [Environment variables](#environment-variables)
|
|
38
|
-
- [Plans and limits](#plans-and-limits)
|
|
39
38
|
- [Troubleshooting](#troubleshooting)
|
|
40
39
|
- [Error reference](#error-reference)
|
|
41
40
|
- [FAQ](#faq)
|
|
@@ -52,7 +51,6 @@ After installation, your assistant can answer questions like:
|
|
|
52
51
|
|---|---|
|
|
53
52
|
| **Currencies** | 150+ ISO 4217 codes, all major and most exotics |
|
|
54
53
|
| **Update frequency** | Mid-market rates refresh every ~60 seconds |
|
|
55
|
-
| **Data source** | Tier-1 financial data providers (Reuters / Refinitiv-class) |
|
|
56
54
|
| **Historical depth** | Up to 1 year via `1d` / `7d` / `30d` / `1y` granularity |
|
|
57
55
|
| **Tools exposed** | 4 — `get_exchange_rate`, `get_historical_rates`, `get_rates_authenticated`, `list_currencies` |
|
|
58
56
|
| **Transport** | stdio (subprocess), MCP 1.x compatible |
|
|
@@ -62,14 +60,14 @@ After installation, your assistant can answer questions like:
|
|
|
62
60
|
|
|
63
61
|
## Get an API key (required)
|
|
64
62
|
|
|
65
|
-
The server **will not start** without a valid `ALLRATES_API_KEY`.
|
|
63
|
+
The server **will not start** without a valid `ALLRATES_API_KEY`. Rates are served by [AllRatesToday](https://allratestoday.com); a free key is enough for development and personal use.
|
|
66
64
|
|
|
67
|
-
1. Register at [allratestoday.com/register](https://allratestoday.com/register)
|
|
65
|
+
1. Register at [allratestoday.com/register](https://allratestoday.com/register)
|
|
68
66
|
2. Verify your email
|
|
69
67
|
3. Copy your key from the dashboard (format: `art_live_xxxxx`)
|
|
70
68
|
4. Use it as `ALLRATES_API_KEY` in the configs below
|
|
71
69
|
|
|
72
|
-
If
|
|
70
|
+
If the key is missing, the server prints clear registration instructions on stderr and exits with code 1.
|
|
73
71
|
|
|
74
72
|
---
|
|
75
73
|
|
|
@@ -205,7 +203,7 @@ After configuring your client, test in this order:
|
|
|
205
203
|
|
|
206
204
|
## Tools reference
|
|
207
205
|
|
|
208
|
-
All four tools require
|
|
206
|
+
All four tools require an API key.
|
|
209
207
|
|
|
210
208
|
### `get_exchange_rate`
|
|
211
209
|
|
|
@@ -334,26 +332,13 @@ You set these in your MCP client's config (in the `env` block) — not in your s
|
|
|
334
332
|
|
|
335
333
|
---
|
|
336
334
|
|
|
337
|
-
## Plans and limits
|
|
338
|
-
|
|
339
|
-
| Plan | Monthly requests | Price |
|
|
340
|
-
|---|---|---|
|
|
341
|
-
| **Free** | 300 | €0 |
|
|
342
|
-
| **Small** | 5,000 | €4.99/mo |
|
|
343
|
-
| **Medium** | 10,000 | €9.99/mo |
|
|
344
|
-
| **Large** | 100,000 | €49.99/mo |
|
|
345
|
-
|
|
346
|
-
Full pricing at [allratestoday.com/pricing](https://allratestoday.com/pricing). All plans include the same currency coverage and historical depth — only the request quotas differ.
|
|
347
|
-
|
|
348
|
-
---
|
|
349
|
-
|
|
350
335
|
## Troubleshooting
|
|
351
336
|
|
|
352
337
|
| Symptom | Likely cause | Fix |
|
|
353
338
|
|---|---|---|
|
|
354
339
|
| Client shows "MCP server failed to start" or red dot | `ALLRATES_API_KEY` not set or invalid | Verify the key in your client config; check it matches the dashboard |
|
|
355
|
-
| Tools show but every call returns "Invalid
|
|
356
|
-
| Tools return "
|
|
340
|
+
| Tools show but every call returns "Invalid API key" | Key is malformed (missing prefix, truncated, or revoked) | Copy a fresh key from the dashboard |
|
|
341
|
+
| Tools return "API quota exceeded" | Plan request limit hit | Wait until next month or upgrade plan |
|
|
357
342
|
| Historical tool returns "Bad request" | Invalid period or unknown currency code | Period must be `1d`/`7d`/`30d`/`1y`; codes must be 3 letters |
|
|
358
343
|
| Server starts but tools never appear in client | Client didn't reload after config change | Fully quit (not just close) and reopen the client |
|
|
359
344
|
| `npx` runs but hangs forever | The server is waiting for an MCP client to connect — this is normal when run from a shell | Don't run from a shell; let your MCP client launch it |
|
|
@@ -378,9 +363,9 @@ The server maps API errors to clear, actionable messages.
|
|
|
378
363
|
|---|---|---|
|
|
379
364
|
| 200 | Success | (rate returned) |
|
|
380
365
|
| 400 | Bad request — usually unknown currency code | `Bad request — possibly an unknown currency code` |
|
|
381
|
-
| 401 | Invalid or missing API key | `Invalid
|
|
382
|
-
| 429 | Quota exceeded | `
|
|
383
|
-
| 5xx |
|
|
366
|
+
| 401 | Invalid or missing API key | `Invalid API key` |
|
|
367
|
+
| 429 | Quota exceeded | `API quota exceeded` |
|
|
368
|
+
| 5xx | Upstream server-side issue | `HTTP 5xx — <upstream message>` |
|
|
384
369
|
|
|
385
370
|
The LLM will surface these messages in its response, so a user prompt that hits a 429 results in the assistant saying *"the API quota has been exceeded — please try again next month or upgrade your plan."*
|
|
386
371
|
|
|
@@ -388,23 +373,20 @@ The LLM will surface these messages in its response, so a user prompt that hits
|
|
|
388
373
|
|
|
389
374
|
## FAQ
|
|
390
375
|
|
|
391
|
-
**Is the free plan really enough for normal use?**
|
|
392
|
-
Yes for personal/dev use. 300 requests/month covers ~10 questions per day. Heavy interactive use, multiple chat sessions per day, or running the server in production should consider the paid tiers.
|
|
393
|
-
|
|
394
376
|
**Do you store my conversation or query data?**
|
|
395
|
-
No. Only your API key and the request parameters (source, target, period, time) are sent to
|
|
377
|
+
No. Only your API key and the request parameters (source, target, period, time) are sent to the upstream API — never the LLM's conversation context, sheet contents, or anything else.
|
|
396
378
|
|
|
397
379
|
**What happens to my API key?**
|
|
398
|
-
It's only sent as a `Bearer` token in the `Authorization` header on requests to the
|
|
380
|
+
It's only sent as a `Bearer` token in the `Authorization` header on requests to the upstream API. It's never logged or transmitted elsewhere.
|
|
399
381
|
|
|
400
382
|
**Why is my historical request slow on first call?**
|
|
401
|
-
Cold-start of `npx` (first run downloads the package) plus
|
|
383
|
+
Cold-start of `npx` (first run downloads the package) plus an initial upstream cache miss. Subsequent calls are fast (<200ms typically).
|
|
402
384
|
|
|
403
385
|
**Can I run this without npm/Node?**
|
|
404
386
|
Not currently — Node ≥18 is required. We've considered a standalone binary; if that matters to you, open an issue.
|
|
405
387
|
|
|
406
388
|
**Is there a self-hosted option?**
|
|
407
|
-
Yes, set `ALLRATES_BASE_URL` to your own
|
|
389
|
+
Yes, set `ALLRATES_BASE_URL` to point to your own instance.
|
|
408
390
|
|
|
409
391
|
**Does this work with ChatGPT?**
|
|
410
392
|
The Anthropic MCP standard works with any MCP-compatible client. ChatGPT Desktop has experimental MCP support; check OpenAI's docs for current status.
|
|
@@ -429,7 +411,7 @@ To watch and rebuild on changes during development:
|
|
|
429
411
|
npm run dev
|
|
430
412
|
```
|
|
431
413
|
|
|
432
|
-
To test against a local
|
|
414
|
+
To test against a local instance:
|
|
433
415
|
|
|
434
416
|
```bash
|
|
435
417
|
ALLRATES_BASE_URL=http://localhost:8080/api ALLRATES_API_KEY=test_key node dist/index.js
|
|
@@ -440,7 +422,7 @@ ALLRATES_BASE_URL=http://localhost:8080/api ALLRATES_API_KEY=test_key node dist/
|
|
|
440
422
|
```
|
|
441
423
|
src/
|
|
442
424
|
├── index.ts # MCP server, tool registration, request handlers
|
|
443
|
-
└── client.ts # HTTP client
|
|
425
|
+
└── client.ts # HTTP client + error mapping
|
|
444
426
|
dist/ # Compiled JS (gitignored)
|
|
445
427
|
server.json # MCP registry manifest
|
|
446
428
|
package.json # npm metadata, dependencies, scripts
|
|
@@ -451,7 +433,7 @@ package.json # npm metadata, dependencies, scripts
|
|
|
451
433
|
Issues and PRs welcome at [github.com/cahthuranag/realtime-exchange-rate-mcp](https://github.com/cahthuranag/realtime-exchange-rate-mcp). Before opening a PR:
|
|
452
434
|
|
|
453
435
|
1. `npm run build` should succeed with no errors
|
|
454
|
-
2. Test against a real
|
|
436
|
+
2. Test against a real API key (set in `ALLRATES_API_KEY`)
|
|
455
437
|
3. Update tool descriptions in `src/index.ts` if you change tool behavior
|
|
456
438
|
4. Update this README's "Tools reference" section if you add or rename a tool
|
|
457
439
|
|
|
@@ -469,10 +451,8 @@ See [GitHub Releases](https://github.com/cahthuranag/realtime-exchange-rate-mcp/
|
|
|
469
451
|
|
|
470
452
|
## Support
|
|
471
453
|
|
|
472
|
-
- **API issues**: [support@allratestoday.com](mailto:support@allratestoday.com)
|
|
473
454
|
- **Bug reports**: [github.com/cahthuranag/realtime-exchange-rate-mcp/issues](https://github.com/cahthuranag/realtime-exchange-rate-mcp/issues)
|
|
474
455
|
- **MCP questions**: [modelcontextprotocol.io](https://modelcontextprotocol.io) — protocol docs
|
|
475
|
-
- **Status / uptime**: [allratestoday.com](https://allratestoday.com) (status page in development)
|
|
476
456
|
|
|
477
457
|
---
|
|
478
458
|
|
package/dist/client.js
CHANGED
|
@@ -30,7 +30,7 @@ export class AllRatesTodayClient {
|
|
|
30
30
|
'User-Agent': USER_AGENT,
|
|
31
31
|
};
|
|
32
32
|
if (!this.apiKey) {
|
|
33
|
-
throw new AllRatesTodayError('
|
|
33
|
+
throw new AllRatesTodayError('API key is required. Get one at https://allratestoday.com/register, then set ALLRATES_API_KEY in your MCP config.');
|
|
34
34
|
}
|
|
35
35
|
headers['Authorization'] = `Bearer ${this.apiKey}`;
|
|
36
36
|
const res = await this.fetchImpl(url.toString(), { method: 'GET', headers });
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const CCY = {
|
|
|
12
12
|
const tools = [
|
|
13
13
|
{
|
|
14
14
|
name: 'get_exchange_rate',
|
|
15
|
-
description: 'Get the current mid-market exchange rate between two currencies. Returns a single rate number. Requires
|
|
15
|
+
description: 'Get the current mid-market exchange rate between two currencies. Returns a single rate number. Requires API key (ALLRATES_API_KEY).',
|
|
16
16
|
inputSchema: {
|
|
17
17
|
type: 'object',
|
|
18
18
|
additionalProperties: false,
|
|
@@ -25,7 +25,7 @@ const tools = [
|
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
name: 'get_historical_rates',
|
|
28
|
-
description: 'Get historical exchange-rate data points for a currency pair over a period. Periods: 1d (hourly), 7d (daily), 30d (daily), 1y (weekly). Requires
|
|
28
|
+
description: 'Get historical exchange-rate data points for a currency pair over a period. Periods: 1d (hourly), 7d (daily), 30d (daily), 1y (weekly). Requires API key (ALLRATES_API_KEY).',
|
|
29
29
|
inputSchema: {
|
|
30
30
|
type: 'object',
|
|
31
31
|
additionalProperties: false,
|
|
@@ -44,7 +44,7 @@ const tools = [
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
name: 'get_rates_authenticated',
|
|
47
|
-
description: 'Get rates with higher limits and multi-target support. Requires
|
|
47
|
+
description: 'Get rates with higher limits and multi-target support. Requires API key (ALLRATES_API_KEY). Supports comma-separated targets like "EUR,GBP,JPY".',
|
|
48
48
|
inputSchema: {
|
|
49
49
|
type: 'object',
|
|
50
50
|
additionalProperties: false,
|
|
@@ -70,7 +70,7 @@ const tools = [
|
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
name: 'list_currencies',
|
|
73
|
-
description: 'List all supported currencies with code, name, and symbol. Requires
|
|
73
|
+
description: 'List all supported currencies with code, name, and symbol. Requires API key (ALLRATES_API_KEY). Cached 24h upstream.',
|
|
74
74
|
inputSchema: { type: 'object', additionalProperties: false, properties: {} },
|
|
75
75
|
},
|
|
76
76
|
];
|
|
@@ -83,9 +83,9 @@ async function main() {
|
|
|
83
83
|
if (!apiKey) {
|
|
84
84
|
console.error([
|
|
85
85
|
'',
|
|
86
|
-
'
|
|
86
|
+
' This MCP server requires an API key.',
|
|
87
87
|
'',
|
|
88
|
-
' 1.
|
|
88
|
+
' 1. Get a free key at https://allratestoday.com/register',
|
|
89
89
|
' 2. Copy your API key from the dashboard',
|
|
90
90
|
' 3. Set ALLRATES_API_KEY in your MCP client config:',
|
|
91
91
|
'',
|
|
@@ -102,7 +102,7 @@ async function main() {
|
|
|
102
102
|
apiKey,
|
|
103
103
|
baseUrl: process.env.ALLRATES_BASE_URL,
|
|
104
104
|
});
|
|
105
|
-
const server = new Server({ name: '
|
|
105
|
+
const server = new Server({ name: 'realtime-exchange-rate-mcp', version: '0.3.2' }, { capabilities: { tools: {} } });
|
|
106
106
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
|
|
107
107
|
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
108
108
|
const { name, arguments: args = {} } = req.params;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allratestoday/mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"mcpName": "io.github.cahthuranag/realtime-exchange-rate-mcp",
|
|
5
|
-
"description": "MCP server
|
|
5
|
+
"description": "MCP server that lets AI coding tools (Claude Code, Cursor, Claude Desktop) fetch real-time and historical currency exchange rates.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mcp",
|
|
8
8
|
"model-context-protocol",
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
"cursor",
|
|
11
11
|
"currency",
|
|
12
12
|
"exchange-rate",
|
|
13
|
-
"forex"
|
|
14
|
-
"allratestoday"
|
|
13
|
+
"forex"
|
|
15
14
|
],
|
|
16
15
|
"license": "MIT",
|
|
17
|
-
"homepage": "https://
|
|
16
|
+
"homepage": "https://github.com/cahthuranag/realtime-exchange-rate-mcp",
|
|
18
17
|
"repository": {
|
|
19
18
|
"type": "git",
|
|
20
19
|
"url": "git+https://github.com/cahthuranag/realtime-exchange-rate-mcp.git"
|