mcp-zenskar 1.3.0 → 2.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Zenskar MCP Server
2
2
 
3
- MCP server for the Zenskar API. 103 tools covering customers, contracts, invoices, payments, credit notes, accounting, products, plans, and more.
3
+ MCP server for the Zenskar API. 113 tools covering customers, contracts, invoices, payments, credit notes, accounting, products, plans, entitlements, billable metrics, and more.
4
4
 
5
5
  ## What it does
6
6
 
@@ -12,11 +12,43 @@ MCP server for the Zenskar API. 103 tools covering customers, contracts, invoice
12
12
  - Accounting: chart of accounts, journal entries and lines, balance sheet, income statement, account balances
13
13
  - Products: CRUD, pricing configurations
14
14
  - Plans: list, create, add products, preview estimates
15
+ - Entitlements: list, get, create, update, delete
16
+ - Billable metrics (aggregates): list, get, create, update, delete, schemas, estimates, logs
15
17
  - Business entities: list, get, create, update
16
18
  - Jobs: monitor async operations
17
19
  - Custom attributes and tax categories
18
20
  - Multi-tenant, supports Bearer token and API key auth
19
21
 
22
+ ## Prerequisites
23
+
24
+ Before continuing, you need two things:
25
+
26
+ 1. **Node.js 20.10 or newer** on your machine
27
+ 2. **Zenskar credentials** — your Organization ID and an API Key
28
+
29
+ ### Node.js
30
+
31
+ Check whether it's already installed. Open a terminal and run:
32
+
33
+ ```bash
34
+ node --version
35
+ npm --version
36
+ ```
37
+
38
+ This project requires **Node.js 20.10 or newer**. If both commands print a version that meets this, jump to [Zenskar credentials](#zenskar-credentials).
39
+
40
+ If you see `command not found` or a version older than 20.10, download and install the **LTS** build from https://nodejs.org/en/download. `npm` (and `npx`) ship with Node.js — no separate install needed. After installing, open a **new** terminal window and re-run `node --version` to confirm.
41
+
42
+ ### Zenskar credentials
43
+
44
+ You need two values from your Zenskar dashboard. Grab both before moving to Installation.
45
+
46
+ **Organization ID** — open https://app.zenskar.com/settings (General tab) and copy your Organization ID.
47
+
48
+ **API Key** — open https://app.zenskar.com/settings?tab=api-keys, click **Create new API key**, give it a name, and copy the key.
49
+
50
+ > Store the API key somewhere safe — the dashboard only shows the full key once. If you lose it, you'll have to create a new one.
51
+
20
52
  ## Installation
21
53
 
22
54
  ### For Claude Desktop App
@@ -31,7 +63,7 @@ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/
31
63
  "args": ["mcp-zenskar"],
32
64
  "env": {
33
65
  "ZENSKAR_ORGANIZATION": "your-org-id",
34
- "ZENSKAR_AUTH_TOKEN": "your-bearer-token"
66
+ "ZENSKAR_API_KEY": "your-api-key"
35
67
  }
36
68
  }
37
69
  }
@@ -56,17 +88,18 @@ npx mcp-zenskar
56
88
 
57
89
  ## Authentication
58
90
 
59
- This MCP server requires two authentication parameters for every request:
91
+ Every request needs:
60
92
 
61
- 1. **Organization ID**: Your Zenskar organization identifier
62
- 2. **Authorization Token**: Your API Bearer token or API key
93
+ 1. **Organization ID** set via `ZENSKAR_ORGANIZATION`
94
+ 2. **API Key** set via `ZENSKAR_API_KEY`
63
95
 
64
- ### Getting Your Credentials
96
+ See [Zenskar credentials](#zenskar-credentials) above for how to get both.
65
97
 
66
- 1. **Organization ID**: Available in your Zenskar dashboard settings
67
- 2. **API Token**: Generate from Zenskar dashboard → Settings → API Keys
98
+ At runtime the server reads these env vars (or accepts them from the MCP client via tool invocation).
68
99
 
69
- At runtime the server looks for these values in the tool invocation first, then falls back to the `ZENSKAR_ORGANIZATION` and `ZENSKAR_AUTH_TOKEN` environment variables. Tokens that look like JWTs are sent as `Authorization: Bearer ...`; everything else is sent as an `x-api-key` header automatically.
100
+ ### Advanced: bearer tokens
101
+
102
+ Same session token from your browser devtools is also accepted via `ZENSKAR_AUTH_TOKEN` (sent as `Authorization: Bearer ...`). Short-lived — API key is preferred for any non-throwaway use. Kept for backward compatibility, so existing configs that use `ZENSKAR_AUTH_TOKEN` continue to work unchanged.
70
103
 
71
104
  ## Usage
72
105
 
@@ -248,6 +281,9 @@ Once configured, you can ask Claude to interact with your Zenskar data:
248
281
  | `getAggregateEstimates` | Get Billable Metric estimates; backend/API may also call these aggregates |
249
282
  | `getAggregateById` | Get a Billable Metric by ID; backend/API may also call it an aggregate |
250
283
  | `getAggregateLogs` | Get logs for a Billable Metric (Aggregate) |
284
+ | `createAggregate` | Create a Billable Metric (Aggregate) |
285
+ | `updateAggregate` | Update a Billable Metric (Aggregate) |
286
+ | `deleteAggregate` | Delete a Billable Metric (Aggregate) |
251
287
  | `listRawMetrics` | List Usage Events with filtering; backend/API may also call these raw metrics |
252
288
  | `createRawMetric` | Create a Usage Event schema; backend/API calls this a raw metric |
253
289
  | `getRawMetricById` | Get a Usage Event by ID; backend/API may also call it a raw metric |
@@ -255,11 +291,20 @@ Once configured, you can ask Claude to interact with your Zenskar data:
255
291
  | `getRawMetricBySlug` | Get a Usage Event by API slug; backend/API may also call it a raw metric |
256
292
  | `ingestRawMetricEvent` | Ingest a usage event |
257
293
 
294
+ ### Entitlements
295
+
296
+ | Tool | Description |
297
+ | -------------------- | -------------------------------- |
298
+ | `listEntitlements` | List entitlements with filtering |
299
+ | `getEntitlementById` | Get an entitlement by ID |
300
+ | `createEntitlement` | Create an entitlement |
301
+ | `updateEntitlement` | Update an entitlement |
302
+ | `deleteEntitlement` | Delete an entitlement |
303
+
258
304
  ### Other
259
305
 
260
306
  | Tool | Description |
261
307
  | -------------------------------- | ----------------------------------------- |
262
- | `createEntitlement` | Create an entitlement |
263
308
  | `getCustomerPortalConfiguration` | Get customer portal config |
264
309
  | `getCurrentDateTime` | Get current date/time in multiple formats |
265
310
 
@@ -271,19 +316,21 @@ Once configured, you can ask Claude to interact with your Zenskar data:
271
316
 
272
317
  ## Development
273
318
 
319
+ This repo uses [pnpm](https://pnpm.io) for package management. If you don't have it, install it once with `npm install -g pnpm` (or `corepack enable && corepack prepare pnpm@latest --activate`).
320
+
274
321
  ```bash
275
322
  # Clone the repository
276
323
  git clone https://github.com/zenskar/mcp-zenskar
277
324
  cd mcp-zenskar
278
325
 
279
326
  # Install dependencies
280
- npm install
327
+ pnpm install
281
328
 
282
329
  # Build the bundle (produces dist/server.mjs + dist/mcp-config.json)
283
- npm run build
330
+ pnpm run build
284
331
 
285
332
  # Run the server
286
- npm start
333
+ pnpm start
287
334
  ```
288
335
 
289
336
  ### Developing Locally Without Publishing
@@ -292,8 +339,8 @@ If you want Claude Desktop to use a local checkout instead of the npm package:
292
339
 
293
340
  ```bash
294
341
  # Install dependencies + build the bundle
295
- npm install
296
- npm run build
342
+ pnpm install
343
+ pnpm run build
297
344
 
298
345
  # Optional: install the local build globally (requires dist/ from the previous step)
299
346
  npm install -g .