@dizzlkheinz/ynab-mcpb 0.23.0 → 0.24.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.
- package/.github/workflows/ci-tests.yml +3 -0
- package/.github/workflows/claude-code-review.yml +3 -0
- package/.github/workflows/claude.yml +3 -0
- package/.github/workflows/full-integration.yml +3 -0
- package/.github/workflows/publish.yml +3 -0
- package/.github/workflows/release.yml +3 -0
- package/CHANGELOG.md +23 -0
- package/CLAUDE.md +50 -28
- package/README.md +3 -0
- package/dist/bundle/index.cjs +96 -95
- package/dist/server/YNABMCPServer.js +26 -7
- package/dist/server/resources.d.ts +5 -0
- package/dist/server/resources.js +10 -0
- package/dist/server/toolRegistry.js +22 -0
- package/dist/tools/accountTools.js +32 -26
- package/dist/tools/budgetTools.js +2 -0
- package/dist/tools/categoryTools.js +35 -29
- package/dist/tools/compareTransactions/formatter.js +8 -6
- package/dist/tools/compareTransactions/parser.js +12 -5
- package/dist/tools/csvFilePath.d.ts +1 -0
- package/dist/tools/csvFilePath.js +48 -0
- package/dist/tools/exportTransactions.js +23 -21
- package/dist/tools/monthTools.js +2 -0
- package/dist/tools/payeeTools.js +2 -0
- package/dist/tools/reconciliation/index.js +45 -7
- package/dist/tools/reconciliation/statementWindow.d.ts +13 -0
- package/dist/tools/reconciliation/statementWindow.js +71 -0
- package/dist/tools/transactionReadTools.js +3 -0
- package/dist/tools/transactionUtils.js +9 -0
- package/dist/tools/transactionWriteTools.js +137 -110
- package/dist/tools/utilityTools.js +1 -0
- package/package.json +2 -2
- package/src/server/CLAUDE.md +38 -6
- package/src/server/YNABMCPServer.ts +33 -7
- package/src/server/__tests__/resources.test.ts +2 -0
- package/src/server/__tests__/toolRegistry.test.ts +112 -0
- package/src/server/resources.ts +21 -0
- package/src/server/toolRegistry.ts +40 -4
- package/src/tools/CLAUDE.md +67 -25
- package/src/tools/__tests__/accountTools.integration.test.ts +3 -0
- package/src/tools/__tests__/budgetTools.delta.integration.test.ts +11 -2
- package/src/tools/__tests__/budgetTools.integration.test.ts +8 -2
- package/src/tools/__tests__/categoryTools.delta.integration.test.ts +4 -1
- package/src/tools/__tests__/categoryTools.integration.test.ts +4 -0
- package/src/tools/__tests__/compareTransactions/formatter.test.ts +2 -1
- package/src/tools/__tests__/compareTransactions/parser.test.ts +2 -2
- package/src/tools/__tests__/csvFilePath.test.ts +48 -0
- package/src/tools/__tests__/monthTools.delta.integration.test.ts +4 -1
- package/src/tools/__tests__/monthTools.integration.test.ts +5 -0
- package/src/tools/__tests__/payeeTools.delta.integration.test.ts +4 -1
- package/src/tools/__tests__/payeeTools.integration.test.ts +5 -0
- package/src/tools/__tests__/transactionTools.integration.test.ts +18 -2
- package/src/tools/__tests__/transactionUtils.test.ts +35 -0
- package/src/tools/__tests__/utilityTools.integration.test.ts +3 -1
- package/src/tools/accountTools.ts +32 -28
- package/src/tools/budgetTools.ts +2 -0
- package/src/tools/categoryTools.ts +35 -29
- package/src/tools/compareTransactions/formatter.ts +8 -6
- package/src/tools/compareTransactions/parser.ts +18 -6
- package/src/tools/csvFilePath.ts +63 -0
- package/src/tools/exportTransactions.ts +25 -23
- package/src/tools/monthTools.ts +2 -0
- package/src/tools/payeeTools.ts +2 -0
- package/src/tools/reconciliation/CLAUDE.md +1 -0
- package/src/tools/reconciliation/__tests__/statementWindow.test.ts +112 -0
- package/src/tools/reconciliation/index.ts +64 -7
- package/src/tools/reconciliation/statementWindow.ts +107 -0
- package/src/tools/transactionReadTools.ts +3 -0
- package/src/tools/transactionUtils.ts +12 -0
- package/src/tools/transactionWriteTools.ts +145 -114
- package/src/tools/utilityTools.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.24.1] - 2026-03-29
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **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
|
|
15
|
+
- **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
|
|
16
|
+
- **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)
|
|
17
|
+
- **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
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **CI** - GitHub Actions runners now opt into Node.js 24 via `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true`, ahead of the June 2026 forced migration
|
|
22
|
+
|
|
23
|
+
## [0.24.0] - 2026-02-22
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **SDK** - Upgraded @modelcontextprotocol/sdk from 1.26.0 to 1.27.0
|
|
28
|
+
- **Server Info** - Added `title`, `description`, and `websiteUrl` to MCP server metadata
|
|
29
|
+
- **Logging** - Declared `logging` capability in server initialization
|
|
30
|
+
- **Resource Annotations** - Added `audience` and `priority` annotations to all resources and resource templates
|
|
31
|
+
- **Documentation** - Fixed all tool name references in CLAUDE.md to use actual `ynab_` prefixed names
|
|
32
|
+
|
|
10
33
|
## [0.23.0] - 2026-02-22
|
|
11
34
|
|
|
12
35
|
### Added
|
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.
|
|
9
|
+
**Current Version:** 0.24.1
|
|
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 (
|
|
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
|
|
@@ -97,7 +98,7 @@ The architecture is modular and service-oriented:
|
|
|
97
98
|
- Domain factories (`register*Tools`) live in each tool file: budget, account, transaction, category, payee, month, utility, reconciliation. `setupToolRegistry` now delegates to these factories.
|
|
98
99
|
- Shared schemas: `emptyObjectSchema`, `looseObjectSchema` in `src/tools/schemas/common.ts`.
|
|
99
100
|
- Output schemas: All 28 tools have Zod output schemas in `src/tools/schemas/outputs/`, registered via `outputSchema` field. The registry converts to JSON Schema for `tools/list` and validates handler output for `structuredContent`.
|
|
100
|
-
- Server-owned inline tools that stay in `YNABMCPServer`: `
|
|
101
|
+
- Server-owned inline tools that stay in `YNABMCPServer`: `ynab_set_default_budget`, `ynab_get_default_budget`, `ynab_diagnostic_info`, `ynab_clear_cache` (they depend on server internals).
|
|
101
102
|
|
|
102
103
|
### Tool Implementation (`src/tools/`)
|
|
103
104
|
|
|
@@ -167,7 +168,7 @@ All tools register through the centralized `ToolRegistry` for consistent validat
|
|
|
167
168
|
|
|
168
169
|
```typescript
|
|
169
170
|
registry.register({
|
|
170
|
-
name: '
|
|
171
|
+
name: 'ynab_my_tool',
|
|
171
172
|
description: 'Tool description',
|
|
172
173
|
inputSchema: MyToolSchema, // Zod input schema
|
|
173
174
|
outputSchema: MyOutputSchema, // Zod output schema (structuredContent)
|
|
@@ -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:
|
|
@@ -304,7 +326,7 @@ Long-running operations can emit MCP progress notifications to provide real-time
|
|
|
304
326
|
- **ProgressCallback** type defined in `src/server/toolRegistry.ts`
|
|
305
327
|
- Optional callback passed to tool handlers via adapter pattern
|
|
306
328
|
- Usage: `await sendProgress?.({ progress, total, message })`
|
|
307
|
-
- Currently used by: `
|
|
329
|
+
- Currently used by: `ynab_reconcile_account` tool
|
|
308
330
|
|
|
309
331
|
### Progress Notification Pattern
|
|
310
332
|
|
|
@@ -325,7 +347,7 @@ async function handleLongOperation(
|
|
|
325
347
|
|
|
326
348
|
### Tools with Progress Support
|
|
327
349
|
|
|
328
|
-
- **
|
|
350
|
+
- **ynab_reconcile_account** - Reports progress during CSV parsing, matching, and bulk operations
|
|
329
351
|
|
|
330
352
|
## Tool Annotations
|
|
331
353
|
|
|
@@ -346,23 +368,23 @@ Each tool includes the following annotation fields:
|
|
|
346
368
|
The system defines 5 preset annotation patterns in `src/tools/toolCategories.ts`:
|
|
347
369
|
|
|
348
370
|
- **READ_ONLY_EXTERNAL** - Read-only tools querying YNAB API
|
|
349
|
-
- Examples: `
|
|
371
|
+
- Examples: `ynab_list_budgets`, `ynab_get_account`, `ynab_list_transactions`
|
|
350
372
|
- Characteristics: Read-only, idempotent, external API calls
|
|
351
373
|
|
|
352
374
|
- **WRITE_EXTERNAL_CREATE** - Tools creating new resources, non-idempotent
|
|
353
|
-
- Examples: `
|
|
375
|
+
- Examples: `ynab_create_transaction`, `ynab_create_account`
|
|
354
376
|
- Characteristics: Write operations, non-idempotent (repeated calls create duplicates), external API
|
|
355
377
|
|
|
356
378
|
- **WRITE_EXTERNAL_UPDATE** - Tools updating existing resources, idempotent
|
|
357
|
-
- Examples: `
|
|
379
|
+
- Examples: `ynab_update_transaction`, `ynab_set_default_budget`, `ynab_reconcile_account`
|
|
358
380
|
- Characteristics: Write operations, idempotent (repeated calls produce same result), external API
|
|
359
381
|
|
|
360
382
|
- **WRITE_EXTERNAL_DELETE** - Destructive tools deleting resources
|
|
361
|
-
- Example: `
|
|
383
|
+
- Example: `ynab_delete_transaction` ⚠️
|
|
362
384
|
- Characteristics: Write operations, destructive, idempotent, external API
|
|
363
385
|
|
|
364
386
|
- **UTILITY_LOCAL** - Local utility tools without external API calls
|
|
365
|
-
- Examples: `
|
|
387
|
+
- Examples: `ynab_clear_cache`, `ynab_diagnostic_info`
|
|
366
388
|
- Characteristics: Local operations, no external API dependencies
|
|
367
389
|
|
|
368
390
|
### Complete Tool Classification
|
|
@@ -371,23 +393,23 @@ All 28 tools are classified into the following categories:
|
|
|
371
393
|
|
|
372
394
|
**Read-Only External (15 tools):**
|
|
373
395
|
|
|
374
|
-
- `
|
|
396
|
+
- `ynab_list_budgets`, `ynab_get_budget`, `ynab_list_accounts`, `ynab_get_account`, `ynab_list_transactions`, `ynab_export_transactions`, `ynab_compare_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`
|
|
375
397
|
|
|
376
398
|
**Write External - Create (4 tools):**
|
|
377
399
|
|
|
378
|
-
- `
|
|
400
|
+
- `ynab_create_account`, `ynab_create_transaction`, `ynab_create_transactions`, `ynab_create_receipt_split_transaction`
|
|
379
401
|
|
|
380
402
|
**Write External - Update (5 tools):**
|
|
381
403
|
|
|
382
|
-
- `
|
|
404
|
+
- `ynab_set_default_budget`, `ynab_reconcile_account`, `ynab_update_transaction`, `ynab_update_transactions`, `ynab_update_category`
|
|
383
405
|
|
|
384
406
|
**Write External - Delete (1 tool):**
|
|
385
407
|
|
|
386
|
-
- `
|
|
408
|
+
- `ynab_delete_transaction` ⚠️
|
|
387
409
|
|
|
388
410
|
**Utility Local (3 tools):**
|
|
389
411
|
|
|
390
|
-
- `
|
|
412
|
+
- `ynab_get_default_budget`, `ynab_diagnostic_info`, `ynab_clear_cache`
|
|
391
413
|
|
|
392
414
|
### Usage Example
|
|
393
415
|
|
|
@@ -397,7 +419,7 @@ Tool annotations are applied during tool registration using preset patterns:
|
|
|
397
419
|
import { ToolAnnotationPresets } from '../tools/toolCategories.js';
|
|
398
420
|
|
|
399
421
|
register({
|
|
400
|
-
name: '
|
|
422
|
+
name: 'ynab_delete_transaction',
|
|
401
423
|
description: 'Delete a transaction',
|
|
402
424
|
inputSchema: DeleteTransactionSchema,
|
|
403
425
|
handler: adaptWrite(handleDeleteTransaction),
|
|
@@ -420,16 +442,16 @@ Output schemas live in `src/tools/schemas/outputs/` organized by domain:
|
|
|
420
442
|
|
|
421
443
|
| File | Covers | Key Schemas |
|
|
422
444
|
|------|--------|-------------|
|
|
423
|
-
| `budgetOutputs.ts` | `
|
|
424
|
-
| `accountOutputs.ts` | `
|
|
425
|
-
| `transactionOutputs.ts` | `
|
|
426
|
-
| `transactionMutationOutputs.ts` | `
|
|
427
|
-
| `categoryOutputs.ts` | `
|
|
428
|
-
| `payeeOutputs.ts` | `
|
|
429
|
-
| `monthOutputs.ts` | `
|
|
430
|
-
| `utilityOutputs.ts` | `
|
|
431
|
-
| `reconciliationOutputs.ts` | `
|
|
432
|
-
| `comparisonOutputs.ts` | `
|
|
445
|
+
| `budgetOutputs.ts` | `ynab_list_budgets`, `ynab_get_budget` | `ListBudgetsOutputSchema`, `GetBudgetOutputSchema` |
|
|
446
|
+
| `accountOutputs.ts` | `ynab_list_accounts`, `ynab_get_account`, `ynab_create_account` | `ListAccountsOutputSchema`, `GetAccountOutputSchema`, `CreateAccountOutputSchema` |
|
|
447
|
+
| `transactionOutputs.ts` | `ynab_list_transactions`, `ynab_get_transaction` | `ListTransactionsOutputSchema` (union: normal/preview), `GetTransactionOutputSchema` |
|
|
448
|
+
| `transactionMutationOutputs.ts` | `ynab_create_transaction`, `ynab_create_transactions`, `ynab_update_transaction`, `ynab_update_transactions`, `ynab_delete_transaction`, `ynab_create_receipt_split_transaction`, `ynab_update_category` | All mutation schemas with dry-run/execution unions |
|
|
449
|
+
| `categoryOutputs.ts` | `ynab_list_categories`, `ynab_get_category` | `ListCategoriesOutputSchema`, `GetCategoryOutputSchema` |
|
|
450
|
+
| `payeeOutputs.ts` | `ynab_list_payees`, `ynab_get_payee` | `ListPayeesOutputSchema`, `GetPayeeOutputSchema` |
|
|
451
|
+
| `monthOutputs.ts` | `ynab_get_month`, `ynab_list_months` | `GetMonthOutputSchema`, `ListMonthsOutputSchema` |
|
|
452
|
+
| `utilityOutputs.ts` | `ynab_get_user`, `ynab_get_default_budget`, `ynab_set_default_budget`, `ynab_clear_cache`, `ynab_diagnostic_info` | All utility output schemas |
|
|
453
|
+
| `reconciliationOutputs.ts` | `ynab_reconcile_account` | `ReconcileAccountOutputSchema` (human-only or human+structured union) |
|
|
454
|
+
| `comparisonOutputs.ts` | `ynab_compare_transactions`, `ynab_export_transactions` | `CompareTransactionsOutputSchema`, `ExportTransactionsOutputSchema` |
|
|
433
455
|
|
|
434
456
|
### Shared Schema Components
|
|
435
457
|
|
|
@@ -598,7 +620,7 @@ Service modules (like diagnostics, resources, prompts) follow a pattern:
|
|
|
598
620
|
|
|
599
621
|
## Reconciliation System
|
|
600
622
|
|
|
601
|
-
The reconciliation tool (`
|
|
623
|
+
The reconciliation tool (`ynab_reconcile_account`) is a comprehensive account reconciliation system with advanced features:
|
|
602
624
|
|
|
603
625
|
### Key Components
|
|
604
626
|
|
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>
|