easybill-mcp 1.0.0 → 1.0.1
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 +23 -1
- package/dist/constants.d.ts +5 -1
- package/dist/constants.js +16 -1
- package/dist/constants.js.map +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ npm run smoke
|
|
|
44
44
|
It makes five read-only calls and prints what came back:
|
|
45
45
|
|
|
46
46
|
```
|
|
47
|
-
easybill-mcp-server v1.
|
|
47
|
+
easybill-mcp-server v1.x.y self-test
|
|
48
48
|
API: https://api.easybill.de/rest/v1
|
|
49
49
|
Throttle: 60 req/min | writes disabled
|
|
50
50
|
|
|
@@ -318,11 +318,33 @@ spelling or page through and match locally.
|
|
|
318
318
|
```bash
|
|
319
319
|
npm run build # compile to dist/
|
|
320
320
|
npm run typecheck # tsc --noEmit
|
|
321
|
+
npm test # offline suite — 37 tests, no credentials needed
|
|
322
|
+
npm run test:live # read-only tests against a real account (needs .env)
|
|
323
|
+
npm run test:all # both
|
|
321
324
|
npm run dev # watch mode
|
|
322
325
|
npm run smoke # read-only self-test against the live API (needs .env)
|
|
323
326
|
npm run inspect # MCP Inspector against the built server (needs .env)
|
|
324
327
|
```
|
|
325
328
|
|
|
329
|
+
### Tests
|
|
330
|
+
|
|
331
|
+
`npm test` runs offline and needs no easybill account — it covers response shaping,
|
|
332
|
+
the HTTP client against a mock API, the rate-limit throttle, and the MCP surface
|
|
333
|
+
(schemas, annotations, write-gating, error handling) driven over the real stdio protocol.
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
test/
|
|
337
|
+
├── helpers/mcp-client.mjs minimal MCP stdio client + mock API server
|
|
338
|
+
├── format.test.mjs field selection, pagination, truncation, markdown
|
|
339
|
+
├── client.test.mjs auth headers, query serialisation, 429 retry, error mapping
|
|
340
|
+
├── rate-limit.test.mjs sliding-window throttle
|
|
341
|
+
├── server.test.mjs tool registration, workflow guidance, validation, errors
|
|
342
|
+
└── live.test.mjs optional: read-only checks against a real account
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
`live.test.mjs` skips itself unless `EASYBILL_API_KEY` is set, so contributors without an
|
|
346
|
+
account still get a green suite. It only reads — nothing in the test suite writes to easybill.
|
|
347
|
+
|
|
326
348
|
Project layout:
|
|
327
349
|
|
|
328
350
|
```
|
package/dist/constants.d.ts
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
/** Overridable so the server can be pointed at a proxy or a test double. */
|
|
3
3
|
export declare const API_BASE_URL: string;
|
|
4
4
|
export declare const SERVER_NAME = "easybill-mcp-server";
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Read from package.json rather than duplicated here, so `--version`, the MCP
|
|
7
|
+
* serverInfo and the published package can never disagree.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SERVER_VERSION: string;
|
|
6
10
|
/** Maximum characters in a single tool response before it gets truncated. */
|
|
7
11
|
export declare const CHARACTER_LIMIT: number;
|
|
8
12
|
/** HTTP request timeout. */
|
package/dist/constants.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
/** Shared constants and runtime configuration for the easybill MCP server. */
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
/** Overridable so the server can be pointed at a proxy or a test double. */
|
|
3
4
|
export const API_BASE_URL = (process.env.EASYBILL_BASE_URL?.trim() || "https://api.easybill.de/rest/v1").replace(/\/+$/, "");
|
|
4
5
|
export const SERVER_NAME = "easybill-mcp-server";
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Read from package.json rather than duplicated here, so `--version`, the MCP
|
|
8
|
+
* serverInfo and the published package can never disagree.
|
|
9
|
+
*/
|
|
10
|
+
export const SERVER_VERSION = (() => {
|
|
11
|
+
try {
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
// dist/constants.js -> ../package.json
|
|
14
|
+
const pkg = require("../package.json");
|
|
15
|
+
return pkg.version ?? "0.0.0";
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return "0.0.0";
|
|
19
|
+
}
|
|
20
|
+
})();
|
|
6
21
|
function intFromEnv(name, fallback, min) {
|
|
7
22
|
const raw = process.env[name];
|
|
8
23
|
if (!raw)
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAE9E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,iCAAiC,CAC3E,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEtB,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAE9E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,iCAAiC,CAC3E,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEtB,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,CAAC,GAAG,EAAE;IAC1C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,uCAAuC;QACvC,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAyB,CAAC;QAC/D,OAAO,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,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;QACjB,eAAe;KAChB;IACD,OAAO,EAAE;QACP,IAAI;QACJ,aAAa;QACb,QAAQ;QACR,YAAY;QACZ,MAAM;QACN,UAAU;QACV,WAAW;QACX,QAAQ;QACR,gBAAgB;QAChB,UAAU;KACX;IACD,YAAY,EAAE;QACZ,IAAI;QACJ,QAAQ;QACR,aAAa;QACb,cAAc;QACd,cAAc;QACd,aAAa;QACb,aAAa;QACb,aAAa;QACb,YAAY;QACZ,YAAY;QACZ,UAAU;KACX;IACD,UAAU,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,CAAC;IACjG,IAAI,EAAE;QACJ,IAAI;QACJ,MAAM;QACN,QAAQ;QACR,gBAAgB;QAChB,UAAU;QACV,UAAU;QACV,UAAU;QACV,QAAQ;QACR,WAAW;QACX,aAAa;QACb,YAAY;QACZ,UAAU;KACX;IACD,KAAK,EAAE;QACL,IAAI;QACJ,aAAa;QACb,aAAa;QACb,MAAM;QACN,WAAW;QACX,YAAY;QACZ,aAAa;QACb,sBAAsB;KACvB;IACD,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC;IACnD,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,CAAC;IACtE,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,CAAC;IAC5F,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,CAAC;CACpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easybill-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "MCP server for the easybill REST API (invoices, customers, articles, payments, time tracking)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"start": "node dist/index.js",
|
|
19
19
|
"dev": "tsx watch src/index.ts",
|
|
20
20
|
"typecheck": "tsc --noEmit",
|
|
21
|
+
"test": "npm run build && node --test test/format.test.mjs test/client.test.mjs test/rate-limit.test.mjs test/server.test.mjs",
|
|
22
|
+
"test:live": "npm run build && node --env-file=.env --test test/live.test.mjs",
|
|
23
|
+
"test:all": "npm run test && npm run test:live",
|
|
21
24
|
"smoke": "node --env-file=.env dist/index.js --selftest",
|
|
22
25
|
"inspect": "npx @modelcontextprotocol/inspector node --env-file=.env dist/index.js",
|
|
23
26
|
"clean": "rm -rf dist"
|