@allratestoday/mcp-server 0.1.1 → 0.3.0
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 +23 -15
- package/dist/client.d.ts +0 -12
- package/dist/client.js +6 -14
- package/dist/index.js +24 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# AllRatesToday MCP Server
|
|
2
2
|
|
|
3
|
+
English | [简体中文](./README-zh-CN.md)
|
|
4
|
+
|
|
3
5
|
MCP server that gives AI coding tools — **Claude Code**, **Cursor**, **Claude Desktop**, and any other Model Context Protocol client — real-time currency exchange rates, historical data, and financial news from [AllRatesToday](https://allratestoday.com).
|
|
4
6
|
|
|
5
7
|
Ask your assistant things like:
|
|
@@ -9,6 +11,17 @@ Ask your assistant things like:
|
|
|
9
11
|
- *"Convert 250 USD into CAD using a real rate."*
|
|
10
12
|
- *"List every supported currency."*
|
|
11
13
|
|
|
14
|
+
## Get an API key first (required)
|
|
15
|
+
|
|
16
|
+
The MCP server needs an AllRatesToday API key to start. **The free plan is enough** — 300 requests/month, no card required.
|
|
17
|
+
|
|
18
|
+
1. Register at [allratestoday.com/register](https://allratestoday.com/register) — takes 30 seconds
|
|
19
|
+
2. Verify your email
|
|
20
|
+
3. Copy your key from the dashboard — it looks like `art_live_xxxxx`
|
|
21
|
+
4. Set it as `ALLRATES_API_KEY` in your MCP client config (examples below)
|
|
22
|
+
|
|
23
|
+
The server will refuse to start without a key and print registration instructions in the console.
|
|
24
|
+
|
|
12
25
|
## Install
|
|
13
26
|
|
|
14
27
|
```bash
|
|
@@ -69,31 +82,26 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) o
|
|
|
69
82
|
|
|
70
83
|
Restart the app after editing.
|
|
71
84
|
|
|
72
|
-
##
|
|
73
|
-
|
|
74
|
-
1. Register at [allratestoday.com/register](https://allratestoday.com/register).
|
|
75
|
-
2. Verify your email.
|
|
76
|
-
3. Copy your key from the dashboard — it looks like `art_live_xxxxx`.
|
|
85
|
+
## Plans
|
|
77
86
|
|
|
78
|
-
The free plan includes 300 requests/month. Paid plans start at €4.99/mo.
|
|
87
|
+
The free plan includes 300 requests/month. Paid plans start at €4.99/mo for higher limits and historical data going back years. See [allratestoday.com/pricing](https://allratestoday.com/pricing).
|
|
79
88
|
|
|
80
89
|
## Tools exposed
|
|
81
90
|
|
|
82
|
-
|
|
83
|
-
|---|---|---|
|
|
84
|
-
| `get_exchange_rate` | no | Current mid-market rate between two currencies. |
|
|
85
|
-
| `get_historical_rates` | no | Historical data points over `1d`, `7d`, `30d`, or `1y`. |
|
|
86
|
-
| `get_rates_authenticated` | yes | Multi-target rates and higher limits. |
|
|
87
|
-
| `list_currencies` | no | All supported currencies with codes, names, symbols. |
|
|
88
|
-
| `get_financial_news` | no | Latest financial news from major sources. |
|
|
91
|
+
All four tools require an `ALLRATES_API_KEY`.
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
| Tool | Description |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `get_exchange_rate` | Current mid-market rate between two currencies. |
|
|
96
|
+
| `get_historical_rates` | Historical data points over `1d`, `7d`, `30d`, or `1y`. |
|
|
97
|
+
| `get_rates_authenticated` | Multi-target rates and higher limits. |
|
|
98
|
+
| `list_currencies` | All supported currencies with codes, names, symbols. |
|
|
91
99
|
|
|
92
100
|
## Environment variables
|
|
93
101
|
|
|
94
102
|
| Variable | Default | Purpose |
|
|
95
103
|
|---|---|---|
|
|
96
|
-
| `ALLRATES_API_KEY` | *(
|
|
104
|
+
| `ALLRATES_API_KEY` | *(required)* | Your AllRatesToday API key. Server will not start without it. |
|
|
97
105
|
| `ALLRATES_BASE_URL` | `https://allratestoday.com/api` | Override for self-hosted or staging environments. |
|
|
98
106
|
|
|
99
107
|
## Development
|
package/dist/client.d.ts
CHANGED
|
@@ -48,16 +48,4 @@ export declare class AllRatesTodayClient {
|
|
|
48
48
|
}[];
|
|
49
49
|
count: number;
|
|
50
50
|
}>;
|
|
51
|
-
getNews(): Promise<{
|
|
52
|
-
status: string;
|
|
53
|
-
totalResults: number;
|
|
54
|
-
articles: {
|
|
55
|
-
title: string;
|
|
56
|
-
description?: string;
|
|
57
|
-
url: string;
|
|
58
|
-
image?: string;
|
|
59
|
-
publishedAt?: string;
|
|
60
|
-
source?: string;
|
|
61
|
-
}[];
|
|
62
|
-
}>;
|
|
63
51
|
}
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const DEFAULT_BASE_URL = 'https://allratestoday.com/api';
|
|
2
|
-
const USER_AGENT = `allratestoday-mcp/0.
|
|
2
|
+
const USER_AGENT = `allratestoday-mcp/0.3.0`;
|
|
3
3
|
export class AllRatesTodayError extends Error {
|
|
4
4
|
status;
|
|
5
5
|
body;
|
|
@@ -19,7 +19,7 @@ export class AllRatesTodayClient {
|
|
|
19
19
|
this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, '');
|
|
20
20
|
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
21
21
|
}
|
|
22
|
-
async request(path, query
|
|
22
|
+
async request(path, query) {
|
|
23
23
|
const url = new URL(this.baseUrl + path);
|
|
24
24
|
for (const [key, value] of Object.entries(query)) {
|
|
25
25
|
if (value !== undefined && value !== '')
|
|
@@ -29,15 +29,10 @@ export class AllRatesTodayClient {
|
|
|
29
29
|
'Accept': 'application/json',
|
|
30
30
|
'User-Agent': USER_AGENT,
|
|
31
31
|
};
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
throw new AllRatesTodayError('This endpoint requires an API key. Set ALLRATES_API_KEY or pass apiKey in the MCP config.');
|
|
35
|
-
}
|
|
36
|
-
headers['Authorization'] = `Bearer ${this.apiKey}`;
|
|
37
|
-
}
|
|
38
|
-
else if (this.apiKey) {
|
|
39
|
-
headers['Authorization'] = `Bearer ${this.apiKey}`;
|
|
32
|
+
if (!this.apiKey) {
|
|
33
|
+
throw new AllRatesTodayError('AllRatesToday API key is required. Sign up free at https://allratestoday.com/register to get a key, then set ALLRATES_API_KEY in your MCP config.');
|
|
40
34
|
}
|
|
35
|
+
headers['Authorization'] = `Bearer ${this.apiKey}`;
|
|
41
36
|
const res = await this.fetchImpl(url.toString(), { method: 'GET', headers });
|
|
42
37
|
const text = await res.text();
|
|
43
38
|
let body;
|
|
@@ -62,12 +57,9 @@ export class AllRatesTodayClient {
|
|
|
62
57
|
return this.request('/historical-rates', { source, target, period });
|
|
63
58
|
}
|
|
64
59
|
getAuthenticatedRates(params) {
|
|
65
|
-
return this.request('/v1/rates', params
|
|
60
|
+
return this.request('/v1/rates', params);
|
|
66
61
|
}
|
|
67
62
|
listSymbols() {
|
|
68
63
|
return this.request('/v1/symbols', {});
|
|
69
64
|
}
|
|
70
|
-
getNews() {
|
|
71
|
-
return this.request('/news', {});
|
|
72
|
-
}
|
|
73
65
|
}
|
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.
|
|
15
|
+
description: 'Get the current mid-market exchange rate between two currencies. Returns a single rate number. Requires a free AllRatesToday API key (ALLRATES_API_KEY) — sign up at https://allratestoday.com/register.',
|
|
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).
|
|
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 an AllRatesToday API key (ALLRATES_API_KEY).',
|
|
29
29
|
inputSchema: {
|
|
30
30
|
type: 'object',
|
|
31
31
|
additionalProperties: false,
|
|
@@ -70,12 +70,7 @@ const tools = [
|
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
name: 'list_currencies',
|
|
73
|
-
description: 'List all supported currencies with code, name, and symbol.
|
|
74
|
-
inputSchema: { type: 'object', additionalProperties: false, properties: {} },
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'get_financial_news',
|
|
78
|
-
description: 'Get the latest financial and currency-market news from Bloomberg, Investing.com, and Google News. No API key required.',
|
|
73
|
+
description: 'List all supported currencies with code, name, and symbol. Requires a free AllRatesToday API key (ALLRATES_API_KEY) — sign up at https://allratestoday.com/register. Cached 24h upstream.',
|
|
79
74
|
inputSchema: { type: 'object', additionalProperties: false, properties: {} },
|
|
80
75
|
},
|
|
81
76
|
];
|
|
@@ -84,11 +79,30 @@ function text(s) {
|
|
|
84
79
|
return { content: [{ type: 'text', text: out }] };
|
|
85
80
|
}
|
|
86
81
|
async function main() {
|
|
82
|
+
const apiKey = process.env.ALLRATES_API_KEY;
|
|
83
|
+
if (!apiKey) {
|
|
84
|
+
console.error([
|
|
85
|
+
'',
|
|
86
|
+
' AllRatesToday MCP server requires an API key.',
|
|
87
|
+
'',
|
|
88
|
+
' 1. Sign up free at https://allratestoday.com/register (300 requests/month, no card required)',
|
|
89
|
+
' 2. Copy your API key from the dashboard',
|
|
90
|
+
' 3. Set ALLRATES_API_KEY in your MCP client config:',
|
|
91
|
+
'',
|
|
92
|
+
' "allratestoday": {',
|
|
93
|
+
' "command": "npx",',
|
|
94
|
+
' "args": ["-y", "@allratestoday/mcp-server"],',
|
|
95
|
+
' "env": { "ALLRATES_API_KEY": "art_live_..." }',
|
|
96
|
+
' }',
|
|
97
|
+
'',
|
|
98
|
+
].join('\n'));
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
87
101
|
const client = new AllRatesTodayClient({
|
|
88
|
-
apiKey
|
|
102
|
+
apiKey,
|
|
89
103
|
baseUrl: process.env.ALLRATES_BASE_URL,
|
|
90
104
|
});
|
|
91
|
-
const server = new Server({ name: 'allratestoday-mcp', version: '0.
|
|
105
|
+
const server = new Server({ name: 'allratestoday-mcp', version: '0.3.0' }, { capabilities: { tools: {} } });
|
|
92
106
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
|
|
93
107
|
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
94
108
|
const { name, arguments: args = {} } = req.params;
|
|
@@ -108,9 +122,6 @@ async function main() {
|
|
|
108
122
|
case 'list_currencies': {
|
|
109
123
|
return text(await client.listSymbols());
|
|
110
124
|
}
|
|
111
|
-
case 'get_financial_news': {
|
|
112
|
-
return text(await client.getNews());
|
|
113
|
-
}
|
|
114
125
|
default:
|
|
115
126
|
return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
|
|
116
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allratestoday/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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": [
|