@dizzlkheinz/ynab-mcpb 0.24.0 → 0.24.2

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 (80) hide show
  1. package/.github/workflows/ci-tests.yml +3 -0
  2. package/.github/workflows/claude-code-review.yml +3 -0
  3. package/.github/workflows/claude.yml +3 -0
  4. package/.github/workflows/full-integration.yml +3 -0
  5. package/.github/workflows/publish.yml +3 -0
  6. package/.github/workflows/release.yml +3 -0
  7. package/CHANGELOG.md +19 -0
  8. package/CLAUDE.md +24 -2
  9. package/README.md +3 -0
  10. package/dist/bundle/index.cjs +95 -94
  11. package/dist/server/YNABMCPServer.js +22 -7
  12. package/dist/server/toolRegistry.js +22 -0
  13. package/dist/tools/accountTools.js +32 -26
  14. package/dist/tools/budgetTools.js +2 -0
  15. package/dist/tools/categoryTools.js +35 -29
  16. package/dist/tools/compareTransactions/formatter.js +8 -6
  17. package/dist/tools/compareTransactions/parser.js +12 -5
  18. package/dist/tools/csvFilePath.d.ts +1 -0
  19. package/dist/tools/csvFilePath.js +48 -0
  20. package/dist/tools/exportTransactions.js +23 -21
  21. package/dist/tools/monthTools.js +2 -0
  22. package/dist/tools/payeeTools.js +2 -0
  23. package/dist/tools/reconciliation/index.js +45 -7
  24. package/dist/tools/reconciliation/statementWindow.d.ts +13 -0
  25. package/dist/tools/reconciliation/statementWindow.js +71 -0
  26. package/dist/tools/transactionReadTools.js +3 -0
  27. package/dist/tools/transactionTools.d.ts +1 -1
  28. package/dist/tools/transactionTools.js +1 -1
  29. package/dist/tools/transactionUtils.js +9 -0
  30. package/dist/tools/transactionWriteTools.js +137 -110
  31. package/dist/tools/utilityTools.js +1 -0
  32. package/package.json +2 -2
  33. package/src/__tests__/comprehensive.integration.test.ts +1053 -1106
  34. package/src/server/CLAUDE.md +38 -6
  35. package/src/server/YNABMCPServer.ts +28 -7
  36. package/src/server/__tests__/YNABMCPServer.integration.test.ts +649 -716
  37. package/src/server/__tests__/errorHandler.integration.test.ts +343 -386
  38. package/src/server/__tests__/security.integration.test.ts +412 -442
  39. package/src/server/__tests__/server-startup.integration.test.ts +372 -430
  40. package/src/server/__tests__/toolRegistry.test.ts +112 -0
  41. package/src/server/toolRegistry.ts +40 -4
  42. package/src/tools/CLAUDE.md +67 -25
  43. package/src/tools/__tests__/accountTools.delta.integration.test.ts +71 -84
  44. package/src/tools/__tests__/accountTools.integration.test.ts +100 -105
  45. package/src/tools/__tests__/budgetTools.delta.integration.test.ts +23 -24
  46. package/src/tools/__tests__/budgetTools.integration.test.ts +109 -109
  47. package/src/tools/__tests__/categoryTools.delta.integration.test.ts +18 -21
  48. package/src/tools/__tests__/categoryTools.integration.test.ts +261 -274
  49. package/src/tools/__tests__/compareTransactions/formatter.test.ts +2 -1
  50. package/src/tools/__tests__/compareTransactions/parser.test.ts +2 -2
  51. package/src/tools/__tests__/csvFilePath.test.ts +48 -0
  52. package/src/tools/__tests__/deltaFetcher.scheduled.integration.test.ts +25 -27
  53. package/src/tools/__tests__/monthTools.delta.integration.test.ts +14 -13
  54. package/src/tools/__tests__/monthTools.integration.test.ts +139 -144
  55. package/src/tools/__tests__/payeeTools.delta.integration.test.ts +14 -13
  56. package/src/tools/__tests__/payeeTools.integration.test.ts +129 -134
  57. package/src/tools/__tests__/transactionTools.integration.test.ts +726 -750
  58. package/src/tools/__tests__/transactionUtils.test.ts +35 -0
  59. package/src/tools/__tests__/utilityTools.integration.test.ts +18 -18
  60. package/src/tools/accountTools.ts +32 -28
  61. package/src/tools/budgetTools.ts +2 -0
  62. package/src/tools/categoryTools.ts +35 -29
  63. package/src/tools/compareTransactions/formatter.ts +8 -6
  64. package/src/tools/compareTransactions/parser.ts +18 -6
  65. package/src/tools/csvFilePath.ts +63 -0
  66. package/src/tools/exportTransactions.ts +25 -23
  67. package/src/tools/monthTools.ts +2 -0
  68. package/src/tools/payeeTools.ts +2 -0
  69. package/src/tools/reconciliation/CLAUDE.md +1 -0
  70. package/src/tools/reconciliation/__tests__/executor.integration.test.ts +13 -15
  71. package/src/tools/reconciliation/__tests__/recommendationEngine.integration.test.ts +613 -642
  72. package/src/tools/reconciliation/__tests__/reconciliation.delta.integration.test.ts +89 -95
  73. package/src/tools/reconciliation/__tests__/statementWindow.test.ts +112 -0
  74. package/src/tools/reconciliation/index.ts +64 -7
  75. package/src/tools/reconciliation/statementWindow.ts +107 -0
  76. package/src/tools/transactionReadTools.ts +3 -0
  77. package/src/tools/transactionTools.ts +5 -5
  78. package/src/tools/transactionUtils.ts +12 -0
  79. package/src/tools/transactionWriteTools.ts +145 -114
  80. package/src/tools/utilityTools.ts +1 -0
@@ -6,6 +6,9 @@ on:
6
6
  - master
7
7
  pull_request:
8
8
 
9
+ env:
10
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
11
+
9
12
  jobs:
10
13
  unit-tests:
11
14
  runs-on: ubuntu-latest
@@ -10,6 +10,9 @@ on:
10
10
  # - "src/**/*.js"
11
11
  # - "src/**/*.jsx"
12
12
 
13
+ env:
14
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
15
+
13
16
  jobs:
14
17
  claude-review:
15
18
  # Optional: Filter by PR author
@@ -10,6 +10,9 @@ on:
10
10
  pull_request_review:
11
11
  types: [submitted]
12
12
 
13
+ env:
14
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
15
+
13
16
  jobs:
14
17
  claude:
15
18
  if: |
@@ -5,6 +5,9 @@ on:
5
5
  - cron: '0 2 * * *'
6
6
  workflow_dispatch:
7
7
 
8
+ env:
9
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
10
+
8
11
  jobs:
9
12
  run-full-suite:
10
13
  runs-on: ubuntu-latest
@@ -9,6 +9,9 @@ on:
9
9
  release:
10
10
  types: [published]
11
11
 
12
+ env:
13
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
14
+
12
15
  jobs:
13
16
  publish:
14
17
  # Required to satisfy npm Trusted Publisher matching (environment name left blank in npm)
@@ -16,6 +16,9 @@ on:
16
16
  required: false
17
17
  default: 'master'
18
18
 
19
+ env:
20
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
21
+
19
22
  permissions:
20
23
  contents: write
21
24
 
package/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.24.2] - 2026-03-29
11
+
12
+ ### Changed
13
+
14
+ - **Dependencies** - Updated `@modelcontextprotocol/sdk` to 1.28.0; updated dev dependencies (Biome 2.4.9, Vitest 4.1.2, csv-parse 6.2.1, esbuild 0.27.4, @types/node 25.5.0)
15
+
16
+ ## [0.24.1] - 2026-03-29
17
+
18
+ ### Fixed
19
+
20
+ - **Reconciliation Bulk Creates** - Correlation now succeeds when YNAB populates `payee_id` on returned transactions; previously every bulk-created transaction landed in the `correlation_failed` bucket, reporting 0 transactions created
21
+ - **MCP SDK 1.27+ Compatibility** - All 28 tool handlers now return `structuredContent` alongside text content, resolving the `RuntimeError: Tool has an output schema but did not return structured content` thrown by SDK clients
22
+ - **Output Schema Stripping** - Zod schema stripping is now applied to handler-supplied `structuredContent`; previously the raw handler object was returned, leaking fields not declared in the output schema (e.g. `security` in diagnostic info)
23
+ - **Content Validation Ordering** - Content array validation now runs unconditionally before the `structuredContent` fast-path, so malformed content is caught centrally even when `structuredContent` is present
24
+
25
+ ### Changed
26
+
27
+ - **CI** - GitHub Actions runners now opt into Node.js 24 via `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true`, ahead of the June 2026 forced migration
28
+
10
29
  ## [0.24.0] - 2026-02-22
11
30
 
12
31
  ### Changed
package/CLAUDE.md CHANGED
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
 
7
7
  This is a Model Context Protocol (MCP) server for YNAB (You Need A Budget) integration, enabling AI assistants to interact with YNAB budgets, accounts, transactions, and categories. The codebase uses TypeScript with a modular, service-oriented architecture.
8
8
 
9
- **Current Version:** 0.24.0
9
+ **Current Version:** 0.24.2
10
10
 
11
11
  ## Essential Commands
12
12
 
@@ -85,7 +85,8 @@ The architecture is modular and service-oriented:
85
85
  - **prompts.ts** - MCP prompt definitions and handlers
86
86
  - **diagnostics.ts** - System diagnostics and health monitoring
87
87
  - **securityMiddleware.ts** - Security validation and wrapper functions
88
- - **responseFormatter.ts** - JSON response formatting (minification/pretty-print)
88
+ - **responseFormatter.ts** - JSON response formatting (pretty-print)
89
+ - **markdownFormatter.ts** - Human-readable markdown output for all read tools (tables, detail views, pagination footers)
89
90
  - **rateLimiter.ts** - Rate limiting for YNAB API compliance
90
91
  - **requestLogger.ts** - Request/response logging middleware
91
92
  - **cacheKeys.ts** - Centralized cache key generation utilities
@@ -176,6 +177,27 @@ registry.register({
176
177
  });
177
178
  ```
178
179
 
180
+ ### Response Format (Markdown / JSON)
181
+
182
+ All read-only tools accept a `response_format` parameter (`"markdown"` | `"json"`, default: `"markdown"`):
183
+
184
+ - **`"markdown"`** — Human-readable tables and detail views via `markdownFormatter.ts`. Includes pagination footers and cache info.
185
+ - **`"json"`** — Structured JSON (pretty-printed). Also returned as `structuredContent` for clients that support output schemas.
186
+
187
+ **Supported tools**: `ynab_list_budgets`, `ynab_get_budget`, `ynab_list_accounts`, `ynab_get_account`, `ynab_list_transactions`, `ynab_get_transaction`, `ynab_list_categories`, `ynab_get_category`, `ynab_list_payees`, `ynab_get_payee`, `ynab_get_month`, `ynab_list_months`, `ynab_get_user`
188
+
189
+ ```typescript
190
+ // In tool handler
191
+ const fmt = params.response_format ?? "markdown";
192
+ return {
193
+ content: [{
194
+ type: "text",
195
+ text: fmt === "json" ? JSON.stringify(data, null, 2) : formatBudgetsList(data),
196
+ }],
197
+ structuredContent: data,
198
+ };
199
+ ```
200
+
179
201
  ### Enhanced Caching with Delta Support
180
202
 
181
203
  Use `cacheManager.wrap()` for automatic caching with observability:
package/README.md CHANGED
@@ -56,6 +56,7 @@ graph LR
56
56
  - **Bank reconciliation (beta)** — Import a bank CSV, fuzzy-match against YNAB, detect missing or mismatched transactions, and apply bulk fixes.
57
57
  - **28 YNAB tools** — Full coverage of budgets, accounts, transactions, categories, payees, months, and utilities.
58
58
  - **Delta sync** — Fetches only changed data since the last request, keeping things fast.
59
+ - **Markdown or JSON** — All read tools support `response_format`: human-readable markdown tables (default) or structured JSON.
59
60
  - **MCP-native** — Structured outputs, annotations, completions API, and resource templates.
60
61
 
61
62
  ---
@@ -199,6 +200,8 @@ Create a transaction: $42.18 at Trader Joe's yesterday.
199
200
  | Reconciliation | `reconcile_account` |
200
201
  | Utilities | `get_user` `diagnostic_info` `clear_cache` |
201
202
 
203
+ All read tools accept `response_format` (`"markdown"` or `"json"`, default: `"markdown"`).
204
+
202
205
  Full reference: [docs/reference/API.md](docs/reference/API.md)
203
206
 
204
207
  </details>