@kirjapro/mcp-server 0.14.1 → 0.15.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
@@ -2,9 +2,47 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.15.0] - 2026-10-06
6
+
7
+ Uses the database migration `20261006140000` (AI-työtila HQ U-49/U-50). Only the
8
+ `kirjapro_record_payment` definition and fingerprint change. 0.14.2 and every earlier
9
+ published version keep working against the new database: their payments debit the
10
+ receiving bank ledger account that the database derives, and an equal bank-matched
11
+ receipt is refused with the database's Finnish reason after "Failed to record
12
+ payment:". Against a database without the migration, a call without the two new
13
+ inputs books as in 0.14.2, and a call with `bankAccountId` or `confirmDuplicate`
14
+ fails with "Failed to record payment".
15
+
16
+ - `kirjapro_record_payment` takes an optional `bankAccountId` (an id from
17
+ `kirjapro_list_bank_accounts`); pass it when known. The payment voucher debits
18
+ that bank account's ledger account (its mapped 2920–2999 account, else 2920); an
19
+ inactive bank account is refused with `INACTIVE_BANK_ACCOUNT: <Finnish reason>`. Without it the database debits the one ledger
20
+ account every active bank account of the company maps to, else 2920 as before. The result adds `bank_gl_account_number`, the debited account.
21
+ - A payment equal to a receipt of the same invoice that is already matched or linked
22
+ from the bank statement (the bank line dated 120 days before to 31 days after the
23
+ payment) is refused with `DUPLICATE_BANK_RECEIPT: <reason> If the user confirms
24
+ this is a separate receipt, call again with confirmDuplicate: true and a new
25
+ idempotencyKey.` The optional `confirmDuplicate: true` books such a separate
26
+ receipt; use it only after this refusal and the user's confirmation.
27
+
28
+ ## [0.14.2] - 2026-10-06
29
+
30
+ A maintenance release: no tool definition, fingerprint, input, command or result
31
+ changes. 0.14.1 and every earlier published version keep working unchanged.
32
+
33
+ - Internal: the bundled invoice-draft core (`src/shared/invoice-draft.ts`) is now
34
+ generated from the same source as Kirjapro's own invoice-draft core; no behaviour
35
+ change.
36
+ - In Kirjapro (no client update needed): each invoice an API key creates, with
37
+ `kirjapro_create_invoice` or `kirjapro_convert_offer_to_invoice`, gets one
38
+ `mcp_invoice_created` audit entry naming the key. This applies to every published
39
+ version once Kirjapro's database has the change.
40
+
5
41
  ## [0.14.1] - 2026-10-05
6
42
 
7
- Uses the database migration `20261005210000` (AI-työtila 2.0 round 4, batch 7).
43
+ Published on 2026-10-06 by tag `mcp-server/v0.14.1` from `7437e2a2` (the PR #426
44
+ merge), after `db:deploy` of `20261005210000` and `20261005230000`. Uses the database
45
+ migration `20261005210000` (AI-työtila 2.0 round 4, batch 7).
8
46
  Against a database without it the refusal keeps the 0.14.0 text. 0.14.0 keeps
9
47
  working against the new database and reports such a key as "Permission denied."
10
48
  Tool definitions are unchanged.
package/dist/index.js CHANGED
@@ -35679,7 +35679,7 @@ var StdioServerTransport = class {
35679
35679
  import { createClient } from "@supabase/supabase-js";
35680
35680
 
35681
35681
  // src/version.ts
35682
- var VERSION = "0.14.1";
35682
+ var VERSION = "0.15.0";
35683
35683
 
35684
35684
  // src/auth.ts
35685
35685
  var SUPABASE_PROJECT_URL = "https://tifewzsimmyoiepblhld.supabase.co";
@@ -37990,7 +37990,7 @@ function registerInvoiceTools(server2) {
37990
37990
  server2.registerTool(
37991
37991
  "kirjapro_record_payment",
37992
37992
  {
37993
- description: 'Record a payment against an invoice after signed payments and finalized credits. Rejects credit notes and invoices with no payable balance. Returns the actual cash-derived status and signed remaining balance; credit plus cash settlement can remain "partial". Returns posting warnings if the receivable\u2192bank journal is skipped.',
37993
+ description: 'Record a payment against an invoice after signed payments and finalized credits. Rejects credit notes and invoices with no payable balance. Returns the actual cash-derived status and signed remaining balance; credit plus cash settlement can remain "partial". The receivable\u2192bank journal debits the ledger account of the receiving bank account (bank_gl_account_number): pass the id of the receiving bank account as bankAccountId when known (from kirjapro_list_bank_accounts). Refuses with DUPLICATE_BANK_RECEIPT when an equal receipt of the invoice is already matched or linked from the bank statement. Returns posting warnings if the journal is skipped.',
37994
37994
  inputSchema: {
37995
37995
  invoiceId: external_exports.string().uuid().describe("Invoice UUID"),
37996
37996
  paymentDate: ISO_DATE_SCHEMA.describe("Payment date (YYYY-MM-DD)"),
@@ -38001,6 +38001,12 @@ function registerInvoiceTools(server2) {
38001
38001
  paymentMethod: external_exports.enum(["bank_transfer", "cash", "card", "other"]).default("bank_transfer").describe("Payment method (one of: bank_transfer, cash, card, other)"),
38002
38002
  reference: external_exports.string().max(140).optional().describe("Payment reference"),
38003
38003
  notes: external_exports.string().max(2e3).optional().describe("Payment notes"),
38004
+ bankAccountId: external_exports.string().uuid().optional().describe(
38005
+ "The receiving bank account's id, when known (from kirjapro_list_bank_accounts). Its ledger account is debited; an inactive bank account is refused. Without it the database derives the ledger account."
38006
+ ),
38007
+ confirmDuplicate: external_exports.boolean().optional().describe(
38008
+ "Set true only after this tool reported DUPLICATE_BANK_RECEIPT (an equal bank-matched receipt) and the user confirmed this is a separate payment. Use a new idempotencyKey."
38009
+ ),
38004
38010
  idempotencyKey: IDEMPOTENCY_KEY_SCHEMA
38005
38011
  },
38006
38012
  annotations: WRITE_ANNOTATIONS
@@ -38074,7 +38080,11 @@ function registerInvoiceTools(server2) {
38074
38080
  p_amount: params.amount,
38075
38081
  p_payment_method: params.paymentMethod,
38076
38082
  p_reference: params.reference || void 0,
38077
- p_notes: params.notes || void 0
38083
+ p_notes: params.notes || void 0,
38084
+ // Sent only when set: the original seven arguments keep working
38085
+ // against a database without the receiving bank account.
38086
+ ...params.bankAccountId ? { p_bank_account_id: params.bankAccountId } : {},
38087
+ ...params.confirmDuplicate ? { p_confirm_duplicate: true } : {}
38078
38088
  }
38079
38089
  );
38080
38090
  if (isWriteOutcomeUnknown(payError, payStatus)) {
@@ -38083,6 +38093,14 @@ function registerInvoiceTools(server2) {
38083
38093
  "kirjapro_get_invoice (its payments and remaining_balance)"
38084
38094
  );
38085
38095
  }
38096
+ if (payError?.hint === "confirm_duplicate") {
38097
+ return toErrorContent(
38098
+ `DUPLICATE_BANK_RECEIPT: ${payError.message} If the user confirms this is a separate receipt, call again with confirmDuplicate: true and a new idempotencyKey.`
38099
+ );
38100
+ }
38101
+ if (payError?.message?.startsWith("Pankkitili ei ole k\xE4yt\xF6ss\xE4")) {
38102
+ return toErrorContent(`INACTIVE_BANK_ACCOUNT: ${payError.message}`);
38103
+ }
38086
38104
  if (payError || !paymentResult) {
38087
38105
  return toErrorContent(
38088
38106
  payError ? sanitizeDbError("Failed to record payment", payError) : "Failed to record payment."
@@ -38097,6 +38115,7 @@ function registerInvoiceTools(server2) {
38097
38115
  remaining_balance: result.remaining_balance,
38098
38116
  journal_entry_id: result.journal_entry_id ?? null,
38099
38117
  journal_entry_skipped: journalSkipped,
38118
+ bank_gl_account_number: result.bank_gl_account_number ?? null,
38100
38119
  ...journalSkipped && {
38101
38120
  warning: `Payment recorded, but the general-ledger journal entry was SKIPPED (reason: ${journalSkipped}). The subledger reflects the payment; the GL does not. Review the accounting setup and the missing posting.`
38102
38121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirjapro/mcp-server",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "description": "MCP server for Finnish accounting — exposes Kirjapro bookkeeping, invoicing, and reporting tools to Claude, ChatGPT, Mistral, and other MCP clients.",
5
5
  "type": "module",
6
6
  "bin": {
package/server.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@kirjapro/mcp-server",
3
3
  "displayName": "Kirjapro - Finnish Accounting",
4
4
  "description": "Finnish double-entry bookkeeping, invoicing, and financial reporting for growing businesses. Create transactions, generate invoices with VAT calculation, produce income statements and balance sheets, and validate Finnish business identifiers.",
5
- "version": "0.14.1",
5
+ "version": "0.15.0",
6
6
  "homepage": "https://kirjapro.fi",
7
7
  "repository": "https://github.com/Jaollo/kirja-pro",
8
8
  "license": "MIT",
@@ -178,7 +178,7 @@
178
178
  },
179
179
  {
180
180
  "name": "kirjapro_record_payment",
181
- "hash": "271c3895f65db17e"
181
+ "hash": "d330f22c10187dca"
182
182
  },
183
183
  {
184
184
  "name": "kirjapro_search_transactions",