@oliverames/ynab-mcp-server 1.2.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -26
- package/index.js +1241 -1169
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
|
-
<code>
|
|
13
|
+
<code>44 tools</code> •
|
|
14
14
|
<code>100% API coverage</code> •
|
|
15
|
-
<code>YNAB API v1.
|
|
15
|
+
<code>YNAB API v1.83</code>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
18
|
<p align="center">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<p align="center">
|
|
25
25
|
<a href="#quick-start">Quick Start</a> •
|
|
26
26
|
<a href="#what-you-can-do">What You Can Do</a> •
|
|
27
|
-
<a href="#tools-reference">All
|
|
27
|
+
<a href="#tools-reference">All 44 Tools</a> •
|
|
28
28
|
<a href="#environment-variables">Configuration</a>
|
|
29
29
|
</p>
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
## Why This Exists
|
|
34
34
|
|
|
35
|
-
YNAB's budgeting philosophy works best when you interact with your budget frequently
|
|
35
|
+
YNAB's budgeting philosophy works best when you interact with your budget frequently - but the app interface isn't designed for quick queries or bulk operations. "How much did I spend on groceries this month?" shouldn't require navigating three screens. "Categorize all my Amazon orders from this week" shouldn't be a manual, one-by-one process.
|
|
36
36
|
|
|
37
37
|
This server gives your AI assistant full access to YNAB's API, turning natural language into budget operations. All monetary values are automatically converted between dollars and YNAB's internal milliunits format so the AI never has to think about it. Built on the [official YNAB JavaScript SDK](https://github.com/ynab/ynab-sdk-js) with direct API calls for the newest endpoints (category creation, category groups, money movements) that the SDK hasn't caught up with yet.
|
|
38
38
|
|
|
@@ -121,14 +121,14 @@ That's it. Your AI can now talk to YNAB.
|
|
|
121
121
|
|
|
122
122
|
## Features
|
|
123
123
|
|
|
124
|
-
**Complete YNAB API v1.
|
|
124
|
+
**Complete YNAB API v1.83 coverage** with 44 tools:
|
|
125
125
|
|
|
126
126
|
| Resource | Tools | Capabilities |
|
|
127
127
|
|----------|-------|-------------|
|
|
128
128
|
| **Budgets** | 4 | List, view details, settings |
|
|
129
129
|
| **Accounts** | 3 | List, view, create |
|
|
130
130
|
| **Categories** | 9 | Full CRUD, groups, search, goals, monthly budgets |
|
|
131
|
-
| **Payees** |
|
|
131
|
+
| **Payees** | 5 | List, view, create, rename, search |
|
|
132
132
|
| **Payee Locations** | 3 | GPS coordinates for mobile transactions |
|
|
133
133
|
| **Months** | 2 | Monthly summaries with per-category breakdown |
|
|
134
134
|
| **Money Movements** | 4 | Budget re-allocation tracking |
|
|
@@ -138,15 +138,17 @@ That's it. Your AI can now talk to YNAB.
|
|
|
138
138
|
|
|
139
139
|
### Design Decisions
|
|
140
140
|
|
|
141
|
-
- **Dollar amounts everywhere**
|
|
142
|
-
- **Smart budget resolution**
|
|
143
|
-
- **Split transactions**
|
|
144
|
-
- **Bulk operations**
|
|
145
|
-
- **Fetch-then-merge updates**
|
|
146
|
-
- **Fuzzy search**
|
|
147
|
-
- **Approval workflow**
|
|
148
|
-
- **Nullable updates**
|
|
149
|
-
- **
|
|
141
|
+
- **Dollar amounts everywhere** - inputs and outputs are in dollars (`-12.34`), never milliunits (`-12340`). Conversion is automatic and transparent.
|
|
142
|
+
- **Smart budget resolution** - set `YNAB_BUDGET_ID` for a default, or omit it to auto-resolve to your last-used budget. Every tool accepts an optional `budgetId` override.
|
|
143
|
+
- **Split transactions** - first-class support for subtransactions in create, read, and format operations.
|
|
144
|
+
- **Bulk operations** - `create_transactions` and `update_transactions` handle arrays in a single API call.
|
|
145
|
+
- **Fetch-then-merge updates** - scheduled transaction updates (which use PUT semantics) automatically fetch the current state and merge your changes, so you only specify what changed.
|
|
146
|
+
- **Fuzzy search** - `search_categories` and `search_payees` do case-insensitive partial matching across all entries.
|
|
147
|
+
- **Approval workflow** - `review_unapproved` groups transactions into "ready to approve" (categorized, split, or transfer) and "needs attention" (uncategorized), with a built-in warning against approving uncategorized entries.
|
|
148
|
+
- **Nullable updates** - update tools accept `null` for clearable fields (`memo`, `payeeName`, `categoryId`, `flagColor`) to distinguish "don't change" (omit) from "clear this field" (`null`).
|
|
149
|
+
- **Target behavior support** - category create/update tools expose `goalNeedsWholeAmount` for YNAB's "Set aside another" vs. "Refill up to" goal behavior.
|
|
150
|
+
- **Delta request support** - high-volume list tools accept `lastKnowledgeOfServer` and return `server_knowledge` when that parameter is provided.
|
|
151
|
+
- **Debt account support** - loan and debt accounts include `debt_original_balance`, `debt_interest_rates`, `debt_minimum_payments`, and `debt_escrow_amounts` with correct unit conversion (rates stay as percentages, payments convert from milliunits).
|
|
150
152
|
|
|
151
153
|
---
|
|
152
154
|
|
|
@@ -191,6 +193,7 @@ That's it. Your AI can now talk to YNAB.
|
|
|
191
193
|
|------|-------------|
|
|
192
194
|
| `list_payees` | List all payees with transfer account mappings |
|
|
193
195
|
| `get_payee` | Get payee details |
|
|
196
|
+
| `create_payee` | Create a new payee |
|
|
194
197
|
| `update_payee` | Rename a payee |
|
|
195
198
|
| `search_payees` | Case-insensitive partial name search |
|
|
196
199
|
|
|
@@ -226,7 +229,7 @@ That's it. Your AI can now talk to YNAB.
|
|
|
226
229
|
| `get_transaction` | Get a single transaction by ID (includes subtransactions) |
|
|
227
230
|
| `create_transaction` | Create a transaction with optional split (subtransactions must sum to total) |
|
|
228
231
|
| `create_transactions` | Bulk create multiple transactions in a single API call (supports split transactions) |
|
|
229
|
-
| `update_transaction` | Partial update
|
|
232
|
+
| `update_transaction` | Partial update - only specified fields change |
|
|
230
233
|
| `update_transactions` | Batch update multiple transactions at once |
|
|
231
234
|
| `delete_transaction` | Delete a transaction |
|
|
232
235
|
| `import_transactions` | Trigger import from linked bank accounts |
|
|
@@ -255,18 +258,31 @@ That's it. Your AI can now talk to YNAB.
|
|
|
255
258
|
|
|
256
259
|
| Variable | Required | Description |
|
|
257
260
|
|----------|----------|-------------|
|
|
258
|
-
| `YNAB_API_TOKEN` | Yes | [Personal access token](https://app.ynab.com/settings/developer) from YNAB Developer Settings |
|
|
261
|
+
| `YNAB_API_TOKEN` | Yes* | [Personal access token](https://app.ynab.com/settings/developer) from YNAB Developer Settings |
|
|
259
262
|
| `YNAB_BUDGET_ID` | No | Default budget ID. If omitted, uses `"last-used"` (your most recently accessed budget). Run `list_budgets` to find IDs. |
|
|
263
|
+
| `YNAB_OP_PATH` | No | 1Password secret reference for your API token (see below). Required only if using the 1Password fallback instead of `YNAB_API_TOKEN`. |
|
|
264
|
+
|
|
265
|
+
*`YNAB_API_TOKEN` is required unless `YNAB_OP_PATH` is set.
|
|
260
266
|
|
|
261
267
|
### 1Password Integration
|
|
262
268
|
|
|
263
|
-
If
|
|
269
|
+
If you store your YNAB token in [1Password CLI](https://developer.1password.com/docs/cli/), set `YNAB_OP_PATH` to your secret reference and omit `YNAB_API_TOKEN`:
|
|
264
270
|
|
|
265
|
-
```
|
|
266
|
-
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"mcpServers": {
|
|
274
|
+
"ynab": {
|
|
275
|
+
"command": "npx",
|
|
276
|
+
"args": ["-y", "@oliverames/ynab-mcp-server"],
|
|
277
|
+
"env": {
|
|
278
|
+
"YNAB_OP_PATH": "op://Personal/YNAB API Token/credential"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
267
283
|
```
|
|
268
284
|
|
|
269
|
-
|
|
285
|
+
The fallback adds ~1-2s to startup and is silently skipped if `op` is unavailable or the item is not found.
|
|
270
286
|
|
|
271
287
|
---
|
|
272
288
|
|
|
@@ -285,7 +301,7 @@ All amounts in tool inputs and outputs are in **dollars** (e.g., `-12.34` for a
|
|
|
285
301
|
|
|
286
302
|
## Rate Limiting
|
|
287
303
|
|
|
288
|
-
The YNAB API allows **200 requests per hour** per access token, enforced on a rolling window. Each tool call typically uses one API request (except `update_scheduled_transaction` which uses two
|
|
304
|
+
The YNAB API allows **200 requests per hour** per access token, enforced on a rolling window. Each tool call typically uses one API request (except `update_scheduled_transaction` which uses two - a GET to fetch current state, then a PUT to merge changes). The server surfaces rate limit errors as standard MCP error responses.
|
|
289
305
|
|
|
290
306
|
---
|
|
291
307
|
|
|
@@ -309,13 +325,15 @@ The YNAB API allows **200 requests per hour** per access token, enforced on a ro
|
|
|
309
325
|
|
|
310
326
|
## Testing
|
|
311
327
|
|
|
312
|
-
The test suite
|
|
328
|
+
The integration test suite runs against a live YNAB budget. Most write tests create temporary transactions and delete or restore them, but category and category group creation is not reversible through the public API and is skipped unless explicitly enabled.
|
|
313
329
|
|
|
314
330
|
```bash
|
|
315
331
|
YNAB_API_TOKEN=your-token YNAB_BUDGET_ID=your-budget-id npm test
|
|
316
332
|
```
|
|
317
333
|
|
|
318
|
-
|
|
334
|
+
Use `YNAB_TEST_BUDGET_ID` to target a dedicated test budget without changing your server default. To include category and category group creation coverage, run with `YNAB_RUN_NONREVERSIBLE_TESTS=1`.
|
|
335
|
+
|
|
336
|
+
Tests cover all tool categories: reads, reversible writes, bulk operations, search, split transactions, scheduled transaction CRUD with fetch-then-merge verification, money movements, and payee locations.
|
|
319
337
|
|
|
320
338
|
---
|
|
321
339
|
|
|
@@ -330,8 +348,8 @@ YNAB_API_TOKEN=your-token npm start
|
|
|
330
348
|
|
|
331
349
|
### Dependencies
|
|
332
350
|
|
|
333
|
-
- [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk)
|
|
334
|
-
- [`ynab`](https://www.npmjs.com/package/ynab)
|
|
351
|
+
- [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk) - MCP server framework
|
|
352
|
+
- [`ynab`](https://www.npmjs.com/package/ynab) - Official YNAB JavaScript client
|
|
335
353
|
|
|
336
354
|
Zero additional dependencies. No build step. Pure ESM.
|
|
337
355
|
|