@cyanheads/exchange-rates-mcp-server 0.1.1

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.
Files changed (77) hide show
  1. package/AGENTS.md +392 -0
  2. package/CLAUDE.md +392 -0
  3. package/Dockerfile +105 -0
  4. package/LICENSE +201 -0
  5. package/README.md +340 -0
  6. package/changelog/0.1.x/0.1.1.md +32 -0
  7. package/changelog/template.md +127 -0
  8. package/dist/config/server-config.d.ts +13 -0
  9. package/dist/config/server-config.d.ts.map +1 -0
  10. package/dist/config/server-config.js +27 -0
  11. package/dist/config/server-config.js.map +1 -0
  12. package/dist/index.d.ts +7 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +31 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/mcp-server/prompts/definitions/index.d.ts +6 -0
  17. package/dist/mcp-server/prompts/definitions/index.d.ts.map +1 -0
  18. package/dist/mcp-server/prompts/definitions/index.js +6 -0
  19. package/dist/mcp-server/prompts/definitions/index.js.map +1 -0
  20. package/dist/mcp-server/resources/definitions/fx-currencies.resource.d.ts +14 -0
  21. package/dist/mcp-server/resources/definitions/fx-currencies.resource.d.ts.map +1 -0
  22. package/dist/mcp-server/resources/definitions/fx-currencies.resource.js +43 -0
  23. package/dist/mcp-server/resources/definitions/fx-currencies.resource.js.map +1 -0
  24. package/dist/mcp-server/resources/definitions/fx-rates-latest.resource.d.ts +15 -0
  25. package/dist/mcp-server/resources/definitions/fx-rates-latest.resource.d.ts.map +1 -0
  26. package/dist/mcp-server/resources/definitions/fx-rates-latest.resource.js +61 -0
  27. package/dist/mcp-server/resources/definitions/fx-rates-latest.resource.js.map +1 -0
  28. package/dist/mcp-server/resources/definitions/index.d.ts +7 -0
  29. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
  30. package/dist/mcp-server/resources/definitions/index.js +7 -0
  31. package/dist/mcp-server/resources/definitions/index.js.map +1 -0
  32. package/dist/mcp-server/tools/definitions/fx-convert-currency.tool.d.ts +33 -0
  33. package/dist/mcp-server/tools/definitions/fx-convert-currency.tool.d.ts.map +1 -0
  34. package/dist/mcp-server/tools/definitions/fx-convert-currency.tool.js +133 -0
  35. package/dist/mcp-server/tools/definitions/fx-convert-currency.tool.js.map +1 -0
  36. package/dist/mcp-server/tools/definitions/fx-dataframe-describe.tool.d.ts +28 -0
  37. package/dist/mcp-server/tools/definitions/fx-dataframe-describe.tool.d.ts.map +1 -0
  38. package/dist/mcp-server/tools/definitions/fx-dataframe-describe.tool.js +105 -0
  39. package/dist/mcp-server/tools/definitions/fx-dataframe-describe.tool.js.map +1 -0
  40. package/dist/mcp-server/tools/definitions/fx-dataframe-query.tool.d.ts +25 -0
  41. package/dist/mcp-server/tools/definitions/fx-dataframe-query.tool.d.ts.map +1 -0
  42. package/dist/mcp-server/tools/definitions/fx-dataframe-query.tool.js +125 -0
  43. package/dist/mcp-server/tools/definitions/fx-dataframe-query.tool.js.map +1 -0
  44. package/dist/mcp-server/tools/definitions/fx-get-rate.tool.d.ts +30 -0
  45. package/dist/mcp-server/tools/definitions/fx-get-rate.tool.d.ts.map +1 -0
  46. package/dist/mcp-server/tools/definitions/fx-get-rate.tool.js +121 -0
  47. package/dist/mcp-server/tools/definitions/fx-get-rate.tool.js.map +1 -0
  48. package/dist/mcp-server/tools/definitions/fx-get-rates.tool.d.ts +28 -0
  49. package/dist/mcp-server/tools/definitions/fx-get-rates.tool.d.ts.map +1 -0
  50. package/dist/mcp-server/tools/definitions/fx-get-rates.tool.js +115 -0
  51. package/dist/mcp-server/tools/definitions/fx-get-rates.tool.js.map +1 -0
  52. package/dist/mcp-server/tools/definitions/fx-get-timeseries.tool.d.ts +41 -0
  53. package/dist/mcp-server/tools/definitions/fx-get-timeseries.tool.d.ts.map +1 -0
  54. package/dist/mcp-server/tools/definitions/fx-get-timeseries.tool.js +229 -0
  55. package/dist/mcp-server/tools/definitions/fx-get-timeseries.tool.js.map +1 -0
  56. package/dist/mcp-server/tools/definitions/fx-list-currencies.tool.d.ts +14 -0
  57. package/dist/mcp-server/tools/definitions/fx-list-currencies.tool.d.ts.map +1 -0
  58. package/dist/mcp-server/tools/definitions/fx-list-currencies.tool.js +47 -0
  59. package/dist/mcp-server/tools/definitions/fx-list-currencies.tool.js.map +1 -0
  60. package/dist/mcp-server/tools/definitions/index.d.ts +12 -0
  61. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  62. package/dist/mcp-server/tools/definitions/index.js +12 -0
  63. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  64. package/dist/services/canvas/canvas-accessor.d.ts +10 -0
  65. package/dist/services/canvas/canvas-accessor.d.ts.map +1 -0
  66. package/dist/services/canvas/canvas-accessor.js +12 -0
  67. package/dist/services/canvas/canvas-accessor.js.map +1 -0
  68. package/dist/services/frankfurter/frankfurter-service.d.ts +46 -0
  69. package/dist/services/frankfurter/frankfurter-service.d.ts.map +1 -0
  70. package/dist/services/frankfurter/frankfurter-service.js +181 -0
  71. package/dist/services/frankfurter/frankfurter-service.js.map +1 -0
  72. package/dist/services/frankfurter/types.d.ts +59 -0
  73. package/dist/services/frankfurter/types.d.ts.map +1 -0
  74. package/dist/services/frankfurter/types.js +6 -0
  75. package/dist/services/frankfurter/types.js.map +1 -0
  76. package/package.json +104 -0
  77. package/server.json +127 -0
@@ -0,0 +1,127 @@
1
+ ---
2
+ # FORMAT REFERENCE — do not edit. Copy this file to
3
+ # `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.8.x/0.8.6.md`)
4
+ # to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
5
+ # with a concrete date.
6
+
7
+ # Required. One-line GitHub Release-style headline. 350 character cap.
8
+ # Default short and scannable. Don't pad, don't stitch unrelated changes with
9
+ # semicolons — pick the headline. Quotes required: unquoted YAML treats `: `
10
+ # inside the value as a key separator and fails GitHub's strict parser.
11
+ summary: ""
12
+
13
+ # Set `true` when consumers must change code to upgrade: API removals,
14
+ # signature changes, config renames, behavior changes that break existing
15
+ # usage. Flagged as `Breaking` in the rollup.
16
+ breaking: false
17
+
18
+ # Set `true` if this release contains any security fix. Pairs with the
19
+ # `## Security` section below. Flagged as `Security` in the rollup so
20
+ # users can triage upgrade urgency at a glance.
21
+ security: false
22
+
23
+ # Optional free-form notes for maintenance agents processing this release.
24
+ # Not rendered in CHANGELOG — consumed by agents running `maintenance` on
25
+ # downstream servers. Use for adoption instructions that don't fit the
26
+ # human-facing sections: new files to create, fields to populate, one-time
27
+ # migration steps. Omit the field entirely when there's nothing to say.
28
+ # agent-notes: |
29
+ # <instructions for downstream maintenance agents>
30
+ ---
31
+
32
+ # <version> — YYYY-MM-DD
33
+
34
+ <!--
35
+ AUTHORING GUIDE — applies to the new per-version file you create from this
36
+ template.
37
+
38
+ Audience: someone scanning release notes to decide what affects them. Lead
39
+ each bullet with the symbol or concept name in **bold** so they can skip
40
+ what's irrelevant and zoom in on what's not.
41
+
42
+ Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
43
+ name the symbol, state what changed, stop. Use a second sentence only when
44
+ it carries weight. If a bullet feels long, it is.
45
+
46
+ Cut: mechanism walkthroughs (those belong in JSDoc, CLAUDE.md/AGENTS.md, or the
47
+ relevant skill), ceremonial framings ("This release introduces…",
48
+ backwards-compat paragraphs), file-by-file test enumerations, internal
49
+ implementation notes. Prefer code/symbol names over English re-explanations.
50
+
51
+ Narrative intro: skip by default. Add one short sentence only when the
52
+ release theme genuinely needs framing the bullets can't carry.
53
+
54
+ Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
55
+ Fixed, Security. Include only sections with entries; delete the rest
56
+ (including the commented-out scaffolding below). Don't ship empty headers.
57
+
58
+ Include: every distinct fact a reader needs to adopt or audit the release —
59
+ new exports, signatures, lint rule IDs, env vars, breaking changes, version
60
+ bumps on shipped skills. Nothing more.
61
+
62
+ Links: link issues, PRs, docs, or skills where they help a reader jump to
63
+ context. Once per item per entry — don't re-link the same issue in summary,
64
+ narrative, and bullet. Skip links for inline symbol names; code spans speak
65
+ for themselves.
66
+
67
+ Issue/PR URLs: use full URLs. GitHub's bare `#NN` auto-link only resolves
68
+ inside its own UI, not in npm reads or local editors.
69
+
70
+ [#38](https://github.com/cyanheads/mcp-ts-core/issues/38) ← issue
71
+ [#42](https://github.com/cyanheads/mcp-ts-core/pull/42) ← PR
72
+
73
+ Verify numbers exist before linking (`gh issue view NN`, `gh pr view NN`).
74
+ Never speculate on a future number — `#42` for an upcoming PR silently
75
+ resolves to whatever real item already owns 42, and timeline previews pull
76
+ in that unrelated item's metadata.
77
+
78
+ TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
79
+ via `gh release create --notes-from-tag`. The tag is a derivative of this
80
+ changelog entry — a condensed, scannable version, not a copy. Format:
81
+
82
+ <theme — omit version number, GitHub prepends it>
83
+ ← blank line
84
+ <1-2 sentence context: what this release does>
85
+ ← blank line
86
+ Dependency bumps: ← section header
87
+ ← blank line
88
+ - `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
89
+ ← blank line
90
+ Changed: ← only sections with entries
91
+ ← blank line
92
+ - `format()` output includes `query` in text mode
93
+ ← blank line
94
+ Added:
95
+ ← blank line
96
+ - `manifest.json` scaffolded for MCPB bundle support
97
+ - Install badges (Claude Desktop, Cursor, VS Code)
98
+ ← blank line
99
+ <N> tests pass; `bun run devcheck` clean. ← footer
100
+
101
+ Never a flat comma-separated string. Always structured markdown with
102
+ sections. The tag must scan well as a rendered GitHub Release page.
103
+ -->
104
+
105
+ ## Added
106
+
107
+ -
108
+
109
+ ## Changed
110
+
111
+ -
112
+
113
+ <!-- ## Deprecated
114
+
115
+ - -->
116
+
117
+ <!-- ## Removed
118
+
119
+ - -->
120
+
121
+ ## Fixed
122
+
123
+ -
124
+
125
+ <!-- ## Security
126
+
127
+ - -->
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Server-specific configuration schema for exchange-rates-mcp-server.
3
+ * @module config/server-config
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ declare const ServerConfigSchema: z.ZodObject<{
7
+ frankfurterBaseUrl: z.ZodDefault<z.ZodString>;
8
+ timeseriesCanvasThresholdDays: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
9
+ }, z.core.$strip>;
10
+ /** Return the parsed, validated server config (lazy-init on first call). */
11
+ export declare function getServerConfig(): z.infer<typeof ServerConfigSchema>;
12
+ export {};
13
+ //# sourceMappingURL=server-config.d.ts.map
@@ -0,0 +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;;;iBAYtB,CAAC;AAIH,4EAA4E;AAC5E,wBAAgB,eAAe,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAMpE"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @fileoverview Server-specific configuration schema for exchange-rates-mcp-server.
3
+ * @module config/server-config
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
7
+ const ServerConfigSchema = z.object({
8
+ frankfurterBaseUrl: z
9
+ .string()
10
+ .url()
11
+ .default('https://api.frankfurter.dev/v1')
12
+ .describe('Frankfurter API base URL. Override for local testing or self-hosted instances.'),
13
+ timeseriesCanvasThresholdDays: z.coerce
14
+ .number()
15
+ .default(90)
16
+ .describe('Day count above which fx_get_timeseries spills the result to DataCanvas instead of inlining.'),
17
+ });
18
+ let _config;
19
+ /** Return the parsed, validated server config (lazy-init on first call). */
20
+ export function getServerConfig() {
21
+ _config ??= parseEnvConfig(ServerConfigSchema, {
22
+ frankfurterBaseUrl: 'FRANKFURTER_BASE_URL',
23
+ timeseriesCanvasThresholdDays: 'FX_TIMESERIES_CANVAS_THRESHOLD_DAYS',
24
+ });
25
+ return _config;
26
+ }
27
+ //# sourceMappingURL=server-config.js.map
@@ -0,0 +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;AAE/D,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,8FAA8F,CAC/F;CACJ,CAAC,CAAC;AAEH,IAAI,OAAuD,CAAC;AAE5D,4EAA4E;AAC5E,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,kBAAkB,EAAE,sBAAsB;QAC1C,6BAA6B,EAAE,qCAAqC;KACrE,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview exchange-rates-mcp-server MCP server entry point.
4
+ * @module index
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG"}
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview exchange-rates-mcp-server MCP server entry point.
4
+ * @module index
5
+ */
6
+ import { createApp } from '@cyanheads/mcp-ts-core';
7
+ import { fxCurrenciesResource, fxRatesLatestResource, } from './mcp-server/resources/definitions/index.js';
8
+ import { fxConvertCurrency, fxDataframeDescribe, fxDataframeQuery, fxGetRate, fxGetRates, fxGetTimeseries, fxListCurrencies, } from './mcp-server/tools/definitions/index.js';
9
+ import { setCanvas } from './services/canvas/canvas-accessor.js';
10
+ await createApp({
11
+ tools: [
12
+ fxListCurrencies,
13
+ fxGetRates,
14
+ fxGetRate,
15
+ fxConvertCurrency,
16
+ fxGetTimeseries,
17
+ fxDataframeDescribe,
18
+ fxDataframeQuery,
19
+ ],
20
+ resources: [fxCurrenciesResource, fxRatesLatestResource],
21
+ prompts: [],
22
+ instructions: 'ECB reference FX rates via Frankfurter (keyless, ~30 currencies, 1999-01-04 to present).\n' +
23
+ '- Rates are mid-market ECB reference rates — not tradeable bid/ask.\n' +
24
+ '- Use fx_list_currencies first to disambiguate "dollars" (USD/AUD/CAD/HKD/SGD).\n' +
25
+ '- Cross-rates (e.g. USD→JPY) are triangulated through EUR automatically.\n' +
26
+ '- Long time-series (>90 days) spill to DataCanvas; use fx_dataframe_query for SQL.',
27
+ setup(core) {
28
+ setCanvas(core.canvas);
29
+ },
30
+ });
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,eAAe,EACf,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,MAAM,SAAS,CAAC;IACd,KAAK,EAAE;QACL,gBAAgB;QAChB,UAAU;QACV,SAAS;QACT,iBAAiB;QACjB,eAAe;QACf,mBAAmB;QACnB,gBAAgB;KACjB;IACD,SAAS,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IACxD,OAAO,EAAE,EAAE;IAEX,YAAY,EACV,4FAA4F;QAC5F,uEAAuE;QACvE,mFAAmF;QACnF,4EAA4E;QAC5E,oFAAoF;IAEtF,KAAK,CAAC,IAAI;QACR,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @fileoverview Barrel export for all prompt definitions. No prompts in this server.
3
+ * @module mcp-server/prompts/definitions/index
4
+ */
5
+ export declare const allPromptDefinitions: never[];
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,EAAE,KAAK,EAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @fileoverview Barrel export for all prompt definitions. No prompts in this server.
3
+ * @module mcp-server/prompts/definitions/index
4
+ */
5
+ export const allPromptDefinitions = [];
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAY,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @fileoverview fx://currencies resource — stable reference document for all supported currencies.
3
+ * @module mcp-server/resources/definitions/fx-currencies.resource
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ export declare const fxCurrenciesResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
7
+ currencies: z.ZodArray<z.ZodObject<{
8
+ code: z.ZodString;
9
+ name: z.ZodString;
10
+ }, z.core.$strip>>;
11
+ count: z.ZodNumber;
12
+ source: z.ZodString;
13
+ }, z.core.$strip>, undefined>;
14
+ //# sourceMappingURL=fx-currencies.resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-currencies.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/fx-currencies.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGrD,eAAO,MAAM,oBAAoB;;;;;;;6BAwC/B,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @fileoverview fx://currencies resource — stable reference document for all supported currencies.
3
+ * @module mcp-server/resources/definitions/fx-currencies.resource
4
+ */
5
+ import { resource, z } from '@cyanheads/mcp-ts-core';
6
+ import { getFrankfurterService } from '../../../services/frankfurter/frankfurter-service.js';
7
+ export const fxCurrenciesResource = resource('fx://currencies', {
8
+ name: 'fx-currencies',
9
+ description: 'All supported ISO 4217 currency codes with full names. ' +
10
+ 'Injectable context for clients that support resources. ' +
11
+ 'Covers the ~30 ECB reference currencies.',
12
+ mimeType: 'application/json',
13
+ params: z.object({}),
14
+ output: z.object({
15
+ currencies: z
16
+ .array(z
17
+ .object({
18
+ code: z.string().describe('ISO 4217 currency code.'),
19
+ name: z.string().describe('Full currency name.'),
20
+ })
21
+ .describe('A single supported currency.'))
22
+ .describe('All supported currencies, sorted alphabetically by code.'),
23
+ count: z.number().describe('Total number of supported currencies.'),
24
+ source: z.string().describe('Always "ECB via Frankfurter" — the upstream data provider.'),
25
+ }),
26
+ async handler(_params, ctx) {
27
+ const service = getFrankfurterService();
28
+ const currencies = await service.listCurrencies();
29
+ ctx.log.info('Fetched currencies resource', { count: currencies.length });
30
+ return { currencies, count: currencies.length, source: 'ECB via Frankfurter' };
31
+ },
32
+ list: () => ({
33
+ resources: [
34
+ {
35
+ uri: 'fx://currencies',
36
+ name: 'Supported Currencies',
37
+ mimeType: 'application/json',
38
+ description: 'All ISO 4217 currency codes supported by ECB/Frankfurter.',
39
+ },
40
+ ],
41
+ }),
42
+ });
43
+ //# sourceMappingURL=fx-currencies.resource.js.map
@@ -0,0 +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,yDAAyD;QACzD,yDAAyD;QACzD,0CAA0C;IAC5C,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,EAAE,CAAC;QAClD,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"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @fileoverview fx://rates/latest/{base} resource — latest rates snapshot for a base currency.
3
+ * @module mcp-server/resources/definitions/fx-rates-latest.resource
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ export declare const fxRatesLatestResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
7
+ base: z.ZodString;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ base_currency: z.ZodString;
10
+ rate_date: z.ZodString;
11
+ rates: z.ZodRecord<z.ZodString, z.ZodNumber>;
12
+ rate_type: z.ZodString;
13
+ source: z.ZodString;
14
+ }, z.core.$strip>, undefined>;
15
+ //# sourceMappingURL=fx-rates-latest.resource.d.ts.map
@@ -0,0 +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;AAGrD,eAAO,MAAM,qBAAqB;;;;;;;;6BA6DhC,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @fileoverview fx://rates/latest/{base} resource — latest rates snapshot for a base currency.
3
+ * @module mcp-server/resources/definitions/fx-rates-latest.resource
4
+ */
5
+ import { resource, z } from '@cyanheads/mcp-ts-core';
6
+ import { getFrankfurterService } from '../../../services/frankfurter/frankfurter-service.js';
7
+ export const fxRatesLatestResource = resource('fx://rates/latest/{base}', {
8
+ name: 'fx-rates-latest',
9
+ description: 'Latest exchange rates snapshot for a base currency as a stable URI. ' +
10
+ 'Returns all available quote currencies at the most recent ECB business-day fix.',
11
+ mimeType: 'application/json',
12
+ params: z.object({
13
+ base: z.string().describe('ISO 4217 base currency code (e.g. USD, EUR, GBP).'),
14
+ }),
15
+ output: z.object({
16
+ base_currency: z.string().describe('The base currency code.'),
17
+ rate_date: z.string().describe('Actual date of the rates.'),
18
+ rates: z
19
+ .record(z.string(), z.number())
20
+ .describe('Map of quote currency code → exchange rate (units of quote currency per 1 unit of base).'),
21
+ rate_type: z
22
+ .string()
23
+ .describe('Always "ECB reference (mid-market)" — these are reference rates, not tradeable bid/ask.'),
24
+ source: z.string().describe('Always "ECB via Frankfurter" — the upstream data provider.'),
25
+ }),
26
+ async handler(params, ctx) {
27
+ const service = getFrankfurterService();
28
+ let raw;
29
+ try {
30
+ raw = await service.getRates(params.base, 'latest');
31
+ }
32
+ catch (err) {
33
+ const msg = err.message ?? '';
34
+ if (msg.includes('not found')) {
35
+ throw new Error(`Currency "${params.base}" is not supported by the ECB. Call fx_list_currencies to get valid codes.`);
36
+ }
37
+ throw err;
38
+ }
39
+ ctx.log.info('Fetched latest rates resource', {
40
+ base: params.base,
41
+ date: raw.date,
42
+ count: Object.keys(raw.rates).length,
43
+ });
44
+ return {
45
+ base_currency: raw.base,
46
+ rate_date: raw.date,
47
+ rates: raw.rates,
48
+ rate_type: 'ECB reference (mid-market)',
49
+ source: 'ECB via Frankfurter',
50
+ };
51
+ },
52
+ list: () => ({
53
+ resources: [
54
+ { uri: 'fx://rates/latest/EUR', name: 'Latest EUR rates', mimeType: 'application/json' },
55
+ { uri: 'fx://rates/latest/USD', name: 'Latest USD rates', mimeType: 'application/json' },
56
+ { uri: 'fx://rates/latest/GBP', name: 'Latest GBP rates', mimeType: 'application/json' },
57
+ { uri: 'fx://rates/latest/JPY', name: 'Latest JPY rates', mimeType: 'application/json' },
58
+ ],
59
+ }),
60
+ });
61
+ //# sourceMappingURL=fx-rates-latest.resource.js.map
@@ -0,0 +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,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,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AAE;YACxF,EAAE,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;SACzF;KACF,CAAC;CACH,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @fileoverview Barrel export for all resource definitions.
3
+ * @module mcp-server/resources/definitions/index
4
+ */
5
+ export { fxCurrenciesResource } from './fx-currencies.resource.js';
6
+ export { fxRatesLatestResource } from './fx-rates-latest.resource.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @fileoverview Barrel export for all resource definitions.
3
+ * @module mcp-server/resources/definitions/index
4
+ */
5
+ export { fxCurrenciesResource } from './fx-currencies.resource.js';
6
+ export { fxRatesLatestResource } from './fx-rates-latest.resource.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @fileoverview fx_convert_currency — convert an amount between any two currencies.
3
+ * @module mcp-server/tools/definitions/fx-convert-currency.tool
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ export declare const fxConvertCurrency: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
+ base_currency: z.ZodString;
9
+ quote_currency: z.ZodString;
10
+ amount: z.ZodNumber;
11
+ date: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ base_currency: z.ZodString;
14
+ quote_currency: z.ZodString;
15
+ base_amount: z.ZodNumber;
16
+ quote_amount: z.ZodNumber;
17
+ rate: z.ZodNumber;
18
+ rate_date: z.ZodString;
19
+ date_snapped: z.ZodBoolean;
20
+ rate_type: z.ZodString;
21
+ source: z.ZodString;
22
+ }, z.core.$strip>, readonly [{
23
+ readonly reason: "unsupported_currency";
24
+ readonly code: JsonRpcErrorCode.InvalidParams;
25
+ readonly when: "base_currency or quote_currency is not in the ECB currency set.";
26
+ readonly recovery: "Call fx_list_currencies to get the list of valid currency codes.";
27
+ }, {
28
+ readonly reason: "date_out_of_range";
29
+ readonly code: JsonRpcErrorCode.InvalidParams;
30
+ readonly when: "date is before 1999-01-04 or in the future.";
31
+ readonly recovery: "ECB data starts 1999-01-04; omit date for the latest available rate.";
32
+ }], undefined>;
33
+ //# sourceMappingURL=fx-convert-currency.tool.d.ts.map
@@ -0,0 +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;AAOjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;cAuJ5B,CAAC"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * @fileoverview fx_convert_currency — convert an amount between any two currencies.
3
+ * @module mcp-server/tools/definitions/fx-convert-currency.tool
4
+ */
5
+ import { tool, z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ import { ECB_START_DATE, getFrankfurterService, } from '../../../services/frankfurter/frankfurter-service.js';
8
+ export const fxConvertCurrency = tool('fx_convert_currency', {
9
+ description: 'Convert an amount between any two currencies at the latest or a historical rate. ' +
10
+ 'Returns the converted amount, the rate used, the actual rate date, and whether the ' +
11
+ 'date was snapped from a weekend/holiday to the prior business day. ' +
12
+ 'Cross-rates are triangulated through EUR automatically. ' +
13
+ 'The primary tool for agent-driven FX workflows.',
14
+ annotations: {
15
+ readOnlyHint: true,
16
+ idempotentHint: true,
17
+ openWorldHint: true,
18
+ },
19
+ input: z.object({
20
+ base_currency: z
21
+ .string()
22
+ .describe('ISO 4217 source currency code (e.g. USD). Call fx_list_currencies to get valid codes.'),
23
+ quote_currency: z
24
+ .string()
25
+ .describe('ISO 4217 target currency code (e.g. EUR). The amount will be expressed in this currency.'),
26
+ amount: z
27
+ .number()
28
+ .describe('Amount in the base currency to convert. Must be a positive number.'),
29
+ date: z
30
+ .string()
31
+ .optional()
32
+ .describe('ISO 8601 date (YYYY-MM-DD) for a historical rate. Omit for the latest available rate. ' +
33
+ 'ECB data starts 1999-01-04. Future dates are not supported.'),
34
+ }),
35
+ output: z.object({
36
+ base_currency: z.string().describe('Source currency code.'),
37
+ quote_currency: z.string().describe('Target currency code.'),
38
+ base_amount: z.number().describe('The input amount in the base currency.'),
39
+ quote_amount: z
40
+ .number()
41
+ .describe('The converted amount in the quote currency, rounded to 6 decimal places.'),
42
+ rate: z
43
+ .number()
44
+ .describe('Exchange rate used: units of quote currency per 1 unit of base currency.'),
45
+ rate_date: z.string().describe('Actual date of the rate used for conversion.'),
46
+ date_snapped: z
47
+ .boolean()
48
+ .describe('True when the API returned a different date than requested — ' +
49
+ 'ECB silently snaps weekend/holiday requests to the prior business day.'),
50
+ rate_type: z
51
+ .string()
52
+ .describe('Always "ECB reference (mid-market)" — these are reference rates, not tradeable bid/ask.'),
53
+ source: z.string().describe('Always "ECB via Frankfurter" — the upstream data provider.'),
54
+ }),
55
+ errors: [
56
+ {
57
+ reason: 'unsupported_currency',
58
+ code: JsonRpcErrorCode.InvalidParams,
59
+ when: 'base_currency or quote_currency is not in the ECB currency set.',
60
+ recovery: 'Call fx_list_currencies to get the list of valid currency codes.',
61
+ },
62
+ {
63
+ reason: 'date_out_of_range',
64
+ code: JsonRpcErrorCode.InvalidParams,
65
+ when: 'date is before 1999-01-04 or in the future.',
66
+ recovery: 'ECB data starts 1999-01-04; omit date for the latest available rate.',
67
+ },
68
+ ],
69
+ async handler(input, ctx) {
70
+ const service = getFrankfurterService();
71
+ const date = input.date ?? 'latest';
72
+ if (date !== 'latest') {
73
+ if (date < ECB_START_DATE) {
74
+ throw ctx.fail('date_out_of_range', `Date ${date} is before ECB data start ${ECB_START_DATE}.`, {
75
+ ...ctx.recoveryFor('date_out_of_range'),
76
+ });
77
+ }
78
+ const today = new Date().toISOString().slice(0, 10);
79
+ if (date > today) {
80
+ throw ctx.fail('date_out_of_range', `Date ${date} is in the future.`, {
81
+ ...ctx.recoveryFor('date_out_of_range'),
82
+ });
83
+ }
84
+ }
85
+ let resolved;
86
+ try {
87
+ resolved = await service.getRate(input.base_currency, input.quote_currency, date);
88
+ }
89
+ catch (err) {
90
+ const msg = err.message ?? '';
91
+ if (msg.includes('not found')) {
92
+ throw ctx.fail('unsupported_currency', `Currency "${input.base_currency}" or "${input.quote_currency}" is not supported by the ECB.`, { ...ctx.recoveryFor('unsupported_currency') });
93
+ }
94
+ throw err;
95
+ }
96
+ const quoteAmount = Math.round(input.amount * resolved.rate * 1_000_000) / 1_000_000;
97
+ ctx.log.info('Converted currency', {
98
+ base: resolved.baseCurrency,
99
+ quote: resolved.quoteCurrency,
100
+ amount: input.amount,
101
+ result: quoteAmount,
102
+ rate: resolved.rate,
103
+ date: resolved.rateDate,
104
+ snapped: resolved.dateSnapped,
105
+ });
106
+ return {
107
+ base_currency: resolved.baseCurrency,
108
+ quote_currency: resolved.quoteCurrency,
109
+ base_amount: input.amount,
110
+ quote_amount: quoteAmount,
111
+ rate: resolved.rate,
112
+ rate_date: resolved.rateDate,
113
+ date_snapped: resolved.dateSnapped,
114
+ rate_type: resolved.rateType,
115
+ source: resolved.source,
116
+ };
117
+ },
118
+ format: (result) => {
119
+ const snapNote = result.date_snapped
120
+ ? `\n⚠️ *Requested date snapped to ${result.rate_date} (weekend/holiday)*`
121
+ : '';
122
+ return [
123
+ {
124
+ type: 'text',
125
+ text: `**${result.base_amount} ${result.base_currency}** = **${result.quote_amount} ${result.quote_currency}**\n` +
126
+ `Rate: ${result.rate} (${result.quote_currency}/${result.base_currency}) · ${result.rate_date}` +
127
+ snapNote +
128
+ `\n*${result.rate_type} · ${result.source}*`,
129
+ },
130
+ ];
131
+ },
132
+ });
133
+ //# sourceMappingURL=fx-convert-currency.tool.js.map
@@ -0,0 +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,EACL,cAAc,EACd,qBAAqB,GACtB,MAAM,+CAA+C,CAAC;AAGvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC3D,WAAW,EACT,mFAAmF;QACnF,qFAAqF;QACrF,qEAAqE;QACrE,0DAA0D;QAC1D,iDAAiD;IACnD,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,uFAAuF,CACxF;QACH,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,QAAQ,CACP,0FAA0F,CAC3F;QACH,MAAM,EAAE,CAAC;aACN,MAAM,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a,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"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @fileoverview fx_dataframe_describe — list tables and columns on a DataCanvas.
3
+ * @module mcp-server/tools/definitions/fx-dataframe-describe.tool
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ export declare const fxDataframeDescribe: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
+ canvas_id: z.ZodString;
9
+ }, z.core.$strip>, z.ZodObject<{
10
+ canvas_id: z.ZodString;
11
+ tables: z.ZodArray<z.ZodObject<{
12
+ name: z.ZodString;
13
+ kind: z.ZodString;
14
+ row_count: z.ZodNumber;
15
+ columns: z.ZodArray<z.ZodObject<{
16
+ name: z.ZodString;
17
+ type: z.ZodString;
18
+ nullable: z.ZodBoolean;
19
+ }, z.core.$strip>>;
20
+ }, z.core.$strip>>;
21
+ expires_at: z.ZodString;
22
+ }, z.core.$strip>, readonly [{
23
+ readonly reason: "canvas_not_found";
24
+ readonly code: JsonRpcErrorCode.NotFound;
25
+ readonly when: "canvas_id does not exist or has been evicted.";
26
+ readonly recovery: "Re-run fx_get_timeseries to obtain a fresh canvas_id.";
27
+ }], undefined>;
28
+ //# sourceMappingURL=fx-dataframe-describe.tool.d.ts.map