copilot-money-mcp 1.1.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/PRIVACY.md +118 -0
  2. package/README.md +479 -0
  3. package/dist/cli.js +25802 -0
  4. package/package.json +76 -0
package/PRIVACY.md ADDED
@@ -0,0 +1,118 @@
1
+ # Privacy Policy for Copilot Money MCP Server
2
+
3
+ **Last Updated:** January 12, 2026
4
+
5
+ ## Disclaimer
6
+
7
+ **This is an independent, community-driven project and is not affiliated with, endorsed by, or associated with Copilot Money or its parent company in any way.** This tool was created by an independent developer. "Copilot Money" is a trademark of its respective owner.
8
+
9
+ ## Overview
10
+
11
+ The Copilot Money MCP Server is designed with privacy as a core principle. This document outlines our privacy practices and commitments.
12
+
13
+ ## Data Collection
14
+
15
+ **We do not collect, store, or transmit any of your data.**
16
+
17
+ The Copilot Money MCP Server:
18
+ - Operates entirely on your local machine
19
+ - Reads data only from your local Copilot Money database cache
20
+ - Never sends your financial data to external servers
21
+ - Never transmits data over the internet
22
+ - Does not include any analytics or telemetry
23
+
24
+ ## Data Access
25
+
26
+ ### What Data We Access
27
+
28
+ The server reads from your local Copilot Money database, which is stored at:
29
+ ```
30
+ ~/Library/Containers/com.copilot.production/Data/Library/Application Support/firestore/__FIRAPP_DEFAULT/copilot-production-22904/main
31
+ ```
32
+
33
+ This database contains:
34
+ - Transaction records (amounts, dates, merchant names, categories)
35
+ - Account information (balances, account types, institution names)
36
+ - Category data
37
+
38
+ ### How We Access Data
39
+
40
+ - **Read-Only:** The server only reads data; it never modifies your Copilot Money database
41
+ - **Local Processing:** All data processing happens on your machine
42
+ - **No Network Requests:** The server makes zero network requests
43
+ - **No External APIs:** No connections to third-party services
44
+
45
+ ## Data Usage
46
+
47
+ Data read from your local database is used exclusively to:
48
+ 1. Respond to queries from Claude Desktop via the Model Context Protocol (MCP)
49
+ 2. Perform local calculations (e.g., spending aggregations, category summaries)
50
+ 3. Filter and search transactions based on your requests
51
+
52
+ All processing happens in memory on your local machine and is never persisted outside of the existing Copilot Money database.
53
+
54
+ ## Data Sharing
55
+
56
+ **We do not share your data with anyone.**
57
+
58
+ - No data is sent to our servers (we don't have servers)
59
+ - No data is sent to third parties
60
+ - No data is sent to Anthropic (beyond what Claude Desktop processes locally)
61
+ - No analytics or crash reports are transmitted
62
+
63
+ ## Data Security
64
+
65
+ ### Technical Safeguards
66
+
67
+ - **Local-Only Architecture:** All operations are performed locally
68
+ - **No Network Access:** The server does not make network requests
69
+ - **Read-Only Access:** Cannot modify or delete your financial data
70
+ - **macOS Sandbox Compliance:** Respects macOS file system permissions
71
+
72
+ ### Your Control
73
+
74
+ You maintain full control over your data:
75
+ - The server only runs when you explicitly start it via Claude Desktop
76
+ - You can stop the server at any time by closing Claude Desktop
77
+ - You can uninstall the server at any time
78
+ - Your Copilot Money data remains in its original location
79
+
80
+ ## Claude Desktop Integration
81
+
82
+ When integrated with Claude Desktop:
83
+ - Queries are processed by Claude via MCP protocol
84
+ - Claude may temporarily process your financial data to answer questions
85
+ - This processing happens according to [Anthropic's Privacy Policy](https://www.anthropic.com/privacy)
86
+ - You control what queries are sent to Claude
87
+
88
+ ## Third-Party Services
89
+
90
+ This server does not integrate with any third-party services beyond:
91
+ - **Claude Desktop** (optional, required for AI-powered queries)
92
+ - **Copilot Money** (reads local database created by the app)
93
+
94
+ ## Children's Privacy
95
+
96
+ This server is not directed to children under 13. We do not knowingly collect data from children.
97
+
98
+ ## Changes to This Policy
99
+
100
+ We may update this privacy policy from time to time. Changes will be reflected in this document with an updated "Last Updated" date.
101
+
102
+ ## Open Source
103
+
104
+ This server is open source. You can:
105
+ - Review the source code at https://github.com/ignaciohermosillacornejo/copilot-money-mcp
106
+ - Verify that no data is transmitted externally
107
+ - Audit the data access patterns
108
+ - Contribute improvements
109
+
110
+ ## Contact
111
+
112
+ For privacy-related questions or concerns:
113
+ - Open an issue: https://github.com/ignaciohermosillacornejo/copilot-money-mcp/issues
114
+ - Email: hello@ignaciohermosilla.com
115
+
116
+ ## Summary
117
+
118
+ **In short:** This server is a local-only tool that reads your Copilot Money data to enable AI-powered queries via Claude Desktop. Your data never leaves your machine, and we never collect, store, or transmit your financial information.
package/README.md ADDED
@@ -0,0 +1,479 @@
1
+ # Copilot Money MCP Server
2
+
3
+ > AI-powered personal finance queries using local Copilot Money data
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Node.js 18+](https://img.shields.io/badge/node-18+-green.svg)](https://nodejs.org/)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/)
8
+ [![Tests](https://img.shields.io/badge/Tests-Passing-brightgreen.svg)](https://github.com/ignaciohermosillacornejo/copilot-money-mcp)
9
+
10
+ ## Disclaimer
11
+
12
+ **This is an independent, community-driven project and is not affiliated with, endorsed by, or associated with Copilot Money or its parent company in any way.** This tool was created by an independent developer to enable AI-powered queries of locally cached data. "Copilot Money" is a trademark of its respective owner.
13
+
14
+ ## Overview
15
+
16
+ This MCP (Model Context Protocol) server enables AI-powered queries of your Copilot Money personal finance data by reading locally cached Firestore data (LevelDB + Protocol Buffers). **100% local processing** - no network requests, all data stays on your machine.
17
+
18
+ **Key Features:**
19
+ - 🔒 **100% Local & Private** - Reads from local cache, zero network requests
20
+ - 🤖 **AI-Powered** - Natural language queries via Claude Desktop
21
+ - ⚡ **Fast** - Processes thousands of transactions in under 2 seconds
22
+ - 🛡️ **Read-Only** - Never modifies your Copilot Money data
23
+ - 📦 **Easy Install** - One-click .mcpb bundle for Claude Desktop
24
+
25
+ ## Privacy First
26
+
27
+ Your financial data never leaves your machine. See our [Privacy Policy](PRIVACY.md) for details.
28
+
29
+ - ✅ No data collection or transmission
30
+ - ✅ No external API calls
31
+ - ✅ No analytics or telemetry
32
+ - ✅ Read-only access to local database
33
+ - ✅ Open source - verify the code yourself
34
+
35
+ ## Quick Start
36
+
37
+ ### Prerequisites
38
+
39
+ - **Node.js 18+** (comes bundled with Claude Desktop)
40
+ - **Copilot Money** (macOS App Store version)
41
+ - **Claude Desktop** with MCP support
42
+
43
+ ### Installation via Claude Desktop
44
+
45
+ 1. Download the latest `.mcpb` bundle from [Releases](https://github.com/ignaciohermosillacornejo/copilot-money-mcp/releases)
46
+ 2. Double-click the `.mcpb` file to install in Claude Desktop
47
+ 3. Restart Claude Desktop
48
+ 4. Start asking questions about your finances!
49
+
50
+ ### Installation via npm
51
+
52
+ ```bash
53
+ npm install -g copilot-money-mcp
54
+ ```
55
+
56
+ Then add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "copilot-money": {
62
+ "command": "copilot-money-mcp"
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ ### Manual Installation for Development
69
+
70
+ ```bash
71
+ # Clone the repository
72
+ git clone https://github.com/ignaciohermosillacornejo/copilot-money-mcp.git
73
+ cd copilot-money-mcp
74
+
75
+ # Install dependencies
76
+ npm install
77
+
78
+ # Build the project
79
+ npm run build
80
+
81
+ # Run tests
82
+ npm test
83
+ ```
84
+
85
+ ## First-Time Setup
86
+
87
+ After installing the MCP server, Claude Desktop will request **one-time approval for each tool** when you first use them. This is a standard security feature for all MCP servers.
88
+
89
+ **What to expect:**
90
+ - You'll see approval prompts as you use different tools
91
+ - Each prompt shows the tool name and what it does
92
+ - After approving once, the tools work seamlessly without further prompts
93
+
94
+ **Why this happens:**
95
+ - Claude Desktop requires explicit user consent before an MCP tool can access your data
96
+ - Even though all our tools are read-only (with `readOnlyHint: true`), Claude Desktop shows these prompts as a security best practice
97
+ - This is normal behavior and not specific to this MCP server
98
+
99
+ **After first use:** Once you've approved all tools, they'll work instantly without any prompts in future conversations!
100
+
101
+ ## Working Examples
102
+
103
+ ### Example 1: Monthly Spending Analysis
104
+
105
+ **User Query:**
106
+ > "How much did I spend on dining out last month?"
107
+
108
+ **MCP Tool Call:**
109
+ ```json
110
+ {
111
+ "tool": "get_spending_by_category",
112
+ "arguments": {
113
+ "period": "last_month"
114
+ }
115
+ }
116
+ ```
117
+
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
+ **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."
144
+
145
+ ---
146
+
147
+ ### Example 2: Finding Specific Transactions
148
+
149
+ **User Query:**
150
+ > "Show me all my Amazon purchases in the last 30 days"
151
+
152
+ **MCP Tool Call:**
153
+ ```json
154
+ {
155
+ "tool": "search_transactions",
156
+ "arguments": {
157
+ "query": "amazon"
158
+ }
159
+ }
160
+ ```
161
+
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
+ **Claude's Answer:**
186
+ > "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
+
188
+ ---
189
+
190
+ ### Example 3: Account Overview
191
+
192
+ **User Query:**
193
+ > "What's my current account balance across all accounts?"
194
+
195
+ **MCP Tool Call:**
196
+ ```json
197
+ {
198
+ "tool": "get_accounts",
199
+ "arguments": {}
200
+ }
201
+ ```
202
+
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
+ **Claude's Answer:**
233
+ > "Your total balance across all accounts is $12,547.83. This includes:
234
+ > - Chase Checking: $3,247.50
235
+ > - Ally Savings: $8,500.33
236
+ > - Chase Freedom Credit: $800.00 (current balance)"
237
+
238
+ ## Available Tools
239
+
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
322
+
323
+ See tool schemas in Claude Desktop or use the MCP Inspector for complete parameter documentation.
324
+
325
+ ## Development
326
+
327
+ ### Build Commands
328
+
329
+ ```bash
330
+ # Install dependencies
331
+ npm install
332
+
333
+ # Run tests
334
+ npm test
335
+
336
+ # Build for production
337
+ npm run build
338
+
339
+ # Build .mcpb bundle
340
+ npm run pack:mcpb
341
+
342
+ # Type checking
343
+ npm run typecheck
344
+
345
+ # Linting
346
+ npm run lint
347
+ npm run lint:fix
348
+
349
+ # Formatting
350
+ npm run format
351
+ npm run format:check
352
+ ```
353
+
354
+ ### Project Structure
355
+
356
+ ```
357
+ copilot-money-mcp/
358
+ ├── src/
359
+ │ ├── core/ # Database abstraction & binary decoder
360
+ │ ├── models/ # Zod schemas (Transaction, Account, Category)
361
+ │ ├── tools/ # MCP tool implementations
362
+ │ ├── utils/ # Date utilities
363
+ │ ├── server.ts # MCP server
364
+ │ └── cli.ts # CLI entry point
365
+ ├── tests/
366
+ │ ├── core/ # Core module tests
367
+ │ └── tools/ # Tool tests
368
+ ├── dist/ # Compiled output
369
+ ├── PRIVACY.md # Privacy policy
370
+ └── manifest.json # .mcpb metadata
371
+ ```
372
+
373
+ ### Architecture
374
+
375
+ **Data Flow:**
376
+ 1. Copilot Money stores data in local LevelDB/Firestore cache
377
+ 2. Binary decoder reads `.ldb` files and parses Protocol Buffers
378
+ 3. Database layer provides filtered access to transactions/accounts
379
+ 4. MCP tools expose functionality via Model Context Protocol
380
+ 5. Claude Desktop sends queries → MCP server responds
381
+
382
+ **Technical Stack:**
383
+ - **Runtime:** Node.js 18+ (ESM modules)
384
+ - **Language:** TypeScript 5.3+
385
+ - **Validation:** Zod schemas
386
+ - **Database:** LevelDB (classic-level) + Protocol Buffers
387
+ - **Testing:** Bun test runner (366 tests, 100% passing)
388
+ - **MCP SDK:** @modelcontextprotocol/sdk v1.2
389
+
390
+ ## Testing
391
+
392
+ ```bash
393
+ # Run all tests
394
+ npm test
395
+
396
+ # Watch mode
397
+ npm run test:watch
398
+
399
+ # Coverage report
400
+ npm run test:coverage
401
+ ```
402
+
403
+ **Test Coverage:**
404
+ - ✅ 366 tests passing
405
+ - ✅ 1360+ assertions
406
+ - ✅ Core decoder tests
407
+ - ✅ Database abstraction tests
408
+ - ✅ Tool implementation tests
409
+ - ✅ Schema validation tests
410
+ - ✅ Integration tests
411
+
412
+ ## Data Privacy & Security
413
+
414
+ **Read our full [Privacy Policy](PRIVACY.md)**
415
+
416
+ Key commitments:
417
+ - **No Data Transmission:** Zero network requests, all processing local
418
+ - **Read-Only Access:** Never modifies your Copilot Money database
419
+ - **No Telemetry:** No analytics, crash reports, or tracking
420
+ - **Open Source:** Verify privacy claims by reviewing the code
421
+ - **macOS Sandbox:** Respects macOS file system permissions
422
+
423
+ ## Supported Date Periods
424
+
425
+ The `period` parameter supports these shortcuts:
426
+ - `this_month` - Current month (Jan 1 - today if in January)
427
+ - `last_month` - Previous calendar month
428
+ - `last_7_days` - Rolling 7-day window
429
+ - `last_30_days` - Rolling 30-day window
430
+ - `last_90_days` - Rolling 90-day window
431
+ - `ytd` - Year-to-date (Jan 1 - today)
432
+ - `this_year` - Current calendar year
433
+ - `last_year` - Previous calendar year
434
+
435
+ ## Troubleshooting
436
+
437
+ ### Database Not Found
438
+
439
+ If you see "Database not available":
440
+ 1. Ensure Copilot Money is installed and has synced data
441
+ 2. Check database location: `~/Library/Containers/com.copilot.production/Data/Library/Application Support/firestore/__FIRAPP_DEFAULT/copilot-production-22904/main`
442
+ 3. Verify `.ldb` files exist in the directory
443
+ 4. Provide custom path: `copilot-money-mcp --db-path /path/to/database`
444
+
445
+ ### No Transactions Found
446
+
447
+ - Copilot Money may not have synced yet - open the app and wait for sync
448
+ - The database structure may have changed - open an issue with details
449
+
450
+ ## Contributing
451
+
452
+ Contributions welcome! Please:
453
+ 1. Fork the repository
454
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
455
+ 3. Commit changes (`git commit -m 'Add amazing feature'`)
456
+ 4. Push to branch (`git push origin feature/amazing-feature`)
457
+ 5. Open a Pull Request
458
+
459
+ ## License
460
+
461
+ MIT License - See [LICENSE](LICENSE) for details.
462
+
463
+ ## Acknowledgments
464
+
465
+ - Built with [MCP SDK](https://modelcontextprotocol.io/) by Anthropic
466
+ - Reverse engineering findings documented in [REVERSE_ENGINEERING_FINDING.md](docs/REVERSE_ENGINEERING_FINDING.md)
467
+ - Data validation with [Zod](https://zod.dev/)
468
+ - Developed with [Bun](https://bun.sh/) for fast TypeScript development
469
+
470
+ ## References
471
+
472
+ - [Model Context Protocol](https://modelcontextprotocol.io/)
473
+ - [Copilot Money](https://copilot.money/)
474
+ - [Privacy Policy](PRIVACY.md)
475
+ - [Reverse Engineering Findings](docs/REVERSE_ENGINEERING_FINDING.md)
476
+
477
+ ---
478
+
479
+ **⭐ Star this repo if you find it useful!**