@mithung/vunet-mcp-server 2.1.1 → 2.2.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 (3) hide show
  1. package/README.md +69 -9
  2. package/index.js +108 -2
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Query metrics, traces, logs, and data models from your Vunet tenants using natural language through AI assistants like Claude, GitHub Copilot, or any MCP-compatible client.
10
10
 
11
- > **Latest Version:** 2.1.1 - Updated repository URLs, authentication improvements with proxy support.
11
+ > **Latest Version:** 2.2.0 - Added `vunet_fetch_datamodels` tool for live data model discovery from the VuNet API.
12
12
 
13
13
  ---
14
14
 
@@ -135,30 +135,61 @@ If you've cloned the repository:
135
135
  ## 📊 Available MCP Tools
136
136
 
137
137
  ### 1. `vunet_get_status`
138
- Check authentication status and session validity.
138
+ Check the current connection status and tenant information.
139
139
 
140
140
  ```
141
141
  Example: "Check if Vunet connection is working"
142
142
  ```
143
143
 
144
144
  ### 2. `vunet_list_data_models`
145
- List all available data models/metrics in the tenant.
145
+ List common Vunet data models organised by category (APM, Infrastructure, Database, Network, etc.).
146
+
147
+ **Parameters:**
148
+ | Parameter | Required | Description |
149
+ |-----------|----------|-------------|
150
+ | `category` | No | Filter by category: `apm`, `infrastructure`, `database`, `network`, `business`, `all` (default: `all`) |
146
151
 
147
152
  ```
148
153
  Example: "List all available Vunet data models"
154
+ Example: "Show me infrastructure data models in Vunet"
149
155
  ```
150
156
 
151
- ### 3. `vunet_query_metric`
157
+ ### 3. `vunet_fetch_datamodels`
158
+ Fetch the actual **live** DataModels (signals) configured in this VuNet tenant via `/api/vuaccel/datamodel/`. Returns real signal names, types (Metric/Event/Log), data sources, and column details. Use this to discover what data is available before querying with `vunet_query_metric`.
159
+
160
+ **Parameters:**
161
+ | Parameter | Required | Description |
162
+ |-----------|----------|-------------|
163
+ | `limit` | No | Number of results per page (default: 10, max: 100) |
164
+ | `offset` | No | Pagination offset — records to skip (default: 0) |
165
+ | `search` | No | Search keyword to filter by name (e.g., `UPI`, `CPU`, `transaction`) |
166
+ | `signal_type` | No | Filter by type: `Metric`, `Event`, or `Log` |
167
+ | `ordering` | No | Sort field (e.g., `signal_name`, `-creation_time`) |
168
+
169
+ ```
170
+ Example: "Fetch all live data models from VuNet"
171
+ Example: "Find data models related to UPI in VuNet"
172
+ Example: "List all Event type data models"
173
+ ```
174
+
175
+ ### 4. `vunet_query_metric`
152
176
  Query a specific metric with time range and filters.
153
177
 
154
178
  **Parameters:**
155
179
  | Parameter | Required | Description |
156
180
  |-----------|----------|-------------|
157
181
  | `metric_name` | Yes | Name of the data model to query |
158
- | `relative_time` | No | Time range: `5m`, `15m`, `1h`, `2h`, `1d`, `1w`, `1M` |
159
- | `start_time` | No | Start epoch timestamp (for absolute range) |
160
- | `end_time` | No | End epoch timestamp (for absolute range) |
161
- | `filters` | No | JSON object with field:value filters |
182
+ | `relative_time` | No | Time range: `5m`, `15m`, `1h`, `2h`, `1d`, `1w`, `1M`, `1y` |
183
+ | `start_time` | No | Start epoch timestamp or `now`, `now-1h` (use with `end_time`) |
184
+ | `end_time` | No | End epoch timestamp or `now` (use with `start_time`) |
185
+ | `filters` | No | JSON object with field:value pairs for filtering |
186
+ | `fields` | No | Comma-separated fields to include in response |
187
+ | `exclude_fields` | No | Comma-separated fields to exclude from response |
188
+ | `include_thresholds` | No | Include threshold data in response (default: false) |
189
+ | `format` | No | Response format — use `lama` for Log Analytics format |
190
+ | `compare_intervals` | No | Additional time intervals for comparison (e.g., `1h_ago`, `1d_ago`) |
191
+ | `join_models` | No | Comma-separated additional data models to join |
192
+ | `time_shift` | No | Time shift for comparison (e.g., `1h`, `1d`, `1w`) |
162
193
 
163
194
  ---
164
195
 
@@ -169,34 +200,58 @@ Query a specific metric with time range and filters.
169
200
  "Is the Vunet MCP server connected?"
170
201
  ```
171
202
 
172
- ### List Available Metrics
203
+ ### Discover Live Data Models
204
+ ```
205
+ "Fetch all available data models from VuNet"
206
+ "Show me all Metric type data models"
207
+ "Find data models related to UPI payments"
208
+ "Search for CPU-related data models in VuNet"
209
+ ```
210
+
211
+ ### List Categorised Data Models
173
212
  ```
174
213
  "What data models are available in Vunet?"
214
+ "Show me infrastructure data models"
215
+ "List all APM data models"
175
216
  ```
176
217
 
177
218
  ### Query Journey Metrics
178
219
  ```
179
220
  "Show me IBMB Journey Metrics for the last 2 hours"
221
+ "Get UPI Volume data for the last 1 hour"
222
+ "Query CBS TAT metrics for the last 30 minutes"
180
223
  ```
181
224
 
182
225
  ### Query Alerts
183
226
  ```
184
227
  "Get all critical alerts from the last 1 hour"
228
+ "Show warning alerts with group values for the last 15 minutes"
185
229
  ```
186
230
 
187
231
  ### Query with Filters
188
232
  ```
189
233
  "Query IBMB Journey Metrics where name equals CBS for the last 30 minutes"
234
+ "Get Linux CPU Utilization filtered by hostname for the last 2 hours"
190
235
  ```
191
236
 
192
237
  ### Infrastructure Monitoring
193
238
  ```
194
239
  "Show CPU utilization for IBMB servers in the last hour"
240
+ "Get memory utilization for CBS servers in the last 2 hours"
241
+ "Show MSSQL blocking sessions for the last 30 minutes"
195
242
  ```
196
243
 
197
244
  ### RCA Analysis
198
245
  ```
199
246
  "Get Technical Decline data for IBMB in the last 2 hours"
247
+ "Show RCA root cause data for the last 1 hour"
248
+ "Query RCA lead indicators for the last 4 hours"
249
+ ```
250
+
251
+ ### Time Comparison
252
+ ```
253
+ "Compare UPI Volume for the last 1 hour vs same time yesterday"
254
+ "Show IBMB TAT with 1-day comparison"
200
255
  ```
201
256
 
202
257
  ---
@@ -277,6 +332,11 @@ npm list -g @mithung/vunet-mcp-server
277
332
 
278
333
  ## 📄 Changelog
279
334
 
335
+ ### v2.2.0 (2026-03-18)
336
+ - ✅ Added `vunet_fetch_datamodels` tool — live data model discovery via `/api/vuaccel/datamodel/`
337
+ - ✅ Supports pagination, search, signal type filter, and ordering
338
+ - ✅ Fixed `package.json` bin entries (`npm pkg fix`)
339
+
280
340
  ### v2.1.1 (2026-02-18)
281
341
  - ✅ Updated repository URLs to correct GitHub organization
282
342
  - ✅ Fixed package metadata
package/index.js CHANGED
@@ -222,6 +222,42 @@ class VunetMCPServer {
222
222
  /**
223
223
  * Query a metric/data model
224
224
  */
225
+ /**
226
+ * Fetch datamodels from the VuNet tenant with pagination and optional search/filter.
227
+ * Automatically re-authenticates on 401.
228
+ */
229
+ async fetchDataModels({ limit = 10, offset = 0, search = "", signal_type = "", ordering = "" } = {}) {
230
+ await this.ensureAuthenticated();
231
+
232
+ const params = new URLSearchParams({ ordering, limit, offset, search });
233
+ if (signal_type) params.set("signal_type", signal_type);
234
+
235
+ const url = `${this.normalizeTenantUrl(this.tenantUrl)}/api/vuaccel/datamodel/?${params.toString()}`;
236
+
237
+ try {
238
+ const response = await axios.get(url, {
239
+ headers: { Authorization: `Bearer ${this.sessionToken}` },
240
+ httpsAgent: this.httpsAgent,
241
+ });
242
+ return response.data;
243
+ } catch (error) {
244
+ if (error.response?.status === 401) {
245
+ // Token expired — re-authenticate and retry once
246
+ this.isAuthenticated = false;
247
+ await this.ensureAuthenticated();
248
+ const retryResponse = await axios.get(url, {
249
+ headers: { Authorization: `Bearer ${this.sessionToken}` },
250
+ httpsAgent: this.httpsAgent,
251
+ });
252
+ return retryResponse.data;
253
+ }
254
+ const errorDetails = error.response?.data
255
+ ? JSON.stringify(error.response.data)
256
+ : error.message;
257
+ throw new Error(`Failed to fetch datamodels: ${errorDetails}`);
258
+ }
259
+ }
260
+
225
261
  async queryMetric(metricName, queryParams) {
226
262
  await this.ensureAuthenticated();
227
263
 
@@ -355,6 +391,36 @@ class VunetMCPServer {
355
391
  },
356
392
  },
357
393
  },
394
+ {
395
+ name: "vunet_fetch_datamodels",
396
+ description: "Fetch the actual live DataModels (signals) configured in this VuNet tenant by calling /api/vuaccel/datamodel/. Returns real signal names, types (Metric/Event/Log), data sources, and column details. Use this to discover what data is available before querying with vunet_query_metric.",
397
+ inputSchema: {
398
+ type: "object",
399
+ properties: {
400
+ limit: {
401
+ type: "number",
402
+ description: "Number of results to return per page (default: 10, max: 100)",
403
+ },
404
+ offset: {
405
+ type: "number",
406
+ description: "Pagination offset — number of records to skip (default: 0)",
407
+ },
408
+ search: {
409
+ type: "string",
410
+ description: "Search keyword to filter data models by name (e.g., 'UPI', 'CPU', 'transaction')",
411
+ },
412
+ signal_type: {
413
+ type: "string",
414
+ description: "Filter by signal type: 'Metric', 'Event', or 'Log'",
415
+ enum: ["Metric", "Event", "Log"],
416
+ },
417
+ ordering: {
418
+ type: "string",
419
+ description: "Field to sort results by (e.g., 'signal_name', '-creation_time')",
420
+ },
421
+ },
422
+ },
423
+ },
358
424
  ],
359
425
  }));
360
426
 
@@ -373,6 +439,9 @@ class VunetMCPServer {
373
439
  case "vunet_list_data_models":
374
440
  return await this.handleListDataModels(args);
375
441
 
442
+ case "vunet_fetch_datamodels":
443
+ return await this.handleFetchDataModels(args);
444
+
376
445
  default:
377
446
  throw new Error(`Unknown tool: ${name}`);
378
447
  }
@@ -430,8 +499,7 @@ class VunetMCPServer {
430
499
  };
431
500
  }
432
501
 
433
- async handleListDataModels(args = {}) {
434
- const category = args.category || "all";
502
+ async handleListDataModels(args = {}) { const category = args.category || "all";
435
503
 
436
504
  const dataModels = {
437
505
  apm: [
@@ -544,6 +612,44 @@ class VunetMCPServer {
544
612
  };
545
613
  }
546
614
 
615
+ async handleFetchDataModels(args = {}) {
616
+ const { limit = 10, offset = 0, search = "", signal_type = "", ordering = "" } = args;
617
+
618
+ const data = await this.fetchDataModels({ limit, offset, search, signal_type, ordering });
619
+
620
+ // Shape a clean, LLM-friendly summary
621
+ const models = (data.results || []).map((m) => ({
622
+ signal_id: m.signal_id,
623
+ signal_name: m.signal_name,
624
+ signal_type: m.signal_type,
625
+ description: m.description || "",
626
+ sources: m.source_names || [],
627
+ columns: (m.metric_column_details || []).map((c) => c.column_name || c.name || c),
628
+ created_by: m.created_by,
629
+ last_modified: m.last_modified_time,
630
+ }));
631
+
632
+ const result = {
633
+ tenant: this.tenantUrl,
634
+ total_count: data.count,
635
+ returned: models.length,
636
+ offset,
637
+ has_more: offset + models.length < data.count,
638
+ next_offset: offset + models.length < data.count ? offset + models.length : null,
639
+ tip: "Use signal_name values with the vunet_query_metric tool to fetch actual data.",
640
+ datamodels: models,
641
+ };
642
+
643
+ return {
644
+ content: [
645
+ {
646
+ type: "text",
647
+ text: JSON.stringify(result, null, 2),
648
+ },
649
+ ],
650
+ };
651
+ }
652
+
547
653
  async run() {
548
654
  console.error("Vunet MCP Server starting...");
549
655
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mithung/vunet-mcp-server",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "Model Context Protocol (MCP) Server for Vunet vuSmartMaps - Multi-tenant observability platform integration",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "bin": {
8
- "vunet-mcp": "./cli.js",
9
- "@mithung/vunet-mcp-server": "./cli.js"
8
+ "vunet-mcp": "cli.js",
9
+ "vunet-mcp-server": "cli.js"
10
10
  },
11
11
  "scripts": {
12
12
  "start": "node index.js",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "https://github.com/mithung-vunet/vunet-mcp-server.git"
45
+ "url": "git+https://github.com/mithung-vunet/vunet-mcp-server.git"
46
46
  },
47
47
  "bugs": {
48
48
  "url": "https://github.com/mithung-vunet/vunet-mcp-server/issues"