@exactrows/mcp 0.0.0-stage → 0.2.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
+ # @exactrows/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 ExactRows (JSON-RPC 2.0).
4
+
5
+ ```
6
+ npx @exactrows/mcp --stdio # stdio transport
7
+ npx @exactrows/mcp --http --port 8787 # Streamable HTTP: POST /mcp
8
+ npx @exactrows/mcp --stdio --local-wasm # offline mode, zero outbound network
9
+ ```
10
+
11
+ Tools: `exactrows_qbo_validate`, `exactrows_qbo_repair`, `exactrows_qbo_generate`, `exactrows_qbo_diff_dedupe`, `exactrows_reconcile_verify`, `exactrows_csv_normalize`, `exactrows_verify_receipt`.
12
+ Tool arguments are the corresponding `/v1/...` request bodies.
13
+
14
+ ## Remote mode
15
+ Forwards to `https://api.exactrows.com` using `EXACTROWS_API_KEY` (override base with `EXACTROWS_API_BASE`).
16
+
17
+ ## Offline mode (`--local-wasm`)
18
+ Runs the deterministic ExactRows modules in-process; no `fetch` is ever called. Requires an Ed25519-signed license token:
19
+ `EXACTROWS_LICENSE_TOKEN`, `EXACTROWS_LICENSE_PUBLIC_KEY` (base64 raw/SPKI), optional `EXACTROWS_LICENSE_LAST_ONLINE` (ISO date of last online check).
20
+
21
+ Grace: online/≤7 days offline = active; day 8-30 = grace with warning; day 31+ = rejected. Tampered signatures are always rejected.
22
+
23
+ ## SBOM
24
+ See `sbom.cdx.json` (CycloneDX 1.5): no runtime npm dependencies.
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ // @exactrows/mcp entrypoint. Node 22+ (type stripping or standalone bundle).
3
+ // Usage: exactrows-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(`ExactRows MCP Server (@exactrows/mcp)
10
+ Usage: exactrows-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
+ licenseToken: env.EXACTROWS_LICENSE_TOKEN,
28
+ licensePublicKey: env.EXACTROWS_LICENSE_PUBLIC_KEY,
29
+ lastOnlineAt: env.EXACTROWS_LICENSE_LAST_ONLINE ? Date.parse(env.EXACTROWS_LICENSE_LAST_ONLINE) : null,
30
+ apiBase: env.EXACTROWS_API_BASE,
31
+ apiKey: env.EXACTROWS_API_KEY,
32
+ };
33
+
34
+ if (flag('--http')) {
35
+ const port = Number(val('--port', env.PORT ?? '8787'));
36
+ createHttpServer(opts).listen(port, '127.0.0.1', () => console.error(`exactrows-mcp listening on http://127.0.0.1:${port}/mcp`));
37
+ } else {
38
+ await runStdio(opts);
39
+ }