@centry-digital/bukku-mcp 1.1.1 → 2.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.
Files changed (107) hide show
  1. package/README.md +28 -164
  2. package/build/config/env.d.ts +1 -0
  3. package/build/config/env.d.ts.map +1 -0
  4. package/build/config/env.js +2 -1
  5. package/build/index.d.ts +1 -0
  6. package/build/index.d.ts.map +1 -0
  7. package/build/index.js +1813 -44
  8. package/build/tools/custom/account-tools.d.ts +2 -1
  9. package/build/tools/custom/account-tools.d.ts.map +1 -0
  10. package/build/tools/custom/account-tools.js +2 -2
  11. package/build/tools/custom/contact-archive.d.ts +2 -1
  12. package/build/tools/custom/contact-archive.d.ts.map +1 -0
  13. package/build/tools/custom/contact-archive.js +2 -2
  14. package/build/tools/custom/control-panel-archive.d.ts +2 -1
  15. package/build/tools/custom/control-panel-archive.d.ts.map +1 -0
  16. package/build/tools/custom/control-panel-archive.js +2 -2
  17. package/build/tools/custom/file-upload.d.ts +2 -1
  18. package/build/tools/custom/file-upload.d.ts.map +1 -0
  19. package/build/tools/custom/file-upload.js +2 -2
  20. package/build/tools/custom/journal-entry-tools.d.ts +2 -1
  21. package/build/tools/custom/journal-entry-tools.d.ts.map +1 -0
  22. package/build/tools/custom/journal-entry-tools.js +2 -3
  23. package/build/tools/custom/location-tools.d.ts +2 -1
  24. package/build/tools/custom/location-tools.d.ts.map +1 -0
  25. package/build/tools/custom/location-tools.js +2 -2
  26. package/build/tools/custom/product-archive.d.ts +2 -1
  27. package/build/tools/custom/product-archive.d.ts.map +1 -0
  28. package/build/tools/custom/product-archive.js +2 -2
  29. package/build/tools/custom/reference-data.d.ts +3 -2
  30. package/build/tools/custom/reference-data.d.ts.map +1 -0
  31. package/build/tools/custom/reference-data.js +2 -2
  32. package/build/tools/factory.d.ts +2 -2
  33. package/build/tools/factory.d.ts.map +1 -0
  34. package/build/tools/factory.js +2 -2
  35. package/build/tools/registry.d.ts +2 -1
  36. package/build/tools/registry.d.ts.map +1 -0
  37. package/build/tools/registry.js +3 -41
  38. package/package.json +9 -22
  39. package/LICENSE +0 -21
  40. package/build/client/bukku-client.d.ts +0 -62
  41. package/build/client/bukku-client.js +0 -195
  42. package/build/errors/transform.d.ts +0 -14
  43. package/build/errors/transform.js +0 -141
  44. package/build/tools/cache/reference-cache.d.ts +0 -42
  45. package/build/tools/cache/reference-cache.js +0 -63
  46. package/build/tools/configs/account.d.ts +0 -17
  47. package/build/tools/configs/account.js +0 -28
  48. package/build/tools/configs/bank-money-in.d.ts +0 -10
  49. package/build/tools/configs/bank-money-in.js +0 -22
  50. package/build/tools/configs/bank-money-out.d.ts +0 -10
  51. package/build/tools/configs/bank-money-out.js +0 -22
  52. package/build/tools/configs/bank-transfer.d.ts +0 -11
  53. package/build/tools/configs/bank-transfer.js +0 -23
  54. package/build/tools/configs/contact-group.d.ts +0 -11
  55. package/build/tools/configs/contact-group.js +0 -19
  56. package/build/tools/configs/contact.d.ts +0 -14
  57. package/build/tools/configs/contact.js +0 -25
  58. package/build/tools/configs/delivery-order.d.ts +0 -8
  59. package/build/tools/configs/delivery-order.js +0 -20
  60. package/build/tools/configs/file.d.ts +0 -18
  61. package/build/tools/configs/file.js +0 -26
  62. package/build/tools/configs/goods-received-note.d.ts +0 -8
  63. package/build/tools/configs/goods-received-note.js +0 -20
  64. package/build/tools/configs/journal-entry.d.ts +0 -14
  65. package/build/tools/configs/journal-entry.js +0 -26
  66. package/build/tools/configs/location.d.ts +0 -20
  67. package/build/tools/configs/location.js +0 -28
  68. package/build/tools/configs/product-bundle.d.ts +0 -18
  69. package/build/tools/configs/product-bundle.js +0 -29
  70. package/build/tools/configs/product-group.d.ts +0 -14
  71. package/build/tools/configs/product-group.js +0 -22
  72. package/build/tools/configs/product.d.ts +0 -24
  73. package/build/tools/configs/product.js +0 -35
  74. package/build/tools/configs/purchase-bill.d.ts +0 -9
  75. package/build/tools/configs/purchase-bill.js +0 -21
  76. package/build/tools/configs/purchase-credit-note.d.ts +0 -8
  77. package/build/tools/configs/purchase-credit-note.js +0 -20
  78. package/build/tools/configs/purchase-order.d.ts +0 -8
  79. package/build/tools/configs/purchase-order.js +0 -20
  80. package/build/tools/configs/purchase-payment.d.ts +0 -8
  81. package/build/tools/configs/purchase-payment.js +0 -20
  82. package/build/tools/configs/purchase-refund.d.ts +0 -8
  83. package/build/tools/configs/purchase-refund.js +0 -20
  84. package/build/tools/configs/sales-credit-note.d.ts +0 -8
  85. package/build/tools/configs/sales-credit-note.js +0 -20
  86. package/build/tools/configs/sales-invoice.d.ts +0 -8
  87. package/build/tools/configs/sales-invoice.js +0 -20
  88. package/build/tools/configs/sales-order.d.ts +0 -8
  89. package/build/tools/configs/sales-order.js +0 -20
  90. package/build/tools/configs/sales-payment.d.ts +0 -8
  91. package/build/tools/configs/sales-payment.js +0 -20
  92. package/build/tools/configs/sales-quote.d.ts +0 -8
  93. package/build/tools/configs/sales-quote.js +0 -20
  94. package/build/tools/configs/sales-refund.d.ts +0 -8
  95. package/build/tools/configs/sales-refund.js +0 -20
  96. package/build/tools/configs/tag-group.d.ts +0 -11
  97. package/build/tools/configs/tag-group.js +0 -22
  98. package/build/tools/configs/tag.d.ts +0 -11
  99. package/build/tools/configs/tag.js +0 -22
  100. package/build/tools/validation/double-entry.d.ts +0 -46
  101. package/build/tools/validation/double-entry.js +0 -66
  102. package/build/types/api-responses.d.ts +0 -21
  103. package/build/types/api-responses.js +0 -6
  104. package/build/types/bukku.d.ts +0 -93
  105. package/build/types/bukku.js +0 -11
  106. package/build/utils/logger.d.ts +0 -6
  107. package/build/utils/logger.js +0 -8
package/README.md CHANGED
@@ -15,7 +15,7 @@ With this MCP server connected, you can ask your AI things like:
15
15
  - "Create a new contact for my supplier"
16
16
  - "Upload this receipt and attach it to the purchase bill"
17
17
 
18
- The server exposes **173 tools** covering the full Bukku API:
18
+ The server exposes **169 tools** covering the full Bukku API:
19
19
 
20
20
  | Category | Tools | What you can do |
21
21
  |----------|-------|-----------------|
@@ -26,16 +26,14 @@ The server exposes **173 tools** covering the full Bukku API:
26
26
  | **Products** | 18 | Products, product bundles, product groups |
27
27
  | **Accounting** | 13 | Journal entries, chart of accounts |
28
28
  | **Files** | 3 | Upload and manage file attachments |
29
- | **Organisation** | 21 | Locations, tags, tag groups |
29
+ | **Organisation** | 17 | Locations, tags, tag groups |
30
30
  | **Reference Data** | 10 | Tax codes, currencies, payment methods, terms, and more |
31
31
 
32
32
  ## Quick Start
33
33
 
34
- Get up and running in under 2 minutes.
35
-
36
34
  ### Prerequisites
37
35
 
38
- - [Node.js](https://nodejs.org) v18 or later
36
+ - [Node.js](https://nodejs.org) v20 or later
39
37
  - A [Bukku](https://bukku.my) account with API access enabled
40
38
  - An AI client that supports MCP (e.g. [Claude Desktop](https://claude.ai/download), [Claude Code](https://docs.anthropic.com/en/docs/claude-code))
41
39
 
@@ -48,12 +46,10 @@ Get up and running in under 2 minutes.
48
46
 
49
47
  ### Step 2: Add to your AI client
50
48
 
51
- For Claude Desktop, open your config file:
49
+ **Claude Desktop** open your config file:
52
50
  - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
53
51
  - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
54
52
 
55
- Add this configuration:
56
-
57
53
  ```json
58
54
  {
59
55
  "mcpServers": {
@@ -69,62 +65,7 @@ Add this configuration:
69
65
  }
70
66
  ```
71
67
 
72
- ### Step 3: Restart your AI client
73
-
74
- Quit and reopen Claude Desktop. That's it — you're ready to go!
75
-
76
- ## Installation
77
-
78
- ### npx (recommended)
79
-
80
- The quickest way to use the server is with `npx`. No installation needed — it downloads and runs the latest version automatically:
81
-
82
- ```bash
83
- npx @centry-digital/bukku-mcp
84
- ```
85
-
86
- This is what the Quick Start configuration uses. `npx` ensures you're always running the latest version without manual updates.
87
-
88
- ### npm global install
89
-
90
- If you prefer a persistent installation:
91
-
92
- ```bash
93
- npm install -g @centry-digital/bukku-mcp
94
- ```
95
-
96
- Then update your AI client configuration to use the installed command instead:
97
-
98
- ```json
99
- {
100
- "mcpServers": {
101
- "bukku": {
102
- "command": "bukku-mcp",
103
- "env": {
104
- "BUKKU_API_TOKEN": "your-token-here",
105
- "BUKKU_COMPANY_SUBDOMAIN": "your-subdomain"
106
- }
107
- }
108
- }
109
- }
110
- ```
111
-
112
- ## Configuration
113
-
114
- ### Environment Variables
115
-
116
- | Variable | Required | Description |
117
- |----------|----------|-------------|
118
- | `BUKKU_API_TOKEN` | Yes | Your Bukku API token from Control Panel > Integrations > API Access |
119
- | `BUKKU_COMPANY_SUBDOMAIN` | Yes | Your company subdomain (e.g. `mycompany` from `mycompany.bukku.my`) |
120
-
121
- ### Claude Desktop
122
-
123
- Open your configuration file:
124
- - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
125
- - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
126
-
127
- **Using npx (recommended):**
68
+ **Claude Code** add to your project or home `.claude/settings.json`:
128
69
 
129
70
  ```json
130
71
  {
@@ -141,128 +82,51 @@ Open your configuration file:
141
82
  }
142
83
  ```
143
84
 
144
- **If you installed globally:**
145
-
146
- ```json
147
- {
148
- "mcpServers": {
149
- "bukku": {
150
- "command": "bukku-mcp",
151
- "env": {
152
- "BUKKU_API_TOKEN": "your-token-here",
153
- "BUKKU_COMPANY_SUBDOMAIN": "your-subdomain"
154
- }
155
- }
156
- }
157
- }
158
- ```
85
+ ### Step 3: Restart your AI client
159
86
 
160
- After updating the config, restart Claude Desktop.
87
+ Quit and reopen your AI client. You're ready to go.
161
88
 
162
- ### Claude Code
89
+ ## Installation
163
90
 
164
- Add to `.claude/settings.json` in your home directory or project:
91
+ ### npx (recommended)
165
92
 
166
- **Using npx (recommended):**
93
+ No installation needed — downloads and runs the latest version:
167
94
 
168
- ```json
169
- {
170
- "mcpServers": {
171
- "bukku": {
172
- "command": "npx",
173
- "args": ["-y", "@centry-digital/bukku-mcp"],
174
- "env": {
175
- "BUKKU_API_TOKEN": "your-token-here",
176
- "BUKKU_COMPANY_SUBDOMAIN": "your-subdomain"
177
- }
178
- }
179
- }
180
- }
95
+ ```bash
96
+ npx @centry-digital/bukku-mcp
181
97
  ```
182
98
 
183
- **If you installed globally:**
99
+ ### npm global install
184
100
 
185
- ```json
186
- {
187
- "mcpServers": {
188
- "bukku": {
189
- "command": "bukku-mcp",
190
- "env": {
191
- "BUKKU_API_TOKEN": "your-token-here",
192
- "BUKKU_COMPANY_SUBDOMAIN": "your-subdomain"
193
- }
194
- }
195
- }
196
- }
101
+ ```bash
102
+ npm install -g @centry-digital/bukku-mcp
197
103
  ```
198
104
 
199
- ### Other MCP Clients
105
+ Then use `bukku-mcp` as the command in your AI client config instead of `npx`.
106
+
107
+ ## Configuration
200
108
 
201
- Any client that supports the [MCP stdio transport](https://modelcontextprotocol.io/docs/concepts/transports) can use this server. Use the `npx @centry-digital/bukku-mcp` command with the two environment variables shown above.
109
+ | Variable | Required | Description |
110
+ |----------|----------|-------------|
111
+ | `BUKKU_API_TOKEN` | Yes | Your Bukku API token from Control Panel > Integrations > API Access |
112
+ | `BUKKU_COMPANY_SUBDOMAIN` | Yes | Your company subdomain (e.g. `mycompany` from `mycompany.bukku.my`) |
202
113
 
203
114
  ## Troubleshooting
204
115
 
205
116
  **"Configuration Error" on startup**
206
117
  - Check that both `BUKKU_API_TOKEN` and `BUKKU_COMPANY_SUBDOMAIN` are set in your client config
207
- - Verify the environment variables are inside the `"env"` object
208
118
 
209
119
  **"Token validation failed"**
210
- - Your API token may be invalid or expired
211
- - Log into Bukku and regenerate your token at Control Panel > Integrations > API Access
120
+ - Your API token may be invalid or expired — regenerate at Control Panel > Integrations > API Access
212
121
 
213
122
  **Server doesn't appear in your AI client**
214
- - Verify your configuration JSON syntax is correct (no trailing commas)
215
- - Make sure you've restarted your AI client after editing the config
216
- - Check that Node.js v18 or later is installed: `node --version`
123
+ - Verify JSON syntax is correct (no trailing commas)
124
+ - Restart your AI client after editing the config
125
+ - Check Node.js v20+ is installed: `node --version`
217
126
 
218
- **"Could not resolve package" with npx**
219
- - Check that you have Node.js v18 or later installed
220
- - Verify your network connection and proxy settings if applicable
221
- - Try running `npm view @centry-digital/bukku-mcp` to confirm the package is accessible
127
+ ## Related
222
128
 
223
- **Permission errors with global install**
224
- - Consider using `npx` instead (no installation needed)
225
- - Or fix npm permissions: [https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally)
226
-
227
- ## Development
228
-
229
- Want to contribute or run from source? Here's how to set up your development environment.
230
-
231
- ### Clone and build
232
-
233
- ```bash
234
- git clone https://github.com/centry-digital/bukku-mcp.git
235
- cd bukku-mcp
236
- npm install
237
- npm run build
238
- ```
239
-
240
- ### Commands
241
-
242
- ```bash
243
- npm run build # Compile TypeScript
244
- npm test # Run tests
245
- npm start # Start server (requires env vars)
246
- ```
247
-
248
- ### Project structure
249
-
250
- ```
251
- src/
252
- ├── client/ # Bukku API HTTP client
253
- ├── config/ # Environment validation
254
- ├── errors/ # Error handling and transformation
255
- ├── tools/ # MCP tool definitions (one folder per category)
256
- │ ├── sales/
257
- │ ├── purchases/
258
- │ ├── banking/
259
- │ ├── contacts/
260
- │ ├── products/
261
- │ ├── accounting/
262
- │ ├── files/
263
- │ └── ...
264
- └── index.ts # Server entry point
265
- ```
129
+ - [GitHub repository](https://github.com/centry-digital/bukku)
266
130
 
267
131
  ## License
268
132
 
@@ -17,3 +17,4 @@ export type Env = z.infer<typeof envSchema>;
17
17
  */
18
18
  export declare function validateEnv(): Env;
19
19
  export {};
20
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;;GAKG;AACH,QAAA,MAAM,SAAS;;;iBAGb,CAAC;AAEH,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAuBjC"}
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
- import { log } from "../utils/logger.js";
2
+ import { createLogger } from 'core';
3
+ const log = createLogger('bukku-mcp');
3
4
  /**
4
5
  * Environment variable schema.
5
6
  * Required vars:
package/build/index.d.ts CHANGED
@@ -11,3 +11,4 @@
11
11
  * 6. Log startup to stderr
12
12
  */
13
13
  export {};
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;GAUG"}