@ca-tax/mcp 0.0.0-stage → 0.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.
package/README.md CHANGED
@@ -1,3 +1,24 @@
1
- # Temporary Holding Version
1
+ # @ca-tax/mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Zero-dependency MCP server for Canadian Tax & Payroll calculations (JSON-RPC 2.0).
4
+
5
+ ```bash
6
+ npx @ca-tax/mcp --stdio # stdio transport
7
+ npx @ca-tax/mcp --http --port 8787 # Streamable HTTP: POST /mcp
8
+ npx @ca-tax/mcp --stdio --local-wasm # offline mode, zero outbound network
9
+ ```
10
+
11
+ ## Tools
12
+ - `ca_sales_tax_lookup`: Look up Canadian federal (GST) and provincial (PST/HST/QST) sales taxes by postal code / FSA. Supports effective dates (e.g. Nova Scotia HST change on `2025-04-01`), bilingual labels (`lang=en|fr`), and border ambiguity flags.
13
+ - `ca_payroll_deductions`: Calculate exact Canadian payroll deductions according to CRA T4127 and Revenu Québec TP-1015.G. Handles CPP/CPP2, QPP/QPP2, EI (federal and reduced QC), QPIP, federal abatement (16.5% for QC), and employer contributions (FSS, CNESST, CNT).
14
+
15
+ ## Remote mode
16
+ Forwards to `https://api.exactrows.com` using `EXACTROWS_API_KEY` (override base with `EXACTROWS_API_BASE`).
17
+ - `ca_sales_tax_lookup` -> `GET /v1/ca/sales-tax?postal=...&effectiveDate=...&lang=...`
18
+ - `ca_payroll_deductions` -> `POST /v1/ca/payroll/deductions`
19
+
20
+ ## Offline mode (`--local-wasm`)
21
+ Executes the deterministic Canadian tax and payroll engine in-process with zero network egress (`fetch` is never called).
22
+
23
+ ## SBOM
24
+ See `sbom.cdx.json` (CycloneDX 1.5): zero runtime npm dependencies.
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ // @ca-tax/mcp entrypoint. Node 22+ (type stripping or standalone bundle).
3
+ // Usage: ca-tax-mcp [--stdio|--http] [--port N] [--local-wasm]
4
+ const args = process.argv.slice(2);
5
+ const flag = (n) => args.includes(n);
6
+ const val = (n, d) => (args.includes(n) ? args[args.indexOf(n) + 1] : d);
7
+
8
+ if (flag('--help') || flag('-h')) {
9
+ console.log(`Canadian Tax & Payroll MCP Server (@ca-tax/mcp)
10
+ Usage: ca-tax-mcp [--stdio|--http] [--port <port>] [--local-wasm]
11
+
12
+ Options:
13
+ --stdio Run MCP JSON-RPC 2.0 server over stdio (default)
14
+ --http Run Streamable HTTP MCP server (POST /mcp)
15
+ --port <port> Port for HTTP mode (default: $PORT or 8787)
16
+ --local-wasm Offline mode with in-process engine (zero network egress)
17
+ -h, --help Show this help message`);
18
+ process.exit(0);
19
+ }
20
+
21
+ const { createHttpServer, runStdio } = await import(new URL('../bundle/server.mjs', import.meta.url).href);
22
+
23
+ const env = process.env;
24
+ const opts = {
25
+ localWasm: flag('--local-wasm'),
26
+ env,
27
+ apiBase: env.EXACTROWS_API_BASE,
28
+ apiKey: env.EXACTROWS_API_KEY,
29
+ };
30
+
31
+ if (flag('--http')) {
32
+ const port = Number(val('--port', env.PORT ?? '8787'));
33
+ createHttpServer(opts).listen(port, '127.0.0.1', () => console.error(`ca-tax-mcp listening on http://127.0.0.1:${port}/mcp`));
34
+ } else {
35
+ await runStdio(opts);
36
+ }