easybill-mcp 1.0.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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +373 -0
  3. package/dist/constants.d.ts +50 -0
  4. package/dist/constants.js +204 -0
  5. package/dist/constants.js.map +1 -0
  6. package/dist/index.d.ts +17 -0
  7. package/dist/index.js +154 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/instructions.d.ts +11 -0
  10. package/dist/instructions.js +89 -0
  11. package/dist/instructions.js.map +1 -0
  12. package/dist/schemas/common.d.ts +44 -0
  13. package/dist/schemas/common.js +59 -0
  14. package/dist/schemas/common.js.map +1 -0
  15. package/dist/services/client.d.ts +57 -0
  16. package/dist/services/client.js +258 -0
  17. package/dist/services/client.js.map +1 -0
  18. package/dist/services/format.d.ts +70 -0
  19. package/dist/services/format.js +158 -0
  20. package/dist/services/format.js.map +1 -0
  21. package/dist/tools/catalog.d.ts +4 -0
  22. package/dist/tools/catalog.js +74 -0
  23. package/dist/tools/catalog.js.map +1 -0
  24. package/dist/tools/crud.d.ts +51 -0
  25. package/dist/tools/crud.js +152 -0
  26. package/dist/tools/crud.js.map +1 -0
  27. package/dist/tools/customers.d.ts +4 -0
  28. package/dist/tools/customers.js +91 -0
  29. package/dist/tools/customers.js.map +1 -0
  30. package/dist/tools/documents.d.ts +8 -0
  31. package/dist/tools/documents.js +326 -0
  32. package/dist/tools/documents.js.map +1 -0
  33. package/dist/tools/files.d.ts +4 -0
  34. package/dist/tools/files.js +108 -0
  35. package/dist/tools/files.js.map +1 -0
  36. package/dist/tools/finance.d.ts +4 -0
  37. package/dist/tools/finance.js +39 -0
  38. package/dist/tools/finance.js.map +1 -0
  39. package/dist/tools/meta.d.ts +10 -0
  40. package/dist/tools/meta.js +74 -0
  41. package/dist/tools/meta.js.map +1 -0
  42. package/dist/tools/registry.d.ts +39 -0
  43. package/dist/tools/registry.js +56 -0
  44. package/dist/tools/registry.js.map +1 -0
  45. package/dist/tools/search.d.ts +13 -0
  46. package/dist/tools/search.js +243 -0
  47. package/dist/tools/search.js.map +1 -0
  48. package/dist/tools/work.d.ts +4 -0
  49. package/dist/tools/work.js +76 -0
  50. package/dist/tools/work.js.map +1 -0
  51. package/package.json +58 -0
@@ -0,0 +1,76 @@
1
+ /** Projects and time tracking. */
2
+ import { z } from "zod";
3
+ import { SUMMARY_FIELDS } from "../constants.js";
4
+ import { dateFilter, multiFilter } from "../schemas/common.js";
5
+ import { registerCrudTools } from "./crud.js";
6
+ export function registerWorkTools(server, client) {
7
+ registerCrudTools(server, client, {
8
+ singular: "project",
9
+ plural: "projects",
10
+ nameSingular: "project",
11
+ namePlural: "projects",
12
+ path: "/projects",
13
+ defaultFields: SUMMARY_FIELDS.project,
14
+ operations: ["list", "get", "create", "update", "delete"],
15
+ listNotes: "Projects group documents and tracked time under a customer engagement, with an optional " +
16
+ "budget. 'consumed_amount' and 'consumed_time' show progress against " +
17
+ "'budget_amount' and 'budget_time' — useful for budget-burn questions.\n" +
18
+ "Amounts are integers in cents; times are in minutes.",
19
+ bodyHint: `Required: name.
20
+
21
+ IMPORTANT: monetary values are INTEGERS IN CENTS (150 = 1.50 EUR); times are in MINUTES.
22
+
23
+ - name (string): project name.
24
+ - customer_id (integer): the customer this project belongs to.
25
+ - status ('OPEN'|'DONE'|'CANCEL'): defaults to OPEN.
26
+ - due_at (string): deadline, YYYY-MM-DD.
27
+ - hourly_rate (integer, CENTS): billing rate used for tracked time.
28
+ - budget_amount (integer, CENTS): budget cap in money.
29
+ - budget_time (integer, MINUTES): budget cap in time.
30
+ - budget_notify_frequency (string): when to warn about budget consumption.
31
+ - note (string).
32
+
33
+ Read-only: consumed_amount, consumed_time.`,
34
+ filters: {
35
+ customer_id: multiFilter("Filter by customer ID."),
36
+ status: z
37
+ .enum(["OPEN", "DONE", "CANCEL"])
38
+ .optional()
39
+ .describe("Filter by project status."),
40
+ },
41
+ });
42
+ registerCrudTools(server, client, {
43
+ singular: "time tracking entry",
44
+ plural: "time tracking entries",
45
+ nameSingular: "time_tracking",
46
+ namePlural: "time_trackings",
47
+ path: "/time-trackings",
48
+ defaultFields: SUMMARY_FIELDS.timeTracking,
49
+ operations: ["list", "get", "create", "update", "delete"],
50
+ listNotes: "Tracked working time, optionally tied to a project and an article. 'timer_value' is the " +
51
+ "tracked duration in MINUTES and 'hourly_rate' is in cents.\n" +
52
+ "'cleared_at' is set once the entry has been billed — entries with cleared_at = null are " +
53
+ "still unbilled, which is what you want when preparing an invoice.",
54
+ bodyHint: `Required: description.
55
+
56
+ IMPORTANT: 'timer_value' is in MINUTES; 'hourly_rate' is an INTEGER IN CENTS (150 = 1.50 EUR).
57
+
58
+ - description (string): what was worked on. Appears as the invoice line item text.
59
+ - timer_value (integer, MINUTES): duration. 90 means one and a half hours.
60
+ - date_from_at (string): start, 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' (Europe/Berlin).
61
+ - date_thru_at (string): end, same format.
62
+ - hourly_rate (integer, CENTS): rate for this entry. Defaults to 0, and the project rate applies.
63
+ - project_id (integer): the project to bill this against.
64
+ - position_id (integer): the catalogue article representing this kind of work.
65
+ - number (string): free-form reference of your choosing.
66
+ - note (string): internal note.
67
+ - cleared_at (string): set this once the time has been invoiced.`,
68
+ filters: {
69
+ project_id: multiFilter("Filter by project ID."),
70
+ login_id: multiFilter("Filter by the easybill login (employee) that tracked the time."),
71
+ date_from_at: dateFilter("start date"),
72
+ date_thru_at: dateFilter("end date"),
73
+ },
74
+ });
75
+ }
76
+ //# sourceMappingURL=work.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work.js","sourceRoot":"","sources":["../../src/tools/work.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAGlC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM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AC;YAChD,QAAQ,EAAE,WAAW,CAAC,gEAAgE,CAAC;YACvF,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC;YACtC,YAAY,EAAE,UAAU,CAAC,UAAU,CAAC;SACrC;KACF,CAAC,CAAC;AACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "easybill-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for the easybill REST API (invoices, customers, articles, payments, time tracking)",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "easybill-mcp": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc && chmod +x dist/index.js",
17
+ "prepare": "npm run build",
18
+ "start": "node dist/index.js",
19
+ "dev": "tsx watch src/index.ts",
20
+ "typecheck": "tsc --noEmit",
21
+ "smoke": "node --env-file=.env dist/index.js --selftest",
22
+ "inspect": "npx @modelcontextprotocol/inspector node --env-file=.env dist/index.js",
23
+ "clean": "rm -rf dist"
24
+ },
25
+ "keywords": [
26
+ "mcp",
27
+ "modelcontextprotocol",
28
+ "model-context-protocol",
29
+ "claude",
30
+ "easybill",
31
+ "invoice",
32
+ "invoicing",
33
+ "accounting",
34
+ "buchhaltung"
35
+ ],
36
+ "author": "stack74",
37
+ "license": "MIT",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/stack74/easybill-mcp.git"
41
+ },
42
+ "homepage": "https://github.com/stack74/easybill-mcp#readme",
43
+ "bugs": {
44
+ "url": "https://github.com/stack74/easybill-mcp/issues"
45
+ },
46
+ "engines": {
47
+ "node": ">=18"
48
+ },
49
+ "dependencies": {
50
+ "@modelcontextprotocol/sdk": "^1.30.0",
51
+ "zod": "^4.4.3"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^22.10.0",
55
+ "tsx": "^4.19.2",
56
+ "typescript": "^5.7.2"
57
+ }
58
+ }