@expensebot/mcp-server-auth 0.6.26 → 0.6.28
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 +63 -24
- package/package.json +4 -3
- package/scripts/description-parity.js +74 -0
- package/scripts/description-parity.test.js +95 -0
- package/scripts/sync-check.js +34 -1
- package/server.json +3 -3
- package/src/client.js +1 -1
- package/src/index.js +1105 -420
- package/src/onboarding.test.js +75 -0
- package/src/test.js +353 -6
package/README.md
CHANGED
|
@@ -6,16 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
# @expensebot/mcp-server-auth
|
|
8
8
|
|
|
9
|
-
Authenticated MCP (Model Context Protocol) server for [ExpenseBot](https://www.expensebot.ai).
|
|
9
|
+
Authenticated MCP (Model Context Protocol) server for [ExpenseBot](https://www.expensebot.ai), the pre-accounting evidence layer for AI workflows. Your agent stays the orchestrator; ExpenseBot gathers receipts and inbox documents, maintains reviewed source-linked records, and hands the result to the accountant or accounting system already in the workflow. Copilot, Gemini, Replit, Cursor, Claude Desktop, Claude Code, Continue, Cline, Windsurf, and other MCP-compatible assistants can search receipts, submit photos and PDFs, scan Gmail, create reports, and analyze spending using your real ExpenseBot account.
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
**65 tools** in the local source catalog (2026-11-01), including standalone tag creation and the queued
|
|
12
|
+
statement-status addition below; this is not npm publication or live acceptance.
|
|
13
|
+
Grouped across:
|
|
12
14
|
- **Search & analytics** — `search_expenses`, `get_spending_summary`, `get_deep_analytics`, `list_categories`, `list_tags`, `list_income_categories`, `search_knowledge`
|
|
13
15
|
- **Income & P&L** *(v0.6.0)* — `get_income_summary`, `get_pnl`, `get_per_tag_pnl`
|
|
14
16
|
- **Mileage & Subscriptions** *(v0.6.1)* — `get_mileage_summary`, `get_subscription_audit`
|
|
15
|
-
- **Receipt and expense capture** — `submit_receipt` (photo/PDF), `get_last_receipt_result`, `add_cash_expense` (including confirmed client advances), `add_mileage_entry`, `add_income`, `add_income_from_file` (screenshot/PDF, parse-preview-confirm), `add_income_from_csv` (CSV/TSV/text, parse-preview-confirm), `parse_expense`, `get_expense_by_id`, `update_expense`, `group_expenses`, `correct_expenses`, `get_spreadsheet_url`
|
|
17
|
+
- **Receipt and expense capture** — `submit_receipt` (photo/PDF), `get_last_receipt_result`, `add_cash_expense` (including confirmed client advances), `add_mileage_entry`, `add_income`, `add_income_from_file` (screenshot/PDF, parse-preview-confirm), `add_income_from_csv` (CSV/TSV/text, parse-preview-confirm), `parse_expense`, `get_expense_by_id`, `update_expense`, `group_expenses`, `create_tag`, `correct_expenses`, `get_spreadsheet_url`
|
|
16
18
|
- **Gmail** — `scan_gmail`, `process_gmail_receipts`, `scan_gmail_years`, `get_scan_status`
|
|
19
|
+
- **Setup (queued)** — `get_setup_status` (readiness), `complete_setup` (typed preview, explicit confirmation, status reconciliation; separate setup scopes)
|
|
20
|
+
- **Statement status (queued)** — `get_statement_import_status` (bounded read-only import/save activity; no extraction, recovery or financial write)
|
|
17
21
|
- **Reports & invoicing** — `create_report`, `list_reports`, `get_report_details`, `share_report`, `export_report`, `list_client_invoices`, `get_client_invoice`, `prepare_client_invoice`, `create_client_invoice`, `mark_client_invoice_paid`
|
|
18
|
-
- **Expense review** — `get_expense_splits`, `get_monthly_books_review`, `get_credits_refunds`, `get_client_advance_balances`, `get_trip_suggestions` (read-only exact trip proposals; grouping still requires confirmation)
|
|
22
|
+
- **Expense review** — `get_expense_splits`, `get_monthly_books_review`, `list_client_close_readiness` (accountant-only, categorical page summary and Client Reports handoff), `get_credits_refunds`, `get_client_advance_balances`, `get_trip_suggestions` (read-only exact trip proposals; grouping still requires confirmation)
|
|
19
23
|
- **Accounting destinations** — `get_accounting_integration_status`, `send_report_to_accounting`, `get_accounting_push_status`, `request_accounting_integration` (provider-neutral review/confirm/status contract plus a confirmed, deduplicated request for an unlisted package; agent-driven posting is currently enabled only for Zoho Books; QuickBooks Online, Xero, Wave, and FreeAgent (beta) are read-only status/push-status only until their canonical planning path is shared)
|
|
20
24
|
- **Compliance & tax** — `check_compliance`, `fix_compliance`, `check_tax_deductibility`
|
|
21
25
|
- **Activity, tracing & onboarding** — `get_recent_activity`, `trace_document`, `get_signup_link`, `get_pricing`, `check_feature`, `start_trial_link`
|
|
@@ -32,6 +36,41 @@ prepended. `update_expense` refuses zero or multiple exact matches.
|
|
|
32
36
|
|
|
33
37
|
**Period comparison** — All analytics tools (spending, income, P&L, per-tag P&L, mileage) accept YoY / MoM / QoQ / same-month-prev-year phrasing in the `query` field. Margin is rendered loss-aware (multiplier when expenses exceed revenue) so AI clients see "expenses 5.4× revenue" instead of "-436.9% margin".
|
|
34
38
|
|
|
39
|
+
### Queued read-only additions
|
|
40
|
+
|
|
41
|
+
Ask "Did my statement finish importing?" with `get_statement_import_status`.
|
|
42
|
+
There are no business args or job IDs to supply; accepted accountant
|
|
43
|
+
`clientEmail` uses the existing authorization resolver. Canonical statement
|
|
44
|
+
feature/entitlement/access gates run before and after reads. Discovery reads
|
|
45
|
+
50 + 1 candidates and polls at most five actor/owner-bound jobs, returning only
|
|
46
|
+
states/counts and stored creation timestamps. Saturation, missing evidence and
|
|
47
|
+
malformed counts stay partial/unknown; older non-job imports are not covered.
|
|
48
|
+
Extraction completion is review-ready, not saved. Save-job resolved rows include
|
|
49
|
+
Other activity, so use the separate saved income/expense counts; overlapping
|
|
50
|
+
jobs must not be summed or described as whole-statement completion. Owner links
|
|
51
|
+
open Review Expenses (with **Upload statements**); delegated links open the
|
|
52
|
+
Client Reports chooser. No raw rows, bank/source identities or storage URLs are
|
|
53
|
+
returned. This read never calls recovery/finalization (`getSaveStatus`), starts
|
|
54
|
+
work or writes financial data.
|
|
55
|
+
|
|
56
|
+
`get_report_details` also has a queued `checkFreshness:true` opt-in, requiring
|
|
57
|
+
`analysisRequested:true` for an explicit request about an existing Year-End
|
|
58
|
+
report being up to date, never an automatic step after creation, sharing or
|
|
59
|
+
billing. Default details stay unchanged. Canonical readers return `freshness`
|
|
60
|
+
with `status` (`current`, `outdated`, `unknown`, `not_applicable`), `checkedAt`,
|
|
61
|
+
`message` and `reportUrl`; accountant access revalidates after reads. Missing
|
|
62
|
+
sources stay unknown. Tax-required US/CA reports normally lack runtime replay,
|
|
63
|
+
so even expense-only changes remain unknown; income fingerprint mismatch can
|
|
64
|
+
prove outdated early. Current requires the full check with no missing enrichment
|
|
65
|
+
evidence. Five-second response bound; 32 Firestore requests/500 documents;
|
|
66
|
+
already-started income reads cannot be cancelled. No model calls or financial/
|
|
67
|
+
report/cache writes, regeneration or repair; normal OAuth refresh persistence
|
|
68
|
+
is allowed. Both additions remain queued, not serving-verified; see the
|
|
69
|
+
[implementation/release handoff](../docs/implementation-handoffs/2026-10-16-mcp-read-only-progress-and-freshness.md).
|
|
70
|
+
|
|
71
|
+
See `docs/architecture/statement-save-jobs.md` and
|
|
72
|
+
`docs/architecture/mcp-and-chat-tool-surface.md` for the owning contracts.
|
|
73
|
+
|
|
35
74
|
## Setup
|
|
36
75
|
|
|
37
76
|
**Full step-by-step instructions for every supported client live at:**
|
|
@@ -107,6 +146,8 @@ Streamable HTTP server for OAuth-capable clients and the npm stdio package for
|
|
|
107
146
|
local clients. Host directories may expose either or both depending on their
|
|
108
147
|
transport and authentication support.
|
|
109
148
|
|
|
149
|
+
Building your own MCP client? Follow the [ExpenseBot integrator setup guide](https://www.expensebot.ai/answers/mcp-integrator-setup) to register exact HTTPS callbacks, prove origin control and connect through OAuth. Existing approved integrations keep their current setup; every customer still signs in and consents.
|
|
150
|
+
|
|
110
151
|
## Token model
|
|
111
152
|
|
|
112
153
|
- **Personal Access Tokens (PAT)** scoped to your ExpenseBot account
|
|
@@ -118,7 +159,7 @@ transport and authentication support.
|
|
|
118
159
|
## Discovery
|
|
119
160
|
|
|
120
161
|
- **Official MCP Registry** — active as
|
|
121
|
-
`io.github.TotesMagotes/mcp-server-auth`; version `0.6.
|
|
162
|
+
`io.github.TotesMagotes/mcp-server-auth`; version `0.6.28` is the current
|
|
122
163
|
listing with both npm stdio and remote Streamable HTTP transports
|
|
123
164
|
- **awesome-mcp-servers** — Finance & Fintech section
|
|
124
165
|
- **Glama** — <https://glama.ai/mcp/servers/TotesMagotes/expensebot>
|
|
@@ -184,25 +225,23 @@ package's schema, local dispatch, or transport also changed.
|
|
|
184
225
|
|
|
185
226
|
## Publishing this package
|
|
186
227
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
Trusted
|
|
203
|
-
|
|
204
|
-
`publish-mcp-server-auth.yml`). Do not hand-publish with a personal token — npm is
|
|
205
|
-
removing direct-publish granular tokens in 2027, and OIDC is the supported path.
|
|
228
|
+
Publishing is a manual, local step (the former GitHub Actions OIDC workflow is
|
|
229
|
+
retired; nothing publishes automatically when `version` is bumped).
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# from a clean checkout at origin/master, after bumping "version" on master:
|
|
233
|
+
node scripts/publish-mcp-server-auth.cjs # runs every check, never publishes
|
|
234
|
+
node scripts/publish-mcp-server-auth.cjs --publish # same checks, then npm publish
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
The script refuses a dirty tree or a HEAD that is not `origin/master`, exits
|
|
238
|
+
quietly if that version is already on npm, then runs `scripts/runMcpChecks.cjs`
|
|
239
|
+
(tool-sync drift, `sync-check`, `src/test.js`, remote smoke tests) and
|
|
240
|
+
`npm pack --dry-run`. `--publish` needs an interactive `npm login` session with
|
|
241
|
+
2FA; `prepublishOnly` (`sync-check` + `src/test.js`) runs again inside
|
|
242
|
+
`npm publish`. npm attaches no build provenance (private repository). The npm
|
|
243
|
+
Trusted Publisher entry for `publish-mcp-server-auth.yml` is obsolete and can be
|
|
244
|
+
removed at npmjs.com -> package -> Settings.
|
|
206
245
|
|
|
207
246
|
## License
|
|
208
247
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expensebot/mcp-server-auth",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.28",
|
|
4
4
|
"mcpName": "io.github.TotesMagotes/mcp-server-auth",
|
|
5
|
-
"description": "ExpenseBot MCP server
|
|
5
|
+
"description": "ExpenseBot MCP server: the pre-accounting evidence layer for AI workflows, accountants, and ledgers.",
|
|
6
6
|
"homepage": "https://www.expensebot.ai/mcp",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -44,8 +44,9 @@
|
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"start": "node src/index.js",
|
|
47
|
-
"test": "node src/test.js",
|
|
47
|
+
"test": "node src/test.js && node --test src/onboarding.test.js",
|
|
48
48
|
"sync-check": "node scripts/sync-check.js",
|
|
49
|
+
"test:sync-parity": "node --test scripts/description-parity.test.js",
|
|
49
50
|
"gen-descriptions": "node scripts/generate-descriptions-from-kb.js",
|
|
50
51
|
"prepublishOnly": "node scripts/sync-check.js && node src/test.js"
|
|
51
52
|
},
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure description-parity comparison for the cross-surface MCP tool catalogs.
|
|
3
|
+
*
|
|
4
|
+
* The /mcp client inventory (`client/src/data/mcpTools.generated.json`) copies
|
|
5
|
+
* each tool description verbatim from the remote generated catalog
|
|
6
|
+
* (`mcp-server-remote/src/tools.generated.json`), which is itself generated
|
|
7
|
+
* from this package's TOOLS[]. So exact description equality is the intended
|
|
8
|
+
* invariant for every tool represented in both artifacts — no transform,
|
|
9
|
+
* truncation, or per-surface rewrite exists.
|
|
10
|
+
*
|
|
11
|
+
* This module holds ONLY the pure comparison + message formatting so it can be
|
|
12
|
+
* unit-tested deterministically. The CLI wiring lives in sync-check.js
|
|
13
|
+
* (section 8), which fails `npm run sync-check` when the artifacts drift.
|
|
14
|
+
*
|
|
15
|
+
* Never hand-edit either generated JSON; regenerate instead:
|
|
16
|
+
* cd mcp-server-remote && npm run sync-tools
|
|
17
|
+
* npm run build:mcp-tools (repo root)
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Compare tool descriptions for every tool represented in both catalogs.
|
|
22
|
+
*
|
|
23
|
+
* @param {Array<{name: string, description: string}>} clientTools
|
|
24
|
+
* @param {Array<{name: string, description: string}>} remoteTools
|
|
25
|
+
* @returns {{mismatches: Array<{name: string, clientDescription: string, remoteDescription: string}>, missingInRemote: string[]}}
|
|
26
|
+
*/
|
|
27
|
+
export function compareToolDescriptions(clientTools, remoteTools) {
|
|
28
|
+
const remoteByName = new Map(
|
|
29
|
+
(remoteTools || []).map((t) => [t.name, t.description])
|
|
30
|
+
);
|
|
31
|
+
const mismatches = [];
|
|
32
|
+
const missingInRemote = [];
|
|
33
|
+
|
|
34
|
+
for (const tool of clientTools || []) {
|
|
35
|
+
if (!remoteByName.has(tool.name)) {
|
|
36
|
+
missingInRemote.push(tool.name);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const remoteDescription = remoteByName.get(tool.name);
|
|
40
|
+
if (tool.description !== remoteDescription) {
|
|
41
|
+
mismatches.push({
|
|
42
|
+
name: tool.name,
|
|
43
|
+
clientDescription: tool.description,
|
|
44
|
+
remoteDescription,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return { mismatches, missingInRemote };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Format parity failures as the exact sync-check failure lines (one per
|
|
54
|
+
* mismatched/missing tool, always naming the tool).
|
|
55
|
+
*
|
|
56
|
+
* @param {{mismatches: Array<{name: string}>, missingInRemote: string[]}} result
|
|
57
|
+
* @param {string} [regenerateHint]
|
|
58
|
+
* @returns {string[]} failure lines, in tool order
|
|
59
|
+
*/
|
|
60
|
+
export function formatDescriptionParityFailures(result, regenerateHint) {
|
|
61
|
+
const hint = regenerateHint || "";
|
|
62
|
+
const lines = result.mismatches.map(
|
|
63
|
+
(m) =>
|
|
64
|
+
`client inventory description for "${m.name}" differs from the remote ` +
|
|
65
|
+
`generated catalog${hint ? " " + hint : ""}`
|
|
66
|
+
);
|
|
67
|
+
for (const name of result.missingInRemote || []) {
|
|
68
|
+
lines.push(
|
|
69
|
+
`client inventory tool "${name}" is missing from the remote generated ` +
|
|
70
|
+
`catalog${hint ? " " + hint : ""}`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return lines;
|
|
74
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Regression tests for the description-parity sync guard.
|
|
4
|
+
*
|
|
5
|
+
* Run: cd mcp-server-auth && npm run test:sync-parity
|
|
6
|
+
*
|
|
7
|
+
* Contract under test (scripts/description-parity.js, wired into
|
|
8
|
+
* `npm run sync-check` section 8):
|
|
9
|
+
* - exact description equality between the /mcp client inventory and the
|
|
10
|
+
* remote generated catalog passes for every overlapping tool;
|
|
11
|
+
* - a single-tool description mismatch fails and names that exact tool;
|
|
12
|
+
* - a client tool missing from the remote catalog fails and is named.
|
|
13
|
+
*
|
|
14
|
+
* Pure helper tests only — the CLI wiring (file parsing, fail()/exit path)
|
|
15
|
+
* is exercised by `npm run sync-check` against the committed artifacts.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import test from "node:test";
|
|
19
|
+
import assert from "node:assert/strict";
|
|
20
|
+
import {
|
|
21
|
+
compareToolDescriptions,
|
|
22
|
+
formatDescriptionParityFailures,
|
|
23
|
+
} from "./description-parity.js";
|
|
24
|
+
|
|
25
|
+
const REGEN_HINT =
|
|
26
|
+
"(regenerate with `cd mcp-server-remote && npm run sync-tools` then " +
|
|
27
|
+
"`npm run build:mcp-tools` and commit the generated files)";
|
|
28
|
+
|
|
29
|
+
function clientCatalog() {
|
|
30
|
+
return [
|
|
31
|
+
{ name: "trace_document", description: "Trace a document. Read-only." },
|
|
32
|
+
{ name: "scan_gmail", description: "Scan Gmail for receipts." },
|
|
33
|
+
{ name: "get_pnl", description: "Profit and loss summary." },
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function remoteCatalog() {
|
|
38
|
+
return [
|
|
39
|
+
{ name: "trace_document", description: "Trace a document. Read-only." },
|
|
40
|
+
{ name: "scan_gmail", description: "Scan Gmail for receipts." },
|
|
41
|
+
{ name: "get_pnl", description: "Profit and loss summary." },
|
|
42
|
+
{ name: "get_signup_link", description: "Commerce-only tool excluded remotely." },
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
test("equal descriptions for every overlapping tool pass", () => {
|
|
47
|
+
const result = compareToolDescriptions(clientCatalog(), remoteCatalog());
|
|
48
|
+
assert.deepEqual(result.mismatches, []);
|
|
49
|
+
assert.deepEqual(result.missingInRemote, []);
|
|
50
|
+
assert.deepEqual(formatDescriptionParityFailures(result, REGEN_HINT), []);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("a one-tool description mismatch fails naming exactly that tool", () => {
|
|
54
|
+
const remote = remoteCatalog();
|
|
55
|
+
// Simulate the observed drift class: a stdio description change synced into
|
|
56
|
+
// the remote manifest without regenerating the client inventory.
|
|
57
|
+
remote[0].description = "Trace a document. Read-only. NOT for scan status.";
|
|
58
|
+
const result = compareToolDescriptions(clientCatalog(), remote);
|
|
59
|
+
|
|
60
|
+
assert.equal(result.mismatches.length, 1, "exactly one mismatch reported");
|
|
61
|
+
assert.equal(result.mismatches[0].name, "trace_document");
|
|
62
|
+
assert.deepEqual(result.missingInRemote, []);
|
|
63
|
+
|
|
64
|
+
const lines = formatDescriptionParityFailures(result, REGEN_HINT);
|
|
65
|
+
assert.equal(lines.length, 1);
|
|
66
|
+
assert.match(lines[0], /"trace_document"/);
|
|
67
|
+
assert.match(lines[0], /differs from the remote generated catalog/);
|
|
68
|
+
assert.match(lines[0], /build:mcp-tools/);
|
|
69
|
+
// The two unaffected tools are not implicated.
|
|
70
|
+
assert.ok(!lines[0].includes("scan_gmail"));
|
|
71
|
+
assert.ok(!lines[0].includes("get_pnl"));
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("a client tool absent from the remote catalog is reported by name", () => {
|
|
75
|
+
const remote = remoteCatalog().filter((t) => t.name !== "get_pnl");
|
|
76
|
+
const result = compareToolDescriptions(clientCatalog(), remote);
|
|
77
|
+
|
|
78
|
+
assert.deepEqual(result.mismatches, []);
|
|
79
|
+
assert.deepEqual(result.missingInRemote, ["get_pnl"]);
|
|
80
|
+
const lines = formatDescriptionParityFailures(result, REGEN_HINT);
|
|
81
|
+
assert.equal(lines.length, 1);
|
|
82
|
+
assert.match(lines[0], /"get_pnl"/);
|
|
83
|
+
assert.match(lines[0], /missing from the remote generated catalog/);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test("mismatches and missing tools are both reported when combined", () => {
|
|
87
|
+
const remote = remoteCatalog().filter((t) => t.name !== "get_pnl");
|
|
88
|
+
remote[1].description = "Drifted Gmail scan description.";
|
|
89
|
+
const result = compareToolDescriptions(clientCatalog(), remote);
|
|
90
|
+
|
|
91
|
+
const lines = formatDescriptionParityFailures(result, REGEN_HINT);
|
|
92
|
+
assert.equal(lines.length, 2);
|
|
93
|
+
assert.match(lines[0], /"scan_gmail"/);
|
|
94
|
+
assert.match(lines[1], /"get_pnl"/);
|
|
95
|
+
});
|
package/scripts/sync-check.js
CHANGED
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
* 3. package.json — version
|
|
11
11
|
* 4. server.json — version (top-level + packages[].version)
|
|
12
12
|
* 5. src/client.js — User-Agent string version match
|
|
13
|
+
* 6. ../client/src/data/mcpTools.generated.json +
|
|
14
|
+
* ../mcp-server-remote/src/tools.generated.json — cross-surface count
|
|
15
|
+
* AND per-tool description parity (dormant; needs monorepo siblings,
|
|
16
|
+
* degrades to a warning when checked out standalone)
|
|
13
17
|
*
|
|
14
18
|
* Source of truth = src/index.js. README/package.json/server.json must
|
|
15
19
|
* agree with it. Add this to CI before publish to prevent the kind of
|
|
@@ -23,6 +27,10 @@ import crypto from "node:crypto";
|
|
|
23
27
|
import path from "node:path";
|
|
24
28
|
import { fileURLToPath } from "node:url";
|
|
25
29
|
import { createRequire } from "node:module";
|
|
30
|
+
import {
|
|
31
|
+
compareToolDescriptions,
|
|
32
|
+
formatDescriptionParityFailures,
|
|
33
|
+
} from "./description-parity.js";
|
|
26
34
|
|
|
27
35
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
28
36
|
const ROOT = path.resolve(__dirname, "..");
|
|
@@ -208,6 +216,7 @@ let clientStdioTotal = null;
|
|
|
208
216
|
let clientRemoteTotal = null;
|
|
209
217
|
let remoteManifestTotal = null;
|
|
210
218
|
let chatToolCount = null;
|
|
219
|
+
let descriptionParityChecked = null;
|
|
211
220
|
|
|
212
221
|
if (fs.existsSync(clientMetaPath) && fs.existsSync(remoteManifestPath)) {
|
|
213
222
|
const clientMeta = JSON.parse(fs.readFileSync(clientMetaPath, "utf8"));
|
|
@@ -263,6 +272,23 @@ if (fs.existsSync(clientMetaPath) && fs.existsSync(remoteManifestPath)) {
|
|
|
263
272
|
`excluded + 2 Deep Research shims)`
|
|
264
273
|
);
|
|
265
274
|
}
|
|
275
|
+
|
|
276
|
+
// 8b. Description parity for every tool represented in both generated
|
|
277
|
+
// artifacts. The client inventory copies each description verbatim from the
|
|
278
|
+
// remote catalog, so exact equality is the invariant. This catches text
|
|
279
|
+
// drift (e.g. a stdio description change whose `sync-tools` regeneration
|
|
280
|
+
// was committed without re-running `npm run build:mcp-tools`), which count
|
|
281
|
+
// checks cannot see.
|
|
282
|
+
const clientTools = (clientMeta.categories || []).flatMap((c) => c.tools || []);
|
|
283
|
+
const parity = compareToolDescriptions(clientTools, manifestTools);
|
|
284
|
+
for (const line of formatDescriptionParityFailures(
|
|
285
|
+
parity,
|
|
286
|
+
"(regenerate with `cd mcp-server-remote && npm run sync-tools` then " +
|
|
287
|
+
"`npm run build:mcp-tools` and commit the generated files)"
|
|
288
|
+
)) {
|
|
289
|
+
fail(line);
|
|
290
|
+
}
|
|
291
|
+
descriptionParityChecked = clientTools.length;
|
|
266
292
|
} else {
|
|
267
293
|
warn(
|
|
268
294
|
"Monorepo artifacts not found under ../ — skipping client/remote " +
|
|
@@ -275,7 +301,7 @@ if (fs.existsSync(clientMetaPath) && fs.existsSync(remoteManifestPath)) {
|
|
|
275
301
|
// expected value is pinned here and must be bumped in lockstep with
|
|
276
302
|
// docs/architecture/mcp-conversational-functionality-catalog.md "Current
|
|
277
303
|
// counts" whenever the in-app surface deliberately changes.
|
|
278
|
-
const EXPECTED_CHAT_TOOL_COUNT =
|
|
304
|
+
const EXPECTED_CHAT_TOOL_COUNT = 49;
|
|
279
305
|
if (fs.existsSync(chatDeclarationsPath)) {
|
|
280
306
|
try {
|
|
281
307
|
chatToolCount = require(chatDeclarationsPath).getChatToolDeclarations()
|
|
@@ -312,6 +338,13 @@ console.log(
|
|
|
312
338
|
);
|
|
313
339
|
console.log(`Client inventory: ${clientStdioTotal ?? "n/a"} stdio / ${clientRemoteTotal ?? "n/a"} remote`);
|
|
314
340
|
console.log(`Remote manifest: ${remoteManifestTotal ?? "n/a"} tools`);
|
|
341
|
+
console.log(
|
|
342
|
+
`Description parity: ${
|
|
343
|
+
descriptionParityChecked === null
|
|
344
|
+
? "n/a (monorepo artifacts absent)"
|
|
345
|
+
: `${descriptionParityChecked} overlapping tools checked`
|
|
346
|
+
}`
|
|
347
|
+
);
|
|
315
348
|
console.log(
|
|
316
349
|
`ChatWidget surface: ${chatToolCount ?? "n/a"} tools` +
|
|
317
350
|
(chatToolCount !== null ? ` (expected ${EXPECTED_CHAT_TOOL_COUNT})` : "")
|
package/server.json
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.TotesMagotes/mcp-server-auth",
|
|
4
4
|
"title": "ExpenseBot",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Pre-accounting evidence layer for AI workflows: gather receipts, inbox documents, and bank activity into reviewed records for accountants and ledgers.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/TotesMagotes/expensebot-mcp",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.6.
|
|
10
|
+
"version": "0.6.28",
|
|
11
11
|
"websiteUrl": "https://www.expensebot.ai/mcp",
|
|
12
12
|
"icons": [
|
|
13
13
|
{
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
{
|
|
29
29
|
"registryType": "npm",
|
|
30
30
|
"identifier": "@expensebot/mcp-server-auth",
|
|
31
|
-
"version": "0.6.
|
|
31
|
+
"version": "0.6.28",
|
|
32
32
|
"transport": {
|
|
33
33
|
"type": "stdio"
|
|
34
34
|
}
|
package/src/client.js
CHANGED
|
@@ -46,7 +46,7 @@ export class ExpenseBotClient {
|
|
|
46
46
|
headers: {
|
|
47
47
|
Authorization: `Bearer ${this.token}`,
|
|
48
48
|
"Content-Type": "application/json",
|
|
49
|
-
"User-Agent": "expensebot-mcp-auth/0.6.
|
|
49
|
+
"User-Agent": "expensebot-mcp-auth/0.6.28",
|
|
50
50
|
"X-ExpenseBot-MCP-Transport": "stdio",
|
|
51
51
|
...options.headers,
|
|
52
52
|
},
|