@norbix.ai/mcp 0.2.0 → 0.3.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.
@@ -10660,6 +10660,11 @@
10660
10660
  "type": "{ [index: string]: string }",
10661
10661
  "optional": true
10662
10662
  },
10663
+ {
10664
+ "name": "slug",
10665
+ "type": "string",
10666
+ "optional": true
10667
+ },
10663
10668
  {
10664
10669
  "name": "description",
10665
10670
  "type": "string",
@@ -10760,6 +10765,11 @@
10760
10765
  "type": "{ [index: string]: string }",
10761
10766
  "optional": true
10762
10767
  },
10768
+ {
10769
+ "name": "slug",
10770
+ "type": "string",
10771
+ "optional": true
10772
+ },
10763
10773
  {
10764
10774
  "name": "description",
10765
10775
  "type": "string",
@@ -12623,6 +12633,11 @@
12623
12633
  "type": "string",
12624
12634
  "optional": false
12625
12635
  },
12636
+ {
12637
+ "name": "env",
12638
+ "type": "string",
12639
+ "optional": true
12640
+ },
12626
12641
  {
12627
12642
  "name": "eventName",
12628
12643
  "type": "string",
@@ -12743,6 +12758,11 @@
12743
12758
  "type": "string",
12744
12759
  "optional": true
12745
12760
  },
12761
+ {
12762
+ "name": "env",
12763
+ "type": "string",
12764
+ "optional": false
12765
+ },
12746
12766
  {
12747
12767
  "name": "meta",
12748
12768
  "type": "IReadOnlyDictionary<string, string>",
@@ -15322,6 +15342,16 @@
15322
15342
  "name": "translateOptions",
15323
15343
  "type": "IReadOnlyDictionary<string, string>",
15324
15344
  "optional": true
15345
+ },
15346
+ {
15347
+ "name": "default",
15348
+ "type": "string",
15349
+ "optional": true
15350
+ },
15351
+ {
15352
+ "name": "unique",
15353
+ "type": "boolean",
15354
+ "optional": true
15325
15355
  }
15326
15356
  ]
15327
15357
  },
@@ -15342,6 +15372,31 @@
15342
15372
  "name": "multipleOf",
15343
15373
  "type": "number",
15344
15374
  "optional": true
15375
+ },
15376
+ {
15377
+ "name": "default",
15378
+ "type": "number",
15379
+ "optional": true
15380
+ },
15381
+ {
15382
+ "name": "unique",
15383
+ "type": "boolean",
15384
+ "optional": true
15385
+ }
15386
+ ]
15387
+ },
15388
+ "CurrencyDefaultDto": {
15389
+ "base": null,
15390
+ "fields": [
15391
+ {
15392
+ "name": "value",
15393
+ "type": "number",
15394
+ "optional": false
15395
+ },
15396
+ {
15397
+ "name": "currency",
15398
+ "type": "string",
15399
+ "optional": false
15345
15400
  }
15346
15401
  ]
15347
15402
  },
@@ -15352,12 +15407,38 @@
15352
15407
  "name": "allowedCurrencies",
15353
15408
  "type": "IReadOnlyList<string>",
15354
15409
  "optional": true
15410
+ },
15411
+ {
15412
+ "name": "multipleOf",
15413
+ "type": "number",
15414
+ "optional": true
15415
+ },
15416
+ {
15417
+ "name": "minimum",
15418
+ "type": "number",
15419
+ "optional": true
15420
+ },
15421
+ {
15422
+ "name": "maximum",
15423
+ "type": "number",
15424
+ "optional": true
15425
+ },
15426
+ {
15427
+ "name": "default",
15428
+ "type": "CurrencyDefaultDto",
15429
+ "optional": true
15355
15430
  }
15356
15431
  ]
15357
15432
  },
15358
15433
  "BooleanFieldDto": {
15359
15434
  "base": "JsonSchemaFieldDto",
15360
- "fields": []
15435
+ "fields": [
15436
+ {
15437
+ "name": "default",
15438
+ "type": "boolean",
15439
+ "optional": true
15440
+ }
15441
+ ]
15361
15442
  },
15362
15443
  "DateFieldDto": {
15363
15444
  "base": "JsonSchemaFieldDto",
@@ -15371,6 +15452,11 @@
15371
15452
  "name": "maximum",
15372
15453
  "type": "number",
15373
15454
  "optional": true
15455
+ },
15456
+ {
15457
+ "name": "default",
15458
+ "type": "number",
15459
+ "optional": true
15374
15460
  }
15375
15461
  ]
15376
15462
  },
@@ -15386,6 +15472,16 @@
15386
15472
  "name": "maximum",
15387
15473
  "type": "number",
15388
15474
  "optional": true
15475
+ },
15476
+ {
15477
+ "name": "default",
15478
+ "type": "number",
15479
+ "optional": true
15480
+ },
15481
+ {
15482
+ "name": "unique",
15483
+ "type": "boolean",
15484
+ "optional": true
15389
15485
  }
15390
15486
  ]
15391
15487
  },
@@ -15401,7 +15497,23 @@
15401
15497
  },
15402
15498
  "TagsFieldDto": {
15403
15499
  "base": "JsonSchemaFieldDto",
15404
- "fields": []
15500
+ "fields": [
15501
+ {
15502
+ "name": "minItems",
15503
+ "type": "number",
15504
+ "optional": true
15505
+ },
15506
+ {
15507
+ "name": "maxItems",
15508
+ "type": "number",
15509
+ "optional": true
15510
+ },
15511
+ {
15512
+ "name": "default",
15513
+ "type": "IReadOnlyList<string>",
15514
+ "optional": true
15515
+ }
15516
+ ]
15405
15517
  },
15406
15518
  "FileFieldDto": {
15407
15519
  "base": "JsonSchemaFieldDto",
@@ -15410,6 +15522,26 @@
15410
15522
  "name": "storages",
15411
15523
  "type": "IReadOnlyList<string>",
15412
15524
  "optional": true
15525
+ },
15526
+ {
15527
+ "name": "minItems",
15528
+ "type": "number",
15529
+ "optional": true
15530
+ },
15531
+ {
15532
+ "name": "maxItems",
15533
+ "type": "number",
15534
+ "optional": true
15535
+ },
15536
+ {
15537
+ "name": "allowedFileType",
15538
+ "type": "string",
15539
+ "optional": true
15540
+ },
15541
+ {
15542
+ "name": "maxSizeMb",
15543
+ "type": "number",
15544
+ "optional": true
15413
15545
  }
15414
15546
  ]
15415
15547
  },
@@ -15425,6 +15557,11 @@
15425
15557
  "name": "multiple",
15426
15558
  "type": "boolean",
15427
15559
  "optional": false
15560
+ },
15561
+ {
15562
+ "name": "displayField",
15563
+ "type": "string",
15564
+ "optional": true
15428
15565
  }
15429
15566
  ]
15430
15567
  },
@@ -15455,6 +15592,11 @@
15455
15592
  "name": "multiple",
15456
15593
  "type": "boolean",
15457
15594
  "optional": false
15595
+ },
15596
+ {
15597
+ "name": "displayField",
15598
+ "type": "string",
15599
+ "optional": true
15458
15600
  }
15459
15601
  ]
15460
15602
  },
@@ -15465,6 +15607,11 @@
15465
15607
  "name": "multiple",
15466
15608
  "type": "boolean",
15467
15609
  "optional": false
15610
+ },
15611
+ {
15612
+ "name": "displayField",
15613
+ "type": "string",
15614
+ "optional": true
15468
15615
  }
15469
15616
  ]
15470
15617
  },
@@ -15480,6 +15627,61 @@
15480
15627
  "name": "multiple",
15481
15628
  "type": "boolean",
15482
15629
  "optional": false
15630
+ },
15631
+ {
15632
+ "name": "default",
15633
+ "type": "IReadOnlyList<string>",
15634
+ "optional": true
15635
+ }
15636
+ ]
15637
+ },
15638
+ "ObjectFieldDto": {
15639
+ "base": "JsonSchemaFieldDto",
15640
+ "fields": [
15641
+ {
15642
+ "name": "properties",
15643
+ "type": "IReadOnlyList<JsonSchemaFieldDto>",
15644
+ "optional": false
15645
+ },
15646
+ {
15647
+ "name": "required",
15648
+ "type": "IReadOnlyList<string>",
15649
+ "optional": true
15650
+ }
15651
+ ]
15652
+ },
15653
+ "ArrayFieldDto": {
15654
+ "base": "JsonSchemaFieldDto",
15655
+ "fields": [
15656
+ {
15657
+ "name": "items",
15658
+ "type": "JsonSchemaFieldDto",
15659
+ "optional": false
15660
+ },
15661
+ {
15662
+ "name": "minItems",
15663
+ "type": "number",
15664
+ "optional": true
15665
+ },
15666
+ {
15667
+ "name": "maxItems",
15668
+ "type": "number",
15669
+ "optional": true
15670
+ },
15671
+ {
15672
+ "name": "uniqueItems",
15673
+ "type": "boolean",
15674
+ "optional": true
15675
+ }
15676
+ ]
15677
+ },
15678
+ "JsonFieldDto": {
15679
+ "base": "JsonSchemaFieldDto",
15680
+ "fields": [
15681
+ {
15682
+ "name": "maxBytes",
15683
+ "type": "number",
15684
+ "optional": true
15483
15685
  }
15484
15686
  ]
15485
15687
  },
@@ -16744,6 +16946,26 @@
16744
16946
  }
16745
16947
  ]
16746
16948
  },
16949
+ "GetFileByIdResponse": {
16950
+ "base": "ResponseBase",
16951
+ "fields": [
16952
+ {
16953
+ "name": "file",
16954
+ "type": "FileResourceRefDto",
16955
+ "optional": true
16956
+ },
16957
+ {
16958
+ "name": "isPublic",
16959
+ "type": "boolean",
16960
+ "optional": true
16961
+ },
16962
+ {
16963
+ "name": "publicUrl",
16964
+ "type": "string",
16965
+ "optional": true
16966
+ }
16967
+ ]
16968
+ },
16747
16969
  "GetFolderFilesResponse": {
16748
16970
  "base": "ResponseBase",
16749
16971
  "fields": [
@@ -22845,6 +23067,11 @@
22845
23067
  "name": "sortOrder",
22846
23068
  "type": "number",
22847
23069
  "optional": true
23070
+ },
23071
+ {
23072
+ "name": "expandReferences",
23073
+ "type": "boolean",
23074
+ "optional": false
22848
23075
  }
22849
23076
  ]
22850
23077
  },
@@ -22865,6 +23092,11 @@
22865
23092
  "name": "databaseIntegrationId",
22866
23093
  "type": "string",
22867
23094
  "optional": true
23095
+ },
23096
+ {
23097
+ "name": "expandReferences",
23098
+ "type": "boolean",
23099
+ "optional": false
22868
23100
  }
22869
23101
  ]
22870
23102
  },
@@ -22995,6 +23227,11 @@
22995
23227
  "name": "update",
22996
23228
  "type": "string",
22997
23229
  "optional": false
23230
+ },
23231
+ {
23232
+ "name": "arrayFilters",
23233
+ "type": "string",
23234
+ "optional": true
22998
23235
  }
22999
23236
  ]
23000
23237
  },
@@ -23020,6 +23257,11 @@
23020
23257
  "name": "update",
23021
23258
  "type": "string",
23022
23259
  "optional": false
23260
+ },
23261
+ {
23262
+ "name": "arrayFilters",
23263
+ "type": "string",
23264
+ "optional": true
23023
23265
  }
23024
23266
  ]
23025
23267
  },
@@ -23513,6 +23755,21 @@
23513
23755
  }
23514
23756
  ]
23515
23757
  },
23758
+ "GetFileById": {
23759
+ "base": "CodeMashRequestBase",
23760
+ "fields": [
23761
+ {
23762
+ "name": "filesIntegrationId",
23763
+ "type": "string",
23764
+ "optional": false
23765
+ },
23766
+ {
23767
+ "name": "id",
23768
+ "type": "string",
23769
+ "optional": false
23770
+ }
23771
+ ]
23772
+ },
23516
23773
  "GetFolderFiles": {
23517
23774
  "base": "CodeMashListPaginationRequestBase",
23518
23775
  "fields": [
@@ -3578,6 +3578,17 @@
3578
3578
  "pathParams": [],
3579
3579
  "scope": "project"
3580
3580
  },
3581
+ {
3582
+ "surface": "hub",
3583
+ "group": "files",
3584
+ "method": "getFileById",
3585
+ "requestDto": "GetFileById",
3586
+ "responseDto": "GetFileByIdResponse",
3587
+ "path": "/{version}/files/item/by-id",
3588
+ "verb": "GET",
3589
+ "pathParams": [],
3590
+ "scope": "project"
3591
+ },
3581
3592
  {
3582
3593
  "surface": "hub",
3583
3594
  "group": "files",
@@ -7185,6 +7196,20 @@
7185
7196
  ],
7186
7197
  "scope": "project"
7187
7198
  },
7199
+ {
7200
+ "surface": "api",
7201
+ "group": "files",
7202
+ "method": "getFileById",
7203
+ "requestDto": "GetFileByIdRequest",
7204
+ "responseDto": "GetFileByIdResponse",
7205
+ "path": "/{version}/files/{filesIntegrationId}/by-id/{id}",
7206
+ "verb": "GET",
7207
+ "pathParams": [
7208
+ "filesIntegrationId",
7209
+ "id"
7210
+ ],
7211
+ "scope": "project"
7212
+ },
7188
7213
  {
7189
7214
  "surface": "api",
7190
7215
  "group": "files",
package/dist/server.js CHANGED
@@ -72,7 +72,6 @@ export const curated = [
72
72
  { name: 'norbix_get_marketplace_integrations', surface: 'hub', group: 'code', method: 'getMarketplaceIntegrations', description: 'List marketplace integrations of the project.' },
73
73
  { name: 'norbix_save_marketplace_integration', surface: 'hub', group: 'code', method: 'saveMarketplaceIntegration', description: 'Create or update a marketplace integration.' },
74
74
  { name: 'norbix_get_database_schemas', surface: 'hub', group: 'database', method: 'getDatabaseSchemas', description: 'List database collection schemas of the project.' },
75
- { name: 'norbix_find_documents', surface: 'api', group: 'database', method: 'find', description: 'Query documents in a database collection (filter, sort, projection, paging).' },
76
75
  { name: 'norbix_get_roles', surface: 'hub', group: 'membership', method: 'getRoles', description: 'List membership roles of the project.' },
77
76
  { name: 'norbix_get_policies', surface: 'hub', group: 'membership', method: 'getPolicies', description: 'List membership policies of the project.' },
78
77
  { name: 'norbix_get_logs', surface: 'hub', group: 'logs', method: 'getLogs', description: 'Query project logs.' },
@@ -106,6 +105,69 @@ export function buildServer(handle) {
106
105
  .string()
107
106
  .optional()
108
107
  .describe('Database integration id; omit for the project default database.');
108
+ const expandReferences = z
109
+ .boolean()
110
+ .optional()
111
+ .describe('true = every reference field (user, role, taxonomy term, collection record, file) comes back as { id, display } — an array of them when the field is multiple. display is the target’s displayField (a term: { title, slug? }); null when the target is missing or your key may not read it. Default false = the stored ids only.');
112
+ server.registerTool('norbix_find_documents', {
113
+ title: 'norbix_find_documents',
114
+ description: 'Query documents in a database collection: MongoDB filter, sort, cursor paging, optional reference expansion. [GET /{version}/database/collections/{collectionName}]',
115
+ inputSchema: {
116
+ collectionName: z.string().describe('Collection (schema) name, e.g. "products".'),
117
+ filter: jsonValue.optional().describe('MongoDB filter (object or JSON string), e.g. { "price": { "$gt": 5 } }.'),
118
+ sortBy: z.string().optional().describe('Field to sort by.'),
119
+ sortOrder: z.number().int().optional().describe('1 = ascending, -1 = descending.'),
120
+ pageSize: z.number().int().min(1).max(1000).optional(),
121
+ startingAfter: z.string().optional().describe('Cursor paging: id of the last document of the previous page.'),
122
+ endingBefore: z.string().optional().describe('Cursor paging: id of the first document of the next page.'),
123
+ expandReferences,
124
+ databaseIntegrationId: integrationId,
125
+ body: z
126
+ .record(z.unknown())
127
+ .optional()
128
+ .describe('Any other FindRequest field (schemaVersion, pagingArgs, …). The named inputs above win over the same key here.'),
129
+ },
130
+ }, async ({ collectionName, filter, sortBy, sortOrder, pageSize, startingAfter, endingBefore, expandReferences: expand, databaseIntegrationId, body }) => {
131
+ try {
132
+ return json(await invoke(handle.client, 'api', 'database', 'find', {
133
+ ...(body ?? {}),
134
+ collectionName,
135
+ ...(filter !== undefined ? { filter: asJson(filter) } : {}),
136
+ ...(sortBy !== undefined ? { sortBy } : {}),
137
+ ...(sortOrder !== undefined ? { sortOrder } : {}),
138
+ ...(pageSize !== undefined ? { pageSize } : {}),
139
+ ...(startingAfter !== undefined ? { startingAfter } : {}),
140
+ ...(endingBefore !== undefined ? { endingBefore } : {}),
141
+ ...(expand !== undefined ? { expandReferences: expand } : {}),
142
+ ...(databaseIntegrationId ? { databaseIntegrationId } : {}),
143
+ }));
144
+ }
145
+ catch (e) {
146
+ return err(e);
147
+ }
148
+ });
149
+ server.registerTool('norbix_find_one_document', {
150
+ title: 'norbix_find_one_document',
151
+ description: 'Get one document by id, with optional reference expansion. [GET /{version}/database/collections/{collectionName}/{id}]',
152
+ inputSchema: {
153
+ collectionName: z.string().describe('Collection (schema) name.'),
154
+ id: z.string().describe('Document id.'),
155
+ expandReferences,
156
+ databaseIntegrationId: integrationId,
157
+ },
158
+ }, async ({ collectionName, id, expandReferences: expand, databaseIntegrationId }) => {
159
+ try {
160
+ return json(await invoke(handle.client, 'api', 'database', 'findOne', {
161
+ collectionName,
162
+ id,
163
+ ...(expand !== undefined ? { expandReferences: expand } : {}),
164
+ ...(databaseIntegrationId ? { databaseIntegrationId } : {}),
165
+ }));
166
+ }
167
+ catch (e) {
168
+ return err(e);
169
+ }
170
+ });
109
171
  server.registerTool('norbix_insert_document', {
110
172
  title: 'norbix_insert_document',
111
173
  description: 'Insert one document into a database collection. Returns the new id. [POST /{version}/database/collections/{collectionName}]',
@@ -133,14 +195,18 @@ export function buildServer(handle) {
133
195
  collectionName: z.string().describe('Collection (schema) name.'),
134
196
  id: z.string().describe('Document id.'),
135
197
  update: jsonValue.describe('The fields to change as a plain document, e.g. { "field": "value" } (object or JSON string). No $ operators.'),
198
+ arrayFilters: jsonValue
199
+ .optional()
200
+ .describe('MongoDB arrayFilters for positional paths in update, e.g. update { "items.$[i].qty": 2 } with arrayFilters [ { "i.sku": "A1" } ] (array or JSON string).'),
136
201
  databaseIntegrationId: integrationId,
137
202
  },
138
- }, async ({ collectionName, id, update, databaseIntegrationId }) => {
203
+ }, async ({ collectionName, id, update, arrayFilters, databaseIntegrationId }) => {
139
204
  try {
140
205
  return json(await invoke(handle.client, 'api', 'database', 'updateOne', {
141
206
  collectionName,
142
207
  id,
143
208
  update: asJson(update),
209
+ ...(arrayFilters !== undefined ? { arrayFilters: asJson(arrayFilters) } : {}),
144
210
  ...(databaseIntegrationId ? { databaseIntegrationId } : {}),
145
211
  }));
146
212
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norbix.ai/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Norbix MCP server — manage projects, integrations, databases, membership, notifications and every other Norbix Hub/API endpoint from Claude, Cursor, VS Code, Windsurf or any MCP client.",
5
5
  "author": "UAB Isidos",
6
6
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "scripts": {
37
37
  "generate-manifest": "node scripts/generate-manifest.mjs",
38
- "build": "tsc && cp -r src/manifest dist/manifest && node -e \"require('fs').chmodSync('dist/index.js', 0o755)\"",
38
+ "build": "tsc && node -e \"const fs=require('fs');fs.rmSync('dist/manifest',{recursive:true,force:true});fs.cpSync('src/manifest','dist/manifest',{recursive:true});fs.chmodSync('dist/index.js',0o755)\"",
39
39
  "prepublishOnly": "npm run build",
40
40
  "start": "node dist/index.js",
41
41
  "start:http": "node dist/index.js --http",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@modelcontextprotocol/sdk": "^1.12.0",
48
- "@norbix.ai/ts": "^4.11.0",
48
+ "@norbix.ai/ts": "^4.14.0",
49
49
  "express": "^4.21.2",
50
50
  "zod": "^3.24.0"
51
51
  },