@cyanheads/exchange-rates-mcp-server 0.4.2 → 0.5.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/AGENTS.md +9 -9
- package/CLAUDE.md +9 -9
- package/Dockerfile +3 -3
- package/README.md +19 -14
- package/changelog/0.5.x/0.5.0.md +31 -0
- package/dist/config/server-config.d.ts +2 -0
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +8 -2
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/fx-currencies.resource.js +1 -1
- package/dist/mcp-server/resources/definitions/fx-currencies.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/fx-rates-latest.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/fx-rates-latest.resource.js +2 -1
- package/dist/mcp-server/resources/definitions/fx-rates-latest.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-convert-currency.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-convert-currency.tool.js +3 -1
- package/dist/mcp-server/tools/definitions/fx-convert-currency.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-dataframe-describe.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/fx-dataframe-describe.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-dataframe-drop.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/fx-dataframe-drop.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-dataframe-drop.tool.js +5 -5
- package/dist/mcp-server/tools/definitions/fx-dataframe-drop.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-dataframe-query.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/fx-dataframe-query.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-get-rate.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-get-rate.tool.js +3 -1
- package/dist/mcp-server/tools/definitions/fx-get-rate.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-get-rates.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-get-rates.tool.js +3 -1
- package/dist/mcp-server/tools/definitions/fx-get-rates.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-get-timeseries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-get-timeseries.tool.js +48 -36
- package/dist/mcp-server/tools/definitions/fx-get-timeseries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/fx-list-currencies.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/fx-list-currencies.tool.js.map +1 -1
- package/dist/services/frankfurter/frankfurter-service.d.ts +4 -4
- package/dist/services/frankfurter/frankfurter-service.d.ts.map +1 -1
- package/dist/services/frankfurter/frankfurter-service.js +30 -23
- package/dist/services/frankfurter/frankfurter-service.js.map +1 -1
- package/package.json +8 -8
- package/server.json +5 -5
package/AGENTS.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** exchange-rates-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.
|
|
4
|
+
**Version:** 0.5.0
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.15`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/server` ^2.
|
|
8
|
-
**Zod:** ^4.6.
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.3.1
|
|
8
|
+
**Zod:** ^4.6.7
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
11
11
|
|
|
@@ -79,7 +79,7 @@ export const fxGetRate = tool('fx_get_rate', {
|
|
|
79
79
|
],
|
|
80
80
|
async handler(input, ctx) {
|
|
81
81
|
const service = getFrankfurterService();
|
|
82
|
-
const result = await service.getRate(input.base_currency, input.quote_currency, input.date);
|
|
82
|
+
const result = await service.getRate(input.base_currency, input.quote_currency, input.date ?? 'latest', ctx.signal);
|
|
83
83
|
ctx.log.info('Rate fetched', { base: input.base_currency, quote: input.quote_currency });
|
|
84
84
|
return result;
|
|
85
85
|
},
|
|
@@ -114,7 +114,7 @@ export const fxRatesLatestResource = resource('fx://rates/latest/{base}', {
|
|
|
114
114
|
}),
|
|
115
115
|
async handler(params, ctx) {
|
|
116
116
|
const service = getFrankfurterService();
|
|
117
|
-
return await service.getRates(params.base, 'latest');
|
|
117
|
+
return await service.getRates(params.base, 'latest', undefined, ctx.signal);
|
|
118
118
|
},
|
|
119
119
|
});
|
|
120
120
|
```
|
|
@@ -130,7 +130,7 @@ const ServerConfigSchema = z.object({
|
|
|
130
130
|
frankfurterBaseUrl: z.string().url().default('https://api.frankfurter.dev/v1')
|
|
131
131
|
.describe('Frankfurter API base URL.'),
|
|
132
132
|
timeseriesCanvasThresholdDays: z.coerce.number().default(90)
|
|
133
|
-
.describe('Day count above which fx_get_timeseries
|
|
133
|
+
.describe('Day count above which fx_get_timeseries considers DataCanvas staging; inline-fit series remain inline.'),
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
let _config: z.infer<typeof ServerConfigSchema> | undefined;
|
|
@@ -263,7 +263,7 @@ src/
|
|
|
263
263
|
fx-convert-currency.tool.ts # Convert amount between two currencies
|
|
264
264
|
fx-get-rate.tool.ts # Exchange rate for a currency pair
|
|
265
265
|
fx-get-rates.tool.ts # All rates for a base currency snapshot
|
|
266
|
-
fx-get-timeseries.tool.ts # Historical daily rates; inline pages of 500 days,
|
|
266
|
+
fx-get-timeseries.tool.ts # Historical daily rates; inline pages of 500 days, stages long series exceeding the preview budget
|
|
267
267
|
fx-list-currencies.tool.ts # All supported ISO 4217 currencies
|
|
268
268
|
fx-dataframe-describe.tool.ts # List DataCanvas tables from a prior timeseries call
|
|
269
269
|
fx-dataframe-query.tool.ts # SQL SELECT against DataCanvas tables, bounded by row_limit
|
|
@@ -370,7 +370,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
370
370
|
|
|
371
371
|
## Bundling
|
|
372
372
|
|
|
373
|
-
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on.
|
|
373
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. DataCanvas defaults to DuckDB here (`src/index.ts` sets `CANVAS_PROVIDER_TYPE` to `duckdb` when it is unset or empty), but the bundle ships without the DuckDB native, so `manifest.json` pins `CANVAS_PROVIDER_TYPE` to `none`: the bundle is inline-only — `fx_dataframe_*` stay out of `tools/list` and `fx_get_timeseries` pages every range inline. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
374
374
|
|
|
375
375
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`.
|
|
376
376
|
|
package/CLAUDE.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** exchange-rates-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.
|
|
4
|
+
**Version:** 0.5.0
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.15`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/server` ^2.
|
|
8
|
-
**Zod:** ^4.6.
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.3.1
|
|
8
|
+
**Zod:** ^4.6.7
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
11
11
|
|
|
@@ -79,7 +79,7 @@ export const fxGetRate = tool('fx_get_rate', {
|
|
|
79
79
|
],
|
|
80
80
|
async handler(input, ctx) {
|
|
81
81
|
const service = getFrankfurterService();
|
|
82
|
-
const result = await service.getRate(input.base_currency, input.quote_currency, input.date);
|
|
82
|
+
const result = await service.getRate(input.base_currency, input.quote_currency, input.date ?? 'latest', ctx.signal);
|
|
83
83
|
ctx.log.info('Rate fetched', { base: input.base_currency, quote: input.quote_currency });
|
|
84
84
|
return result;
|
|
85
85
|
},
|
|
@@ -114,7 +114,7 @@ export const fxRatesLatestResource = resource('fx://rates/latest/{base}', {
|
|
|
114
114
|
}),
|
|
115
115
|
async handler(params, ctx) {
|
|
116
116
|
const service = getFrankfurterService();
|
|
117
|
-
return await service.getRates(params.base, 'latest');
|
|
117
|
+
return await service.getRates(params.base, 'latest', undefined, ctx.signal);
|
|
118
118
|
},
|
|
119
119
|
});
|
|
120
120
|
```
|
|
@@ -130,7 +130,7 @@ const ServerConfigSchema = z.object({
|
|
|
130
130
|
frankfurterBaseUrl: z.string().url().default('https://api.frankfurter.dev/v1')
|
|
131
131
|
.describe('Frankfurter API base URL.'),
|
|
132
132
|
timeseriesCanvasThresholdDays: z.coerce.number().default(90)
|
|
133
|
-
.describe('Day count above which fx_get_timeseries
|
|
133
|
+
.describe('Day count above which fx_get_timeseries considers DataCanvas staging; inline-fit series remain inline.'),
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
let _config: z.infer<typeof ServerConfigSchema> | undefined;
|
|
@@ -263,7 +263,7 @@ src/
|
|
|
263
263
|
fx-convert-currency.tool.ts # Convert amount between two currencies
|
|
264
264
|
fx-get-rate.tool.ts # Exchange rate for a currency pair
|
|
265
265
|
fx-get-rates.tool.ts # All rates for a base currency snapshot
|
|
266
|
-
fx-get-timeseries.tool.ts # Historical daily rates; inline pages of 500 days,
|
|
266
|
+
fx-get-timeseries.tool.ts # Historical daily rates; inline pages of 500 days, stages long series exceeding the preview budget
|
|
267
267
|
fx-list-currencies.tool.ts # All supported ISO 4217 currencies
|
|
268
268
|
fx-dataframe-describe.tool.ts # List DataCanvas tables from a prior timeseries call
|
|
269
269
|
fx-dataframe-query.tool.ts # SQL SELECT against DataCanvas tables, bounded by row_limit
|
|
@@ -370,7 +370,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
370
370
|
|
|
371
371
|
## Bundling
|
|
372
372
|
|
|
373
|
-
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on.
|
|
373
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. DataCanvas defaults to DuckDB here (`src/index.ts` sets `CANVAS_PROVIDER_TYPE` to `duckdb` when it is unset or empty), but the bundle ships without the DuckDB native, so `manifest.json` pins `CANVAS_PROVIDER_TYPE` to `none`: the bundle is inline-only — `fx_dataframe_*` stay out of `tools/list` and `fx_get_timeseries` pages every range inline. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
374
374
|
|
|
375
375
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`.
|
|
376
376
|
|
package/Dockerfile
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# output. A stage that compiles a native addon needs the target-arch toolchain
|
|
15
15
|
# and cannot cross-compile this way — drop the flag there.
|
|
16
16
|
# ==============================================================================
|
|
17
|
-
FROM --platform=$BUILDPLATFORM oven/bun:1.4.
|
|
17
|
+
FROM --platform=$BUILDPLATFORM oven/bun:1.4.3 AS build
|
|
18
18
|
|
|
19
19
|
WORKDIR /usr/src/app
|
|
20
20
|
|
|
@@ -46,7 +46,7 @@ RUN bun run build
|
|
|
46
46
|
# A clean image rather than `FROM build`: the build stage's node_modules holds
|
|
47
47
|
# devDependencies.
|
|
48
48
|
# ==============================================================================
|
|
49
|
-
FROM --platform=$BUILDPLATFORM oven/bun:1.4.
|
|
49
|
+
FROM --platform=$BUILDPLATFORM oven/bun:1.4.3 AS deps
|
|
50
50
|
|
|
51
51
|
WORKDIR /usr/src/app
|
|
52
52
|
|
|
@@ -113,7 +113,7 @@ RUN rm -rf node_modules/@socketsecurity/bun-security-scanner
|
|
|
113
113
|
# dependencies and build artifacts. Its only Bun invocations are HEALTHCHECK
|
|
114
114
|
# and CMD, which run on the real target at container start.
|
|
115
115
|
# ==============================================================================
|
|
116
|
-
FROM oven/bun:1.4.
|
|
116
|
+
FROM oven/bun:1.4.3-slim AS production
|
|
117
117
|
|
|
118
118
|
WORKDIR /usr/src/app
|
|
119
119
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/exchange-rates-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/exchange-rates-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
## Overview
|
|
31
31
|
|
|
32
|
-
ECB reference exchange rates via Frankfurter
|
|
32
|
+
ECB reference exchange rates via Frankfurter, covering ~30 currencies back to 1999. Convert amounts, disambiguate currency codes, pull point-in-time or historical rates, and run SQL over long time series. No API key required.
|
|
33
33
|
|
|
34
34
|
### Tools
|
|
35
35
|
|
|
@@ -44,7 +44,9 @@ ECB reference exchange rates via Frankfurter — a keyless proxy covering ~30 cu
|
|
|
44
44
|
| `fx_dataframe_query` | Run a read-only SQL SELECT against a staged DataCanvas table |
|
|
45
45
|
| `fx_dataframe_drop` | Remove one staged DataCanvas table or view (opt-in, destructive) |
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
DataCanvas (DuckDB) is on by default. Set `CANVAS_PROVIDER_TYPE=none` to turn it off: the three `fx_dataframe_*` tools then drop out of `tools/list`, and `fx_get_timeseries` returns every range inline. The Claude Desktop bundle (`.mcpb`) ships without DuckDB's native binding, so it runs with DataCanvas off. `fx_dataframe_drop` additionally needs `FX_ENABLE_CANVAS_DROP=true`.
|
|
48
|
+
|
|
49
|
+
The four rate and conversion tools accept `base` as an alias of `base_currency`; pair tools also accept `quote` for `quote_currency`. Send either spelling for a field, never both. Advertised schemas use the canonical names.
|
|
48
50
|
|
|
49
51
|
### Resources
|
|
50
52
|
|
|
@@ -55,6 +57,8 @@ The three `fx_dataframe_*` tools need `CANVAS_PROVIDER_TYPE=duckdb` — unset, t
|
|
|
55
57
|
|
|
56
58
|
All resource data is also reachable via tools — use `fx_list_currencies` or `fx_get_rates` for programmatic access.
|
|
57
59
|
|
|
60
|
+
Cancelling a tool call or resource read stops its upstream fetch, response-body read, and retry backoff. Uncancelled requests retain two retries and a 10-second timeout per attempt.
|
|
61
|
+
|
|
58
62
|
## Capability reference
|
|
59
63
|
|
|
60
64
|
### `fx_list_currencies` <sub>tool</sub>
|
|
@@ -78,7 +82,7 @@ All resource data is also reachable via tools — use `fx_list_currencies` or `f
|
|
|
78
82
|
|
|
79
83
|
- `base_currency`, `quote_currency` required; `date` optional (default latest, ECB data from 1999-01-04, no future dates)
|
|
80
84
|
- Returns `rate`, `rate_date`, and `date_snapped: true` when a weekend/holiday request snapped to the prior business day
|
|
81
|
-
- Cross-rates (neither side EUR) triangulate through EUR in one upstream call; a same-currency pair returns
|
|
85
|
+
- Cross-rates (neither side EUR) triangulate through EUR in one upstream rate call; a same-currency pair returns 1, with its publication date obtained from an upstream proxy quote
|
|
82
86
|
- Typed failures: `invalid_date_format`, `unsupported_currency`, `date_out_of_range`, `upstream_no_data`
|
|
83
87
|
|
|
84
88
|
---
|
|
@@ -96,9 +100,10 @@ All resource data is also reachable via tools — use `fx_list_currencies` or `f
|
|
|
96
100
|
|
|
97
101
|
- `base_currency`, `quote_currency`, `start_date`, `end_date` required (ECB data from 1999-01-04, no future dates, start ≤ end); optional `canvas_id` appends to an existing canvas
|
|
98
102
|
- Inline results page at 500 publication days — `rate_count` is always the range total; `truncated: true` plus `next_start_date` continue the page
|
|
99
|
-
- Ranges over `FX_TIMESERIES_CANVAS_THRESHOLD_DAYS` (default 90 days)
|
|
103
|
+
- Ranges over `FX_TIMESERIES_CANVAS_THRESHOLD_DAYS` (default 90 days) are considered for DataCanvas staging. Series over the 40,000-character preview budget return `spilled: true`, `canvas_id`, and `table_name`; smaller series and deployments with `CANVAS_PROVIDER_TYPE=none` page inline
|
|
100
104
|
- A same-currency pair returns a rate of 1 on each real ECB publication day in range, not a synthetic Mon–Fri loop
|
|
101
105
|
- An empty range (only weekends/holidays) returns `rate_count: 0` with an explanatory `notice`, distinguishable from an error
|
|
106
|
+
- Long ranges that fit the inline preview release their newly acquired canvas; failed or cancelled staging does too. A supplied canvas remains available.
|
|
102
107
|
|
|
103
108
|
---
|
|
104
109
|
|
|
@@ -106,7 +111,7 @@ All resource data is also reachable via tools — use `fx_list_currencies` or `f
|
|
|
106
111
|
|
|
107
112
|
- `canvas_id` required (from a prior `fx_get_timeseries` call)
|
|
108
113
|
- Returns each staged table's `kind`, `row_count`, and column schema (`name`, `type`, `nullable`), plus `expires_at`
|
|
109
|
-
- Required first step before `fx_dataframe_query`;
|
|
114
|
+
- Required first step before `fx_dataframe_query`; unregistered when `CANVAS_PROVIDER_TYPE=none`
|
|
110
115
|
- `canvas_not_found` when the ID doesn't exist or has expired
|
|
111
116
|
|
|
112
117
|
---
|
|
@@ -117,7 +122,7 @@ All resource data is also reachable via tools — use `fx_list_currencies` or `f
|
|
|
117
122
|
- Supports aggregations, GROUP BY, window functions, and JOINs across tables from multiple `fx_get_timeseries` calls
|
|
118
123
|
- Returns at most `row_limit` rows; `truncated: true` plus a `notice` give the `ORDER BY <column> LIMIT <n> OFFSET <m>` shape for the next page — ORDER BY is required for stable paging
|
|
119
124
|
- Markdown table cells are escaped so pipes, angle brackets, and line breaks stay inside their cell; `structuredContent` keeps raw values
|
|
120
|
-
-
|
|
125
|
+
- Unregistered when `CANVAS_PROVIDER_TYPE=none`; typed failures: `canvas_not_found`, `missing_table`, `invalid_query`
|
|
121
126
|
|
|
122
127
|
---
|
|
123
128
|
|
|
@@ -126,7 +131,7 @@ All resource data is also reachable via tools — use `fx_list_currencies` or `f
|
|
|
126
131
|
- `canvas_id` and exact `table_name` (from `fx_dataframe_describe`) required
|
|
127
132
|
- Removes one staged table or view; ECB rate data is untouched and the series can be re-staged via `fx_get_timeseries`
|
|
128
133
|
- Returns `dropped: true`/`false` depending on whether the table existed
|
|
129
|
-
- Disabled unless `FX_ENABLE_CANVAS_DROP=true` — otherwise absent from `tools/list`, named with its enable hint only in the startup log and the HTTP landing page; also
|
|
134
|
+
- Disabled unless `FX_ENABLE_CANVAS_DROP=true` — otherwise absent from `tools/list`, named with its enable hint only in the startup log and the HTTP landing page; also unregistered when `CANVAS_PROVIDER_TYPE=none`
|
|
130
135
|
|
|
131
136
|
---
|
|
132
137
|
|
|
@@ -152,8 +157,8 @@ ECB-specific:
|
|
|
152
157
|
- Keyless access via [Frankfurter](https://www.frankfurter.dev/) — a Cloudflare-fronted ECB proxy; no API keys required
|
|
153
158
|
- Cross-rate triangulation: any pair works — USD → JPY is one upstream call, cross-rated through EUR on Frankfurter's side
|
|
154
159
|
- Weekend/holiday date semantics: `date_snapped` surfaces when the API returns a different date than requested
|
|
155
|
-
- Identity
|
|
156
|
-
- Long time-series
|
|
160
|
+
- Identity rates are computed locally as 1; an upstream proxy quote supplies the actual publication dates for that currency
|
|
161
|
+
- Long time-series that exceed the inline preview budget stage on DataCanvas (DuckDB, on by default) for SQL aggregation over the full range
|
|
157
162
|
|
|
158
163
|
Agent-friendly output:
|
|
159
164
|
|
|
@@ -237,7 +242,7 @@ Or with Docker:
|
|
|
237
242
|
}
|
|
238
243
|
```
|
|
239
244
|
|
|
240
|
-
|
|
245
|
+
DataCanvas (DuckDB) is on by default for long time-series SQL analytics. To turn it off — which also drops `fx_dataframe_describe` and `fx_dataframe_query` from `tools/list` and returns every `fx_get_timeseries` range inline — add `CANVAS_PROVIDER_TYPE=none`:
|
|
241
246
|
|
|
242
247
|
```json
|
|
243
248
|
{
|
|
@@ -248,7 +253,7 @@ To enable DataCanvas for long time-series SQL analytics — which also registers
|
|
|
248
253
|
"args": ["@cyanheads/exchange-rates-mcp-server@latest"],
|
|
249
254
|
"env": {
|
|
250
255
|
"MCP_TRANSPORT_TYPE": "stdio",
|
|
251
|
-
"CANVAS_PROVIDER_TYPE": "
|
|
256
|
+
"CANVAS_PROVIDER_TYPE": "none"
|
|
252
257
|
}
|
|
253
258
|
}
|
|
254
259
|
}
|
|
@@ -303,9 +308,9 @@ All configuration is validated at startup via Zod schemas. Environment variables
|
|
|
303
308
|
| Variable | Description | Default |
|
|
304
309
|
|:---------|:------------|:--------|
|
|
305
310
|
| `FRANKFURTER_BASE_URL` | Frankfurter API base URL. Override for local testing or a self-hosted instance. | `https://api.frankfurter.dev/v1` |
|
|
306
|
-
| `FX_TIMESERIES_CANVAS_THRESHOLD_DAYS` | Day range above which `fx_get_timeseries`
|
|
311
|
+
| `FX_TIMESERIES_CANVAS_THRESHOLD_DAYS` | Day range above which `fx_get_timeseries` considers DataCanvas staging; series that fit the preview remain inline. | `90` |
|
|
307
312
|
| `FX_ENABLE_CANVAS_DROP` | Enable the destructive `fx_dataframe_drop` tool. Off by default: the tool is not registered and is absent from `tools/list`. | `false` |
|
|
308
|
-
| `CANVAS_PROVIDER_TYPE` | Canvas engine.
|
|
313
|
+
| `CANVAS_PROVIDER_TYPE` | Canvas engine. `duckdb` enables DataCanvas for `fx_get_timeseries` long-range spillover and registers the three `fx_dataframe_*` tools; `none` disables it and skips them from `tools/list`. An empty value takes the default. The `.mcpb` bundle sets `none`. | `duckdb` |
|
|
309
314
|
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
|
|
310
315
|
| `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |
|
|
311
316
|
| `MCP_SESSION_MODE` | HTTP session mode: `auto`, `stateful`, or `stateless`. The server declares `stateless` in code — no handler here asks the client for input mid-call, so nothing needs a session to resume — and setting this variable overrides that declaration. | `stateless` |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Cancellable FX requests, currency aliases, and canvas lifecycle fixes."
|
|
3
|
+
breaking: true
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.5.0 — 2026-10-20
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **DataCanvas** defaults to DuckDB when `CANVAS_PROVIDER_TYPE` is unset or empty; set `none` for inline-only results. The portable Claude Desktop bundle pins `none` because it excludes native DuckDB bindings.
|
|
12
|
+
- **`fx_dataframe_query` breaking change:** framework adoption rejects previously supported `current_setting`, `current_schema`, `current_schemas`, `in_search_path`, `query_table`, and nonliteral `query()` calls. Use staged-table SELECTs; literal `query('SELECT …')` remains supported.
|
|
13
|
+
- **Currency inputs** accept `base` for `base_currency` on all four rate/conversion tools and `quote` for `quote_currency` on pair tools; sending both spellings is rejected. Advertised schemas retain canonical names. ([#24](https://github.com/cyanheads/exchange-rates-mcp-server/issues/24))
|
|
14
|
+
- **Conversion amounts** inherit framework representation repair: a numeric string such as `"100"` is accepted as the number `100`.
|
|
15
|
+
- **Bun** `1.4.2 → 1.4.3` across package-manager and Docker pins; framework development guidance and schema checks synchronized.
|
|
16
|
+
|
|
17
|
+
## Fixed
|
|
18
|
+
|
|
19
|
+
- **Caller cancellation** stops upstream fetches, response-body reads, and retry backoff across five tools and both resources, preserving the cancellation reason and independent currency-cache loads. ([#18](https://github.com/cyanheads/exchange-rates-mcp-server/issues/18))
|
|
20
|
+
- **Startup validation** reports invalid server configuration through the startup boundary; drop registration reads only its flag without parsing unrelated configuration. ([#20](https://github.com/cyanheads/exchange-rates-mcp-server/issues/20))
|
|
21
|
+
- **Canvas ownership** releases newly acquired canvases after inline-fit results, empty series, failed staging, or cancellation; supplied canvases survive and genuine spills retain usable handles. ([#25](https://github.com/cyanheads/exchange-rates-mcp-server/issues/25))
|
|
22
|
+
- **Expired-canvas cleanup** advises that no cleanup is needed rather than asking callers to recreate the data merely to delete it.
|
|
23
|
+
|
|
24
|
+
## Dependencies
|
|
25
|
+
|
|
26
|
+
- `@cyanheads/mcp-ts-core` `^0.13.11 → ^0.13.15`.
|
|
27
|
+
- `pino-pretty` `^13.1.3 → ^13.2.0`.
|
|
28
|
+
- `zod` `^4.6.5 → ^4.6.7`.
|
|
29
|
+
- `@types/node` `26.6.3 → 26.6.5`.
|
|
30
|
+
- `ignore` `^7.0.11 → ^7.0.12`.
|
|
31
|
+
- `vitest` `^5.0.3 → ^5.0.5`.
|
|
@@ -8,6 +8,8 @@ declare const ServerConfigSchema: z.ZodObject<{
|
|
|
8
8
|
timeseriesCanvasThresholdDays: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
9
9
|
enableCanvasDrop: z.ZodDefault<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
|
+
/** Read only the registration flag; setup validates invalid values through the startup boundary. */
|
|
12
|
+
export declare function isCanvasDropEnabled(): boolean;
|
|
11
13
|
/** Return the parsed, validated server config (lazy-init on first call). */
|
|
12
14
|
export declare function getServerConfig(): z.infer<typeof ServerConfigSchema>;
|
|
13
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;iBAgBtB,CAAC;AAIH,4EAA4E;AAC5E,wBAAgB,eAAe,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAOpE"}
|
|
1
|
+
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;iBAgBtB,CAAC;AAIH,oGAAoG;AACpG,wBAAgB,mBAAmB,IAAI,OAAO,CAM7C;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAOpE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module config/server-config
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
-
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
6
|
+
import { normalizeEnv, parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
7
7
|
const ServerConfigSchema = z.object({
|
|
8
8
|
frankfurterBaseUrl: z
|
|
9
9
|
.string()
|
|
@@ -13,13 +13,19 @@ const ServerConfigSchema = z.object({
|
|
|
13
13
|
timeseriesCanvasThresholdDays: z.coerce
|
|
14
14
|
.number()
|
|
15
15
|
.default(90)
|
|
16
|
-
.describe('Day count above which fx_get_timeseries
|
|
16
|
+
.describe('Day count above which fx_get_timeseries considers DataCanvas staging; series that fit the preview remain inline.'),
|
|
17
17
|
enableCanvasDrop: z
|
|
18
18
|
.stringbool()
|
|
19
19
|
.default(false)
|
|
20
20
|
.describe('Enable fx_dataframe_drop, which destructively removes a staged DataCanvas table.'),
|
|
21
21
|
});
|
|
22
22
|
let _config;
|
|
23
|
+
/** Read only the registration flag; setup validates invalid values through the startup boundary. */
|
|
24
|
+
export function isCanvasDropEnabled() {
|
|
25
|
+
const flag = ServerConfigSchema.shape.enableCanvasDrop.safeParse(normalizeEnv({ FX_ENABLE_CANVAS_DROP: process.env.FX_ENABLE_CANVAS_DROP })
|
|
26
|
+
.FX_ENABLE_CANVAS_DROP);
|
|
27
|
+
return flag.success && flag.data;
|
|
28
|
+
}
|
|
23
29
|
/** Return the parsed, validated server config (lazy-init on first call). */
|
|
24
30
|
export function getServerConfig() {
|
|
25
31
|
_config ??= parseEnvConfig(ServerConfigSchema, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE7E,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,kBAAkB,EAAE,CAAC;SAClB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,gCAAgC,CAAC;SACzC,QAAQ,CAAC,gFAAgF,CAAC;IAC7F,6BAA6B,EAAE,CAAC,CAAC,MAAM;SACpC,MAAM,EAAE;SACR,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CACP,kHAAkH,CACnH;IACH,gBAAgB,EAAE,CAAC;SAChB,UAAU,EAAE;SACZ,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,kFAAkF,CAAC;CAChG,CAAC,CAAC;AAEH,IAAI,OAAuD,CAAC;AAE5D,oGAAoG;AACpG,MAAM,UAAU,mBAAmB;IACjC,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAC9D,YAAY,CAAC,EAAE,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;SACvE,qBAAqB,CACzB,CAAC;IACF,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,kBAAkB,EAAE,sBAAsB;QAC1C,6BAA6B,EAAE,qCAAqC;QACpE,gBAAgB,EAAE,uBAAuB;KAC1C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
* @module index
|
|
5
5
|
*/
|
|
6
6
|
import { createApp, disabledTool } from '@cyanheads/mcp-ts-core';
|
|
7
|
-
import { config } from '@cyanheads/mcp-ts-core/config';
|
|
7
|
+
import { config, parseConfig, resetConfig } from '@cyanheads/mcp-ts-core/config';
|
|
8
8
|
import { getServerConfig } from './config/server-config.js';
|
|
9
9
|
import { fxCurrenciesResource, fxRatesLatestResource, } from './mcp-server/resources/definitions/index.js';
|
|
10
10
|
import { fxConvertCurrency, fxDataframeDescribe, fxDataframeDrop, fxDataframeQuery, fxGetRate, fxGetRates, fxGetTimeseries, fxListCurrencies, } from './mcp-server/tools/definitions/index.js';
|
|
11
11
|
import { setCanvas } from './services/canvas/canvas-accessor.js';
|
|
12
|
+
parseConfig();
|
|
13
|
+
// DataCanvas defaults on; set CANVAS_PROVIDER_TYPE=none to disable it.
|
|
14
|
+
process.env.CANVAS_PROVIDER_TYPE ||= 'duckdb';
|
|
15
|
+
resetConfig();
|
|
12
16
|
/**
|
|
13
17
|
* The dataframe tools are useless without a canvas to read — every call fails
|
|
14
18
|
* with "DataCanvas is not enabled", which is a worse client experience than not
|
|
@@ -47,10 +51,10 @@ await createApp({
|
|
|
47
51
|
'- Rates are mid-market ECB reference rates — not tradeable bid/ask.\n' +
|
|
48
52
|
'- Use fx_list_currencies first to disambiguate "dollars" (USD/AUD/CAD/HKD/SGD).\n' +
|
|
49
53
|
'- Cross-rates (e.g. USD→JPY) are triangulated through EUR automatically.\n' +
|
|
50
|
-
'- Long time-series (>90 days)
|
|
54
|
+
'- Long time-series (>90 days) stage on DataCanvas when they exceed its inline preview budget (DuckDB, on by default);\n' +
|
|
51
55
|
' call fx_dataframe_describe for the staged columns, then fx_dataframe_query for SQL.\n' +
|
|
52
|
-
'
|
|
53
|
-
' and the dataframe tools are not listed.',
|
|
56
|
+
' Where DataCanvas is off (CANVAS_PROVIDER_TYPE=none), long ranges return inline in pages of 500\n' +
|
|
57
|
+
' publication days (continue from next_start_date) and the dataframe tools are not listed.',
|
|
54
58
|
setup(core) {
|
|
55
59
|
getServerConfig();
|
|
56
60
|
setCanvas(core.canvas);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,eAAe,EACf,gBA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esResource = resource('fx://currencies', {
|
|
|
23
23
|
}),
|
|
24
24
|
async handler(_params, ctx) {
|
|
25
25
|
const service = getFrankfurterService();
|
|
26
|
-
const currencies = await service.listCurrencies();
|
|
26
|
+
const currencies = await service.listCurrencies(ctx.signal);
|
|
27
27
|
ctx.log.info('Fetched currencies resource', { count: currencies.length });
|
|
28
28
|
return { currencies, count: currencies.length, source: 'ECB via Frankfurter' };
|
|
29
29
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx-currencies.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/fx-currencies.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,iBAAiB,EAAE;IAC9D,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,iGAAiG;IACnG,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC;aACV,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;YACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;SACjD,CAAC;aACD,QAAQ,CAAC,8BAA8B,CAAC,CAC5C;aACA,QAAQ,CAAC,0DAA0D,CAAC;QACvE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACnE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;KAC1F,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG;QACxB,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"fx-currencies.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/fx-currencies.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,iBAAiB,EAAE;IAC9D,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,iGAAiG;IACnG,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC;aACV,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;YACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;SACjD,CAAC;aACD,QAAQ,CAAC,8BAA8B,CAAC,CAC5C;aACA,QAAQ,CAAC,0DAA0D,CAAC;QACvE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACnE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;KAC1F,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG;QACxB,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1E,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;IACjF,CAAC;IAED,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACX,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,iBAAiB;gBACtB,IAAI,EAAE,sBAAsB;gBAC5B,QAAQ,EAAE,kBAAkB;gBAC5B,WAAW,EAAE,2DAA2D;aACzE;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx-rates-latest.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/fx-rates-latest.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAKrD,eAAO,MAAM,qBAAqB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"fx-rates-latest.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/fx-rates-latest.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAKrD,eAAO,MAAM,qBAAqB;;;;;;;;6BAqEhC,CAAC"}
|
|
@@ -29,9 +29,10 @@ export const fxRatesLatestResource = resource('fx://rates/latest/{base}', {
|
|
|
29
29
|
const service = getFrankfurterService();
|
|
30
30
|
let raw;
|
|
31
31
|
try {
|
|
32
|
-
raw = await service.getRates(params.base, 'latest');
|
|
32
|
+
raw = await service.getRates(params.base, 'latest', undefined, ctx.signal);
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
|
+
ctx.signal.throwIfAborted();
|
|
35
36
|
const failure = failureOf(err);
|
|
36
37
|
if (failure?.reason === 'unsupported_currency') {
|
|
37
38
|
throw validationError(`${err.message} Call fx_list_currencies for the full currency names.`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx-rates-latest.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/fx-rates-latest.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,0BAA0B,EAAE;IACxE,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,sEAAsE;QACtE,iFAAiF;IACnF,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;KAC/E,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC7D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;QAC3D,KAAK,EAAE,CAAC;aACL,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;aAC9B,QAAQ,CACP,0FAA0F,CAC3F;QACH,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,CACP,yFAAyF,CAC1F;QACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;KAC1F,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;QACxC,IAAI,GAAiD,CAAC;QACtD,IAAI,CAAC;YACH,GAAG,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"fx-rates-latest.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/fx-rates-latest.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,0BAA0B,EAAE;IACxE,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,sEAAsE;QACtE,iFAAiF;IACnF,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;KAC/E,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC7D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;QAC3D,KAAK,EAAE,CAAC;aACL,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;aAC9B,QAAQ,CAC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vB,SAAS,EAAE,GAAG,CAAC,IAAI;YACnB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,SAAS,EAAE,4BAA4B;YACvC,MAAM,EAAE,qBAAqB;SAC9B,CAAC;IACJ,CAAC;IAED,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACX,SAAS,EAAE;YACT,EAAE,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;YACxF,EAAE,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;YACxF,EAAE,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;YACxF,EAAE,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;SACzF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx-convert-currency.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fx-convert-currency.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"fx-convert-currency.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fx-convert-currency.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgL5B,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
7
7
|
import { failureOf, unsupportedCurrencyCodesOf } from '../../../services/frankfurter/errors.js';
|
|
8
8
|
import { ECB_START_DATE, getFrankfurterService, isIsoDate, } from '../../../services/frankfurter/frankfurter-service.js';
|
|
9
9
|
export const fxConvertCurrency = tool('fx_convert_currency', {
|
|
10
|
+
inputAliases: { base: 'base_currency', quote: 'quote_currency' },
|
|
10
11
|
description: 'Convert an amount between any two currencies at the latest or a historical rate. ' +
|
|
11
12
|
'Returns the converted amount, the rate used, the actual rate date, and whether the ' +
|
|
12
13
|
'date was snapped from a weekend/holiday to the prior business day. ' +
|
|
@@ -98,9 +99,10 @@ export const fxConvertCurrency = tool('fx_convert_currency', {
|
|
|
98
99
|
}
|
|
99
100
|
let resolved;
|
|
100
101
|
try {
|
|
101
|
-
resolved = await service.getRate(input.base_currency, input.quote_currency, date);
|
|
102
|
+
resolved = await service.getRate(input.base_currency, input.quote_currency, date, ctx.signal);
|
|
102
103
|
}
|
|
103
104
|
catch (err) {
|
|
105
|
+
ctx.signal.throwIfAborted();
|
|
104
106
|
const failure = failureOf(err);
|
|
105
107
|
if (failure?.reason === 'unsupported_currency') {
|
|
106
108
|
throw ctx.fail('unsupported_currency', err.message, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx-convert-currency.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fx-convert-currency.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,SAAS,GACV,MAAM,+CA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AAG,CAC3D,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACpD,IAAI,IAAI,GAAG,KAAK,EAAE,CAAC;gBACjB,MAAM,GAAG,CAAC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,IAAI,oBAAoB,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;QAED,IAAI,QAAsB,CAAC;QAC3B,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"fx-convert-currency.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fx-convert-currency.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,SAAS,GACV,MAAM,+CAA+C,CAAC;AAGvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC3D,YAAY,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE;IAChE,WAAW,EACT,mFAAmF;QACnF,qFAAqF;QACrF,qEAAqE;QACrE,yDAAyD;IAC3D,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,CACP,u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Q,CAAC,WAAW;SAC9B,CAAC,CAAC;QAEH,OAAO;YACL,aAAa,EAAE,QAAQ,CAAC,YAAY;YACpC,cAAc,EAAE,QAAQ,CAAC,aAAa;YACtC,WAAW,EAAE,KAAK,CAAC,MAAM;YACzB,YAAY,EAAE,WAAW;YACzB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,SAAS,EAAE,QAAQ,CAAC,QAAQ;YAC5B,YAAY,EAAE,QAAQ,CAAC,WAAW;YAClC,SAAS,EAAE,QAAQ,CAAC,QAAQ;YAC5B,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY;YAClC,CAAC,CAAC,mCAAmC,MAAM,CAAC,SAAS,qBAAqB;YAC1E,CAAC,CAAC,EAAE,CAAC;QACP,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EACF,KAAK,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,aAAa,UAAU,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,cAAc,MAAM;oBAC3G,SAAS,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,aAAa,OAAO,MAAM,CAAC,SAAS,EAAE;oBAC/F,QAAQ;oBACR,MAAM,MAAM,CAAC,SAAS,MAAM,MAAM,CAAC,MAAM,GAAG;aAC/C;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -9,8 +9,8 @@ import { getCanvas } from '../../../services/canvas/canvas-accessor.js';
|
|
|
9
9
|
export const fxDataframeDescribe = tool('fx_dataframe_describe', {
|
|
10
10
|
description: 'List tables and columns staged on a DataCanvas from a prior fx_get_timeseries call. ' +
|
|
11
11
|
'Required first step before fx_dataframe_query — use it to discover table names and column schemas. ' +
|
|
12
|
-
'Requires DataCanvas
|
|
13
|
-
'and fx_get_timeseries returns every range inline.',
|
|
12
|
+
'Requires DataCanvas, which is on by default — a deployment that turns it off does not list this ' +
|
|
13
|
+
'tool at all, and fx_get_timeseries returns every range inline there.',
|
|
14
14
|
annotations: {
|
|
15
15
|
readOnlyHint: true,
|
|
16
16
|
idempotentHint: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx-dataframe-describe.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fx-dataframe-describe.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAuB,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,uBAAuB,EAAE;IAC/D,WAAW,EACT,sFAAsF;QACtF,qGAAqG;QACrG,
|
|
1
|
+
{"version":3,"file":"fx-dataframe-describe.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fx-dataframe-describe.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAuB,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,uBAAuB,EAAE;IAC/D,WAAW,EACT,sFAAsF;QACtF,qGAAqG;QACrG,kGAAkG;QAClG,sEAAsE;IACxE,WAAW,EAAE;QACX,YAAY,E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
|
|
@@ -21,7 +21,7 @@ export declare const fxDataframeDrop: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
21
21
|
readonly reason: "canvas_not_found";
|
|
22
22
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
23
23
|
readonly when: "canvas_id does not exist or has been evicted.";
|
|
24
|
-
readonly recovery: "
|
|
24
|
+
readonly recovery: "This canvas is absent or expired; no cleanup is needed.";
|
|
25
25
|
}, {
|
|
26
26
|
readonly reason: "canvas_unavailable";
|
|
27
27
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx-dataframe-drop.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fx-dataframe-drop.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"fx-dataframe-drop.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fx-dataframe-drop.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAkG3E;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;cAKtB,CAAC"}
|