bc-telemetry-buddy-mcp 3.6.0 → 3.7.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/CHANGELOG.md +14 -0
- package/README.md +20 -2
- package/dist/cli.js +168 -166
- package/dist/server.js +154 -152
- package/package.json +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.7.0] - 2026-07-18
|
|
11
|
+
|
|
12
|
+
_Highest blast-radius rating across all plans landed in this release: `low-risk`._
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **MCP Embedded Resources for `query_telemetry`**: New `resultFormat` (`text` | `resource`) and `fileFormat` (`json` | `csv`) parameters. When `resultFormat: "resource"`, query results are returned as an MCP embedded resource file (CSV or JSON) with a brief text summary in model context — enabling agents with code interpreters to process large datasets. Aligned with Microsoft BC MCP 2026 Wave 1 pattern. Spec: [docs/specs/131-query-telemetry-embedded-resources.md](../../docs/specs/131-query-telemetry-embedded-resources.md).
|
|
16
|
+
- **Resource template** `bctb://exports/{filename}`: Clients can list and read exported files via `resources/list` and `resources/read`. Embedded and listed resources always use the `bctb://` scheme (never `file://` absolute paths).
|
|
17
|
+
- **`resources` capability** added to server capabilities.
|
|
18
|
+
- **`ExportService`** in shared package: CSV/JSON file exports to `.vscode/.bctb/exports/` (git-ignored) with 24h auto-cleanup keyed on `mtime`.
|
|
19
|
+
- **Telemetry**: `TB-MCP-117` (`RESOURCE_EXPORTED`) event ID for tracking resource exports with format and row/column counts.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **`query_telemetry` responses now contain real column names.** The App Insights v1 API returns columns as `{name, type}`, but parsing mapped the Kusto-native `columnName` field — so the `columns` array was `[null, …]` for every query. Both shapes are now accepted. (Found by the PR #108 embedded-resources smoke test: CSV exports had an empty header row.)
|
|
23
|
+
|
|
10
24
|
## [3.6.0] - 2026-07-18
|
|
11
25
|
|
|
12
26
|
_Highest blast-radius rating across all plans landed in this release: `low-risk`._
|
package/README.md
CHANGED
|
@@ -446,8 +446,9 @@ The server exposes **11 tools** to language models (GitHub Copilot, Claude Deskt
|
|
|
446
446
|
|
|
447
447
|
### Query Execution (Step 4 of workflow)
|
|
448
448
|
- **`query_telemetry`**: Execute KQL queries against Application Insights
|
|
449
|
-
- Parameters: `kql` (required KQL query string), `useContext` (boolean, default: true), `includeExternal` (boolean, default: true)
|
|
449
|
+
- Parameters: `kql` (required KQL query string), `useContext` (boolean, default: true), `includeExternal` (boolean, default: true), `resultFormat` (enum: `text` | `resource`, default: `text`), `fileFormat` (enum: `json` | `csv`, default: `csv`)
|
|
450
450
|
- Returns: Query results with summary, recommendations, and chart suggestions
|
|
451
|
+
- **Embedded Resources**: Set `resultFormat: "resource"` to receive results as an MCP embedded resource file instead of inline text. The response contains a brief text summary (for lightweight model context) plus an embedded resource with the full data as CSV or JSON. This enables agents with code interpreters (e.g., Python/pandas) to process large datasets, create visualizations, and perform structured analysis. CSV is the default file format as it works natively with `pd.read_csv()`.
|
|
451
452
|
- **When to use**: After discovery and understanding phases - execute the actual query with precise KQL
|
|
452
453
|
|
|
453
454
|
### Query Library (Step 3 of workflow)
|
|
@@ -715,7 +716,7 @@ The MCP server uses `@bctb/shared` for core functionality (auth, kusto, cache, q
|
|
|
715
716
|
**`mcpSdkServer.ts`** - MCP SDK server for stdio mode (primary)
|
|
716
717
|
- Uses official `@modelcontextprotocol/sdk` (protocol 2025-06-18)
|
|
717
718
|
- `StdioServerTransport` for JSON-RPC 2.0 over stdin/stdout
|
|
718
|
-
- Capabilities: `tools` (with `listChanged`), `logging`
|
|
719
|
+
- Capabilities: `tools` (with `listChanged`), `resources`, `prompts`, `logging`
|
|
719
720
|
- Automatic Zod schema conversion from JSON Schema tool definitions
|
|
720
721
|
|
|
721
722
|
**`tools/toolDefinitions.ts`** - Single source of truth for all tool metadata
|
|
@@ -746,6 +747,7 @@ The MCP server uses `@bctb/shared` for core functionality (auth, kusto, cache, q
|
|
|
746
747
|
- **`sanitize.ts`** - PII removal and data sanitization
|
|
747
748
|
- **`eventLookup.ts`** - Telemetry event catalog and schema discovery
|
|
748
749
|
- **`references.ts`** - External KQL example fetching
|
|
750
|
+
- **`exports.ts`** - File export service for embedded MCP resources (CSV/JSON)
|
|
749
751
|
|
|
750
752
|
### Data Flow
|
|
751
753
|
|
|
@@ -762,6 +764,22 @@ The MCP server uses `@bctb/shared` for core functionality (auth, kusto, cache, q
|
|
|
762
764
|
3. **Execution**: Same business logic methods on MCPServer class
|
|
763
765
|
4. **Response**: JSON-RPC response over HTTP
|
|
764
766
|
|
|
767
|
+
### Embedded Resources (MCP Resource Support)
|
|
768
|
+
|
|
769
|
+
The MCP server supports **embedded resources** for `query_telemetry`, enabling agents to receive large result sets as file references instead of inline text. This is aligned with Microsoft's BC MCP 2026 Wave 1 pattern.
|
|
770
|
+
|
|
771
|
+
**How it works:**
|
|
772
|
+
1. Agent calls `query_telemetry` with `resultFormat: "resource"` (and optionally `fileFormat: "csv"` or `"json"`)
|
|
773
|
+
2. Server executes the query, writes results to a file in `{workspace}/.vscode/.bctb/exports/`
|
|
774
|
+
3. Response contains a brief text summary + an MCP embedded resource (`{type: "resource", resource: {uri, mimeType, text}}`)
|
|
775
|
+
4. Agent passes the file reference to a code interpreter for analysis, charts, etc.
|
|
776
|
+
|
|
777
|
+
**Resource template:** `bctb://exports/{filename}` — clients can list and read exported files via `resources/list` and `resources/read`.
|
|
778
|
+
|
|
779
|
+
**File cleanup:** Export files older than 24 hours are automatically cleaned up on server startup and after each new export.
|
|
780
|
+
|
|
781
|
+
**Backward compatible:** Without `resultFormat` (or with `resultFormat: "text"`), behavior is unchanged — results are returned as inline JSON text.
|
|
782
|
+
|
|
765
783
|
## Publishing
|
|
766
784
|
|
|
767
785
|
### Publish to NPM
|