mcp-zenskar 1.3.1 → 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 +62 -15
- package/dist/mcp-config.json +61 -20
- package/dist/server.mjs +17 -17
- package/dist/ui/app.html +15 -0
- package/package.json +26 -11
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zenskar MCP Server
|
|
2
2
|
|
|
3
|
-
MCP server for the Zenskar API.
|
|
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
|
-
"
|
|
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
|
-
|
|
91
|
+
Every request needs:
|
|
60
92
|
|
|
61
|
-
1. **Organization ID
|
|
62
|
-
2. **
|
|
93
|
+
1. **Organization ID** — set via `ZENSKAR_ORGANIZATION`
|
|
94
|
+
2. **API Key** — set via `ZENSKAR_API_KEY`
|
|
63
95
|
|
|
64
|
-
|
|
96
|
+
See [Zenskar credentials](#zenskar-credentials) above for how to get both.
|
|
65
97
|
|
|
66
|
-
|
|
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
|
-
|
|
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
|
-
|
|
327
|
+
pnpm install
|
|
281
328
|
|
|
282
329
|
# Build the bundle (produces dist/server.mjs + dist/mcp-config.json)
|
|
283
|
-
|
|
330
|
+
pnpm run build
|
|
284
331
|
|
|
285
332
|
# Run the server
|
|
286
|
-
|
|
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
|
-
|
|
296
|
-
|
|
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 .
|
package/dist/mcp-config.json
CHANGED
|
@@ -517,6 +517,30 @@
|
|
|
517
517
|
"prependBody": "## Invoice Download\n\nThe invoice content is:\n\n"
|
|
518
518
|
}
|
|
519
519
|
},
|
|
520
|
+
{
|
|
521
|
+
"name": "getInvoicePreviewHtml",
|
|
522
|
+
"description": "Get the rendered HTML preview of an invoice. Returns the invoice as it would appear when sent to the customer. Use this to show the customer-facing invoice layout.",
|
|
523
|
+
"args": [
|
|
524
|
+
{
|
|
525
|
+
"name": "orgId",
|
|
526
|
+
"description": "Organization ID (auto-populated).",
|
|
527
|
+
"type": "string",
|
|
528
|
+
"required": false,
|
|
529
|
+
"position": "path"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "invoiceId",
|
|
533
|
+
"description": "The ID of the invoice to preview.",
|
|
534
|
+
"type": "string",
|
|
535
|
+
"required": true,
|
|
536
|
+
"position": "path"
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
"requestTemplate": {
|
|
540
|
+
"url": "/communications/{orgId}/invoice/{invoiceId}/html",
|
|
541
|
+
"method": "GET"
|
|
542
|
+
}
|
|
543
|
+
},
|
|
520
544
|
{
|
|
521
545
|
"name": "getInvoiceContractJsonActuals",
|
|
522
546
|
"description": "Get contract actuals in JSON format for a specific invoice.",
|
|
@@ -746,6 +770,22 @@
|
|
|
746
770
|
"type": "string",
|
|
747
771
|
"required": false,
|
|
748
772
|
"position": "query"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"name": "parent_aggregate_id__isnull",
|
|
776
|
+
"description": "Whether to include only top-level aggregates (no parent). Defaults to true.",
|
|
777
|
+
"type": "boolean",
|
|
778
|
+
"required": false,
|
|
779
|
+
"default": true,
|
|
780
|
+
"position": "query"
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
"name": "aggregate_type__isnull",
|
|
784
|
+
"description": "Whether to include only aggregates without an explicit type. Defaults to true.",
|
|
785
|
+
"type": "boolean",
|
|
786
|
+
"required": false,
|
|
787
|
+
"default": true,
|
|
788
|
+
"position": "query"
|
|
749
789
|
}
|
|
750
790
|
],
|
|
751
791
|
"requestTemplate": {
|
|
@@ -903,10 +943,7 @@
|
|
|
903
943
|
"warningText": "This action will create a new billable metric definition that may be used in pricing and billing configurations.",
|
|
904
944
|
"confirmText": "Create Billable Metric",
|
|
905
945
|
"cancelText": "Cancel",
|
|
906
|
-
"sensitiveFields": [
|
|
907
|
-
"name",
|
|
908
|
-
"datasource"
|
|
909
|
-
]
|
|
946
|
+
"sensitiveFields": ["name", "datasource"]
|
|
910
947
|
},
|
|
911
948
|
"args": [
|
|
912
949
|
{
|
|
@@ -1052,9 +1089,7 @@
|
|
|
1052
1089
|
"warningText": "DESTRUCTIVE — this cannot be undone. This may affect active pricing configurations and billing that reference this metric.",
|
|
1053
1090
|
"confirmText": "Delete Billable Metric",
|
|
1054
1091
|
"cancelText": "Cancel",
|
|
1055
|
-
"sensitiveFields": [
|
|
1056
|
-
"aggregateId"
|
|
1057
|
-
]
|
|
1092
|
+
"sensitiveFields": ["aggregateId"]
|
|
1058
1093
|
},
|
|
1059
1094
|
"args": [
|
|
1060
1095
|
{
|
|
@@ -2101,11 +2136,7 @@
|
|
|
2101
2136
|
"type": "string",
|
|
2102
2137
|
"required": false,
|
|
2103
2138
|
"position": "query",
|
|
2104
|
-
"enum": [
|
|
2105
|
-
"Feature",
|
|
2106
|
-
"Quantity",
|
|
2107
|
-
"Credits"
|
|
2108
|
-
]
|
|
2139
|
+
"enum": ["Feature", "Quantity", "Credits"]
|
|
2109
2140
|
},
|
|
2110
2141
|
{
|
|
2111
2142
|
"name": "is_active",
|
|
@@ -2195,11 +2226,7 @@
|
|
|
2195
2226
|
"type": "string",
|
|
2196
2227
|
"required": false,
|
|
2197
2228
|
"position": "body",
|
|
2198
|
-
"enum": [
|
|
2199
|
-
"Feature",
|
|
2200
|
-
"Quantity",
|
|
2201
|
-
"Credits"
|
|
2202
|
-
]
|
|
2229
|
+
"enum": ["Feature", "Quantity", "Credits"]
|
|
2203
2230
|
},
|
|
2204
2231
|
{
|
|
2205
2232
|
"name": "units",
|
|
@@ -2244,9 +2271,7 @@
|
|
|
2244
2271
|
"warningText": "DESTRUCTIVE — this cannot be undone. This may affect billing and access control for customers using this entitlement.",
|
|
2245
2272
|
"confirmText": "Delete Entitlement",
|
|
2246
2273
|
"cancelText": "Cancel",
|
|
2247
|
-
"sensitiveFields": [
|
|
2248
|
-
"entitlementId"
|
|
2249
|
-
]
|
|
2274
|
+
"sensitiveFields": ["entitlementId"]
|
|
2250
2275
|
},
|
|
2251
2276
|
"args": [
|
|
2252
2277
|
{
|
|
@@ -4326,6 +4351,22 @@
|
|
|
4326
4351
|
"type": "string",
|
|
4327
4352
|
"required": false,
|
|
4328
4353
|
"position": "query"
|
|
4354
|
+
},
|
|
4355
|
+
{
|
|
4356
|
+
"name": "type",
|
|
4357
|
+
"description": "Filter by product object type. Defaults to 'product' (excludes plans, addons, etc.).",
|
|
4358
|
+
"type": "string",
|
|
4359
|
+
"required": false,
|
|
4360
|
+
"default": "product",
|
|
4361
|
+
"position": "query"
|
|
4362
|
+
},
|
|
4363
|
+
{
|
|
4364
|
+
"name": "product_category__isnull",
|
|
4365
|
+
"description": "Whether to include only products without a category. Defaults to true.",
|
|
4366
|
+
"type": "boolean",
|
|
4367
|
+
"required": false,
|
|
4368
|
+
"default": true,
|
|
4369
|
+
"position": "query"
|
|
4329
4370
|
}
|
|
4330
4371
|
],
|
|
4331
4372
|
"requestTemplate": {
|