copilot-money-mcp 1.1.0 → 1.2.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -165
  3. package/dist/cli.js +13695 -9792
  4. package/package.json +17 -10
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ignacio Hermosilla
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -108,39 +108,16 @@ After installing the MCP server, Claude Desktop will request **one-time approval
108
108
  **MCP Tool Call:**
109
109
  ```json
110
110
  {
111
- "tool": "get_spending_by_category",
111
+ "tool": "get_transactions",
112
112
  "arguments": {
113
+ "category": "food_and_drink",
113
114
  "period": "last_month"
114
115
  }
115
116
  }
116
117
  ```
117
118
 
118
- **Response:**
119
- ```json
120
- {
121
- "period": {
122
- "start_date": "2025-12-01",
123
- "end_date": "2025-12-31"
124
- },
125
- "total_spending": 1847.32,
126
- "category_count": 8,
127
- "categories": [
128
- {
129
- "category": "food_dining",
130
- "total_spending": 487.50,
131
- "transaction_count": 23
132
- },
133
- {
134
- "category": "groceries",
135
- "total_spending": 612.80,
136
- "transaction_count": 12
137
- }
138
- ]
139
- }
140
- ```
141
-
142
119
  **Claude's Answer:**
143
- > "Last month you spent $487.50 on dining out across 23 transactions. Your largest spending category was groceries at $612.80. Overall, you spent $1,847.32 across 8 categories."
120
+ > "Last month you spent $487.50 on dining out across 23 transactions. Your largest expense was $67.50 at The Italian Place on January 15th."
144
121
 
145
122
  ---
146
123
 
@@ -152,36 +129,14 @@ After installing the MCP server, Claude Desktop will request **one-time approval
152
129
  **MCP Tool Call:**
153
130
  ```json
154
131
  {
155
- "tool": "search_transactions",
132
+ "tool": "get_transactions",
156
133
  "arguments": {
157
- "query": "amazon"
134
+ "merchant": "amazon",
135
+ "period": "last_30_days"
158
136
  }
159
137
  }
160
138
  ```
161
139
 
162
- **Response:**
163
- ```json
164
- {
165
- "count": 7,
166
- "transactions": [
167
- {
168
- "transaction_id": "txn_abc123",
169
- "amount": 47.99,
170
- "date": "2026-01-05",
171
- "name": "Amazon.com",
172
- "category_id": "shopping_online"
173
- },
174
- {
175
- "transaction_id": "txn_def456",
176
- "amount": 23.50,
177
- "date": "2025-12-28",
178
- "name": "Amazon Prime",
179
- "category_id": "subscriptions"
180
- }
181
- ]
182
- }
183
- ```
184
-
185
140
  **Claude's Answer:**
186
141
  > "You made 7 Amazon purchases in the last 30 days, totaling $234.87. The largest was $47.99 on January 5th. You also had a Prime subscription charge of $23.50."
187
142
 
@@ -200,35 +155,6 @@ After installing the MCP server, Claude Desktop will request **one-time approval
200
155
  }
201
156
  ```
202
157
 
203
- **Response:**
204
- ```json
205
- {
206
- "count": 3,
207
- "total_balance": 12547.83,
208
- "accounts": [
209
- {
210
- "account_id": "acc_checking",
211
- "name": "Chase Checking",
212
- "account_type": "checking",
213
- "current_balance": 3247.50,
214
- "mask": "1234"
215
- },
216
- {
217
- "account_id": "acc_savings",
218
- "name": "Ally Savings",
219
- "account_type": "savings",
220
- "current_balance": 8500.33
221
- },
222
- {
223
- "account_id": "acc_credit",
224
- "name": "Chase Freedom",
225
- "account_type": "credit",
226
- "current_balance": 800.00
227
- }
228
- ]
229
- }
230
- ```
231
-
232
158
  **Claude's Answer:**
233
159
  > "Your total balance across all accounts is $12,547.83. This includes:
234
160
  > - Chase Checking: $3,247.50
@@ -237,88 +163,18 @@ After installing the MCP server, Claude Desktop will request **one-time approval
237
163
 
238
164
  ## Available Tools
239
165
 
240
- The MCP server provides 23 read-only tools for comprehensive financial analysis:
241
-
242
- ### Core Tools
243
-
244
- ### 1. `get_transactions`
245
- Query transactions with flexible filters.
246
-
247
- **Parameters:**
248
- - `period` - Date range shorthand (this_month, last_30_days, ytd, etc.)
249
- - `start_date` - Start date (YYYY-MM-DD)
250
- - `end_date` - End date (YYYY-MM-DD)
251
- - `category` - Filter by category (case-insensitive)
252
- - `merchant` - Filter by merchant name (case-insensitive)
253
- - `account_id` - Filter by account ID
254
- - `min_amount` / `max_amount` - Amount range
255
- - `limit` - Max results (default: 100)
256
-
257
- ### 2. `search_transactions`
258
- Free-text search by merchant name.
259
-
260
- **Parameters:**
261
- - `query` - Search query (required)
262
- - `limit` - Max results (default: 50)
263
-
264
- ### 3. `get_accounts`
265
- List all accounts with balances.
266
-
267
- **Parameters:**
268
- - `account_type` - Filter by type (checking, savings, credit, investment)
269
-
270
- ### 4. `get_spending_by_category`
271
- Aggregate spending by category.
272
-
273
- **Parameters:**
274
- - `period` - Date range shorthand
275
- - `start_date` / `end_date` - Date range
276
- - `min_amount` - Minimum expense amount
277
-
278
- ### 5. `get_account_balance`
279
- Get specific account details.
280
-
281
- **Parameters:**
282
- - `account_id` - Account ID (required)
283
-
284
- ### Data Quality & Advanced Analysis Tools
285
-
286
- ### 6. `get_data_quality_report`
287
- Generate a comprehensive data quality report to identify issues in your financial data that should be corrected in Copilot Money.
288
-
289
- This tool helps you find:
290
- - **Unresolved category IDs** - Transactions with category IDs that can't be mapped to human-readable names
291
- - **Potential currency conversion issues** - Large amounts with foreign merchant names that may be displaying unconverted foreign currency
292
- - **Non-unique transaction IDs** - Multiple transactions sharing the same ID
293
- - **Duplicate accounts** - Accounts with the same name and type that may be duplicates
294
- - **Suspicious categorizations** - Common miscategorizations (e.g., Uber as Parking, pharmacies as Office Supplies)
295
-
296
- **Parameters:**
297
- - `period` - Date range shorthand (this_month, last_90_days, ytd, etc.)
298
- - `start_date` / `end_date` - Custom date range
299
-
300
- **Use Case:** Run this tool before doing financial analysis to identify data quality issues that could skew your results. It's especially useful after international travel or if you notice unexpected spending totals.
301
-
302
- ### Other Analysis Tools
303
-
304
- The server also provides these additional tools:
305
- - `get_categories` - List all transaction categories
306
- - `get_recurring_transactions` - Find subscriptions and recurring payments
307
- - `get_income` - Track income sources
308
- - `get_spending_by_merchant` - Merchant spending analysis
309
- - `compare_periods` - Compare spending across time periods
310
- - `get_foreign_transactions` - International transactions and FX fees
311
- - `get_refunds` - Refund transactions
312
- - `get_duplicate_transactions` - Find duplicate transactions
313
- - `get_credits` - Credit transactions
314
- - `get_spending_by_day_of_week` - Spending patterns by day
315
- - `get_trips` - Travel analysis with location detection
316
- - `get_transaction_by_id` - Lookup specific transactions
317
- - `get_top_merchants` - Top merchants by spending
318
- - `get_unusual_transactions` - Anomaly detection
319
- - `export_transactions` - Export to CSV or JSON
320
- - `get_hsa_fsa_eligible` - Healthcare expenses
321
- - `get_spending_rate` - Spending velocity analysis
166
+ The MCP server provides **8 read-only tools** for querying your financial data:
167
+
168
+ | Tool | Description |
169
+ |------|-------------|
170
+ | `get_transactions` | Query transactions with filters (date, category, merchant, amount, account, location). Supports period shortcuts, text search, and special types (foreign, refunds, duplicates). |
171
+ | `get_accounts` | List all accounts with balances, optionally filter by type (checking, savings, credit, investment). |
172
+ | `get_categories` | List all transaction categories with human-readable names, transaction counts, and spending totals. Filter by date range. |
173
+ | `get_recurring_transactions` | Identify subscriptions and recurring charges with frequency, monthly cost, and next expected date. Filter by name for detailed view. |
174
+ | `get_budgets` | Get budgets from Copilot's native budget tracking with spending vs. limit comparisons. |
175
+ | `get_goals` | Get financial goals with progress tracking, monthly history, and savings status. |
176
+ | `get_cache_info` | Get information about the local data cache, including date range and transaction count. |
177
+ | `refresh_database` | Refresh the in-memory cache to pick up newly synced data from Copilot Money. Cache auto-refreshes every 5 minutes. |
322
178
 
323
179
  See tool schemas in Claude Desktop or use the MCP Inspector for complete parameter documentation.
324
180
 
@@ -384,7 +240,7 @@ copilot-money-mcp/
384
240
  - **Language:** TypeScript 5.3+
385
241
  - **Validation:** Zod schemas
386
242
  - **Database:** LevelDB (classic-level) + Protocol Buffers
387
- - **Testing:** Bun test runner (366 tests, 100% passing)
243
+ - **Testing:** Bun test runner (726 tests, 100% passing)
388
244
  - **MCP SDK:** @modelcontextprotocol/sdk v1.2
389
245
 
390
246
  ## Testing
@@ -401,8 +257,8 @@ npm run test:coverage
401
257
  ```
402
258
 
403
259
  **Test Coverage:**
404
- - ✅ 366 tests passing
405
- - ✅ 1360+ assertions
260
+ - ✅ 726 tests passing
261
+ - ✅ 1870+ assertions
406
262
  - ✅ Core decoder tests
407
263
  - ✅ Database abstraction tests
408
264
  - ✅ Tool implementation tests
@@ -432,6 +288,40 @@ The `period` parameter supports these shortcuts:
432
288
  - `this_year` - Current calendar year
433
289
  - `last_year` - Previous calendar year
434
290
 
291
+ ## Configuration
292
+
293
+ ### Cache TTL
294
+
295
+ The MCP server caches data in memory for 5 minutes by default. You can configure this via environment variable:
296
+
297
+ ```bash
298
+ # Set cache TTL to 10 minutes
299
+ COPILOT_CACHE_TTL_MINUTES=10 copilot-money-mcp
300
+
301
+ # Disable caching (always reload from disk)
302
+ COPILOT_CACHE_TTL_MINUTES=0 copilot-money-mcp
303
+ ```
304
+
305
+ You can also manually refresh the cache using the `refresh_database` tool.
306
+
307
+ ## Known Limitations
308
+
309
+ ### Local Cache Size
310
+
311
+ This MCP server reads from Copilot Money's **local Firestore cache**, not directly from the cloud. The cache typically contains:
312
+ - **~500 recent transactions** (not your full history)
313
+ - Accounts, budgets, goals, and recurring transactions
314
+ - Data synced during recent app usage
315
+
316
+ **Why this limitation exists:** Copilot Money uses Firebase/Firestore with App Check security, which prevents direct cloud database access. The local cache is an offline copy maintained by the app for performance.
317
+
318
+ **To maximize cached data:**
319
+ 1. Open the Copilot Money app regularly
320
+ 2. Scroll through your transaction history to trigger sync
321
+ 3. The cache updates when you interact with the app
322
+
323
+ **What you get:** While you may have thousands of transactions in Copilot Money, only recently accessed/synced data is available locally. This is sufficient for most queries (recent spending, current budgets, recurring charges) but won't include your complete historical data.
324
+
435
325
  ## Troubleshooting
436
326
 
437
327
  ### Database Not Found