@kirjapro/mcp-server 0.3.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0] - 2026-03-28
4
+
5
+ ### Added
6
+
7
+ - **Recurring invoices CRUD** — 6 tools: `kirjapro_list_recurring_invoices`, `kirjapro_get_recurring_invoice`, `kirjapro_create_recurring_invoice`, `kirjapro_update_recurring_invoice`, `kirjapro_delete_recurring_invoice`, `kirjapro_trigger_recurring_invoice` for managing recurring invoice templates with weekly/monthly/quarterly/yearly scheduling
8
+ - **Received invoices (read-only)** — 2 tools: `kirjapro_list_received_invoices`, `kirjapro_get_received_invoice` for viewing purchase invoices with status, sender, and amount filters
9
+ - **PRH business lookup** — `kirjapro_lookup_business` tool to look up Finnish companies by Y-tunnus from PRH (Patent and Registration Office), returns official name, address, company form
10
+ - **ALV summary report** — `kirjapro_get_alv_summary` tool for VAT return preparation with output/input VAT breakdown by rate and OmaVero field codes (301-320)
11
+ - `invokeEdgeFunction()` utility for consistent, typed edge function invocation with error handling across all tools
12
+ - **Typed Supabase client** — generated `database.types.ts` from production schema, wired `createClient<Database>()`. Removes all `as unknown as T` casts from tool files (reports, transactions, customers) — queries are now type-safe end-to-end
13
+ - **Finnish compliance resources** — 5 new MCP resources exposing compliance knowledge: `kirjapro://compliance/vat` (rates, deduction rules, reverse charge, common mistakes), `kirjapro://compliance/invoicing` (AVL 209 e § 17 mandatory fields, hyvityslasku rules), `kirjapro://compliance/deadlines` (verokausi thresholds, filing periods, pienyrittäjä 20K€ threshold), `kirjapro://compliance/social-insurance` (2026 TyEL/sotu/TTV rates), `kirjapro://compliance/bookkeeping` (KPL requirements, retention periods, company size classification)
14
+ - Enhanced tool descriptions with compliance context: VAT rate rules on `kirjapro_book_purchase`, filing deadline info on `kirjapro_get_alv_summary` and `kirjapro_book_vat_settlement`
15
+ - Enhanced `kirjapro://vat-rates` resource with legal basis citations (AVL §) and rate change history
16
+
17
+ ## [0.4.0] - 2026-03-28
18
+
19
+ ### Fixed
20
+
21
+ - **search_transactions pagination bug** — amount filters no longer cause unbounded fetches of all transactions into memory. Fetches are capped at 1000 rows, pagination (`total_count`, `has_more`) now works correctly with amount-filtered results
22
+ - **Error message data exposure** — all Supabase/PostgREST errors are now sanitized before returning to MCP clients. Known error codes map to safe messages; unknown errors have table names, constraint names, and column names stripped. Raw errors are logged to stderr for debugging
23
+ - **Report query safety caps** — dashboard, income statement, and balance sheet queries are capped at 50,000 journal entries to prevent memory exhaustion on large datasets. A warning is included in the response if the cap is reached
24
+
25
+ ### Added
26
+
27
+ - `sanitizeDbError()` utility for consistent, safe error message handling across all tools
28
+
29
+ ## [0.3.0] - 2026-03-06
30
+
31
+ ### Added
32
+
33
+ - **Transaction templates** — 3 tools: `kirjapro_list_templates`, `kirjapro_create_from_template`, `kirjapro_create_from_template_batch` for common Finnish bookkeeping patterns (cash/bank sales, purchases, rent, salary, bank transfer) with automatic VAT splitting
34
+ - **Domain-specific booking tools** — 3 tools: `kirjapro_book_purchase` (with reverse charge and edustus support), `kirjapro_book_salary` (2-transaction salary with 2026 Finnish social insurance rates), `kirjapro_book_vat_settlement` (automatic ALV-tilitys from journal entries)
35
+ - **Offers & contracts** — 5 tools: `kirjapro_list_offers`, `kirjapro_get_offer`, `kirjapro_create_offer`, `kirjapro_update_offer_status`, `kirjapro_delete_offer` with status state machine and event logging
36
+ - Auto-resolve fiscal year when `fiscalYearId` is omitted (uses the single open fiscal year)
37
+ - Account overrides for templates (e.g. swap bank account `{"2320": "2330"}`)
38
+
39
+ ### Fixed
40
+
41
+ - Invoice number generation uses advisory-locked RPC to prevent race conditions
42
+ - Invoice delete now handles existing payments on draft invoices
43
+ - Missing `company_id` scoping on invoice/bank transaction update mutations
44
+ - Partial payment now correctly transitions invoice status to `partial`
45
+ - Bank transaction matching now sets `partial` status for incomplete payments
46
+ - VAT settlement date clamped to fiscal year end to prevent out-of-range errors
47
+ - Offer/customer queries use `.maybeSingle()` to prevent PGRST116 on empty results
48
+
3
49
  ## [0.2.0] - 2026-02-19
4
50
 
5
51
  ### Added
package/README.md CHANGED
@@ -76,7 +76,7 @@ In Claude Code, run `/mcp` to see the available Kirjapro tools.
76
76
 
77
77
  *Either `KIRJAPRO_API_KEY` or all three legacy variables must be set.
78
78
 
79
- ## Tools (28)
79
+ ## Tools (40)
80
80
 
81
81
  ### Read Tools
82
82
 
@@ -98,6 +98,9 @@ In Claude Code, run `/mcp` to see the available Kirjapro tools.
98
98
  | `kirjapro_get_balance_sheet` | Balance sheet (tase) as of a specific date |
99
99
  | `kirjapro_get_ar_aging` | Accounts receivable aging (0-30, 31-60, 61-90, 90+ days) |
100
100
  | `kirjapro_get_general_ledger` | General ledger (pääkirja) for one account with running balance |
101
+ | `kirjapro_list_templates` | List transaction templates for common bookkeeping patterns |
102
+ | `kirjapro_list_offers` | List offers/contracts with customer names |
103
+ | `kirjapro_get_offer` | Get offer detail with lines, events, and VAT breakdown |
101
104
 
102
105
  ### Write Tools
103
106
 
@@ -112,6 +115,15 @@ In Claude Code, run `/mcp` to see the available Kirjapro tools.
112
115
  | `kirjapro_update_invoice_status` | Update invoice status with state machine validation |
113
116
  | `kirjapro_delete_invoice` | Delete draft invoices (audit-safe) |
114
117
  | `kirjapro_match_bank_transaction` | Match bank transaction to an invoice |
118
+ | `kirjapro_create_from_template` | Create transaction from template with VAT splitting |
119
+ | `kirjapro_create_from_template_batch` | Bulk create from templates (up to 50) |
120
+ | `kirjapro_book_sale` | Book a sale with automatic VAT splitting (invoice/cash/prepaid) |
121
+ | `kirjapro_book_purchase` | Book a purchase with VAT, reverse charge, or edustus |
122
+ | `kirjapro_book_salary` | Book salary with 2026 Finnish social insurance rates |
123
+ | `kirjapro_book_vat_settlement` | Book ALV-tilitys from journal entries |
124
+ | `kirjapro_create_offer` | Create offer/contract with auto-generated number |
125
+ | `kirjapro_update_offer_status` | Update offer status with state machine validation |
126
+ | `kirjapro_delete_offer` | Delete draft offers/contracts |
115
127
 
116
128
  ### Validation Tools
117
129
 
@@ -147,8 +159,8 @@ Releases are automated via GitHub Actions. To publish:
147
159
 
148
160
  1. Update version in `package.json`, `server.json`, and `src/index.ts`
149
161
  2. Update `CHANGELOG.md`
150
- 3. Commit and tag: `git tag mcp-server/v0.2.0`
151
- 4. Push: `git push origin mcp-server/v0.2.0`
162
+ 3. Commit and tag: `git tag mcp-server/v0.3.0`
163
+ 4. Push: `git push origin mcp-server/v0.3.0`
152
164
 
153
165
  The workflow validates version consistency, runs tests, publishes to npm, and creates a GitHub Release.
154
166