bc-telemetry-buddy-mcp 3.5.1 → 3.6.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 +23 -0
- package/README.md +51 -0
- package/dist/cli.js +166 -166
- package/dist/server.js +138 -138
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.6.0] - 2026-07-18
|
|
11
|
+
|
|
12
|
+
_Highest blast-radius rating across all plans landed in this release: `low-risk`._
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **Per-workspace connections are now discoverable and selectable under Claude Code (and other roots-advertising hosts).** A workspace's own flat `.bctb-config.json` connection is discovered from `CLAUDE_PROJECT_DIR` (synchronous, checked at the opened folder and one level below — so the `…/<Customer>/TelemetryAnalysis/.bctb-config.json` layout is found) and from the MCP `roots` capability. Discovered connections appear in `list_profiles` tagged `source:"workspace"` and are selectable with `switch_profile <name>` — no global-config edit, no restart. A single globally-registered server can now query any customer workspace you open. See [docs/plans/mcp-workspace-connection-discovery.md](../../docs/plans/mcp-workspace-connection-discovery.md).
|
|
16
|
+
- **Opt-in auto-activation of the local connection.** Set `BCTB_AUTO_WORKSPACE_CONNECTION=true` in the server `env` and, when exactly one workspace connection is discovered, it becomes the active connection at startup (with a loud `[MCP] AUTO-ACTIVATED …` stderr line). Default is OFF; discovery never silently retargets which App Insights resource is queried (cross-tenant safety). More than one discovered connection → no auto-pick.
|
|
17
|
+
- **New telemetry** `TB-MCP-006` (`WorkspaceProfileSwitch`, emitted when a workspace connection is activated) and a `connectionsFound` count added to `TB-MCP-004` (`RootsDiscovery`) — both path-free.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- **Switching to a workspace connection no longer strands you.** `list_profiles`/`switch_profile` are now anchored to the pinned/global config file (`baseConfigFilePath`), so after selecting a workspace connection the global profiles remain listed and switchable. Profile-switch service re-initialization is now atomic — a mid-switch failure leaves the previous connection fully intact.
|
|
21
|
+
|
|
22
|
+
## [3.5.2] - 2026-06-25
|
|
23
|
+
|
|
24
|
+
_Highest blast-radius rating across all plans landed in this release: `low-risk`._
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- **Workspace `.bctb-config.json` and `.vscode/.bctb/knowledge` were ignored under non-VS-Code MCP hosts (Claude Code, Cursor CLI, raw stdio), so `get_knowledge` silently returned "Knowledge Base is not available".** The server depended on the VS Code extension setting `BCTB_WORKSPACE_PATH`; without it, `workspacePath` fell back to the launch cwd (often an unrelated sibling folder) and the Knowledge Base never loaded. The workspace is now resolved host-agnostically: env → explicit `workspacePath` → **the directory of the `--config` file** → cwd, and an unexpanded `${workspaceFolder}` token no longer silently resolves to cwd. See [docs/plans/done/mcp-workspace-knowledge-discovery.md](../../docs/plans/done/mcp-workspace-knowledge-discovery.md).
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- **MCP `roots` fallback for workspace knowledge.** When the eager (config-dir-anchored) load finds no workspace knowledge and the MCP client advertises the `roots` capability, the server requests the host's workspace roots after connecting and loads knowledge from the first root containing both `.bctb-config.json` and `.vscode/.bctb/knowledge`. This decouples the connection (from your global `--config`) from the knowledge (from the project you opened). Roots discovery never changes the active connection/profile.
|
|
31
|
+
- **Diagnosable Knowledge Base failures.** `get_knowledge` now reports the path it looked under and the reason (`no-workspace-config`, `no-workspace-path`, `load-failed`) instead of a bare "not available", and the server logs a `[KB]` startup line. New telemetry events `TB-MCP-003` (workspace resolution) and `TB-MCP-004` (roots discovery) carry only path-free counts/enums.
|
|
32
|
+
|
|
10
33
|
## [3.5.1] - 2026-06-02
|
|
11
34
|
|
|
12
35
|
_Highest blast-radius rating across all plans landed in this release: `low-risk`._
|
package/README.md
CHANGED
|
@@ -235,6 +235,57 @@ If Claude Desktop shows connection errors:
|
|
|
235
235
|
3. Test authentication: Run `az account show` to verify Azure CLI login
|
|
236
236
|
4. Ensure paths use absolute paths with proper escaping
|
|
237
237
|
|
|
238
|
+
### With Claude Code & other non-VS-Code hosts
|
|
239
|
+
|
|
240
|
+
Outside VS Code there is no extension to inject `BCTB_WORKSPACE_PATH`, so the server discovers the workspace (and therefore its Knowledge Base, cache, and queries) host-agnostically. **The connection config and the workspace knowledge are independent**: the config you load supplies the connection, and the workspace knowledge is located separately. Resolution order for the workspace folder:
|
|
241
|
+
|
|
242
|
+
1. **`BCTB_WORKSPACE_PATH`** environment variable, if set.
|
|
243
|
+
2. **An explicit `workspacePath`** in the loaded config (absolute path, not `${workspaceFolder}`).
|
|
244
|
+
3. **The directory of the `--config` file** — so pointing `--config` at a workspace's `.bctb-config.json` auto-anchors knowledge to that folder. *(`${workspaceFolder}` is only expanded by VS Code; outside VS Code it now resolves to this config directory instead of silently falling back to the launch cwd.)*
|
|
245
|
+
4. **The host's workspace roots** — if the MCP client advertises the [`roots`](https://modelcontextprotocol.io/docs/concepts/roots) capability (Claude Code does), the server requests them after connecting and loads workspace knowledge from the first root containing both `.bctb-config.json` and `.vscode/.bctb/knowledge`. This works even when `--config` points at a global config, so your global connection keeps working while knowledge comes from the project you opened.
|
|
246
|
+
|
|
247
|
+
**Recommended — point `--config` at the workspace config** (project-scoped `.mcp.json` at the workspace root):
|
|
248
|
+
|
|
249
|
+
```json
|
|
250
|
+
{
|
|
251
|
+
"mcpServers": {
|
|
252
|
+
"bc-telemetry-buddy-mcp": {
|
|
253
|
+
"command": "npx",
|
|
254
|
+
"args": ["-y", "bc-telemetry-buddy-mcp", "start",
|
|
255
|
+
"--config", "/abs/path/TelemetryAnalysis/.bctb-config.json"],
|
|
256
|
+
"env": {}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Or set `BCTB_WORKSPACE_PATH` explicitly** in the server's `env` to override discovery:
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
"env": { "BCTB_WORKSPACE_PATH": "/abs/path/TelemetryAnalysis" }
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
If knowledge can't be located, `get_knowledge` returns a diagnostic naming the exact path it looked under and why (e.g. `reason: no-workspace-config`) — so a missing Knowledge Base is debuggable rather than silent. The server also logs a `[KB]` line to stderr at startup.
|
|
269
|
+
|
|
270
|
+
#### Per-workspace connections (`list_profiles` / `switch_profile`)
|
|
271
|
+
|
|
272
|
+
The workspace folder(s) you open are also scanned for their own `.bctb-config.json` **connections**, so a single globally-registered server can query any customer without editing the global config. Discovered connections show up in `list_profiles` tagged `source:"workspace"` and are selectable with `switch_profile <name>` — no restart, no global-file edit. Two discovery signals feed this:
|
|
273
|
+
|
|
274
|
+
- **`CLAUDE_PROJECT_DIR`** — Claude Code sets this to the opened project root. The server checks it and one level below it (so `…/<Customer>/TelemetryAnalysis/.bctb-config.json` is found even though the config is a subfolder of the opened root). This is synchronous, so the connection is available on the very first `list_profiles` call.
|
|
275
|
+
- **MCP `roots`** — every advertised root is scanned the same way.
|
|
276
|
+
|
|
277
|
+
Discovered connections are keyed by the opened folder's name (e.g. `Coeck`), because most customer configs share the same `connectionName`. When two discovered connections share a name, `switch_profile` by that name returns an "ambiguous" error listing the exact keys to use instead.
|
|
278
|
+
|
|
279
|
+
**Safety — discovery never silently retargets your queries.** By default a workspace connection is only made *selectable*; the active App Insights resource changes only when *you* call `switch_profile`. To make the local connection win automatically on open, opt in with:
|
|
280
|
+
|
|
281
|
+
```json
|
|
282
|
+
"env": { "BCTB_AUTO_WORKSPACE_CONNECTION": "true" }
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
When set, and when **exactly one** workspace connection is discovered, the server activates it at startup and prints a loud `[MCP] AUTO-ACTIVATED …` line to stderr. Setting this flag means: *I accept that opening a workspace retargets which App Insights resource is queried.* With more than one connection discovered, it does nothing (ambiguous) and you pick with `switch_profile`.
|
|
286
|
+
|
|
287
|
+
> **Auth note (`azure_cli`):** switching connection changes the App Insights *resource*, not your identity — `azure_cli` uses your current `az login` session and ignores the config's `tenantId`. If a query returns 403 after switching, run `az login --tenant <tenantId>`.
|
|
288
|
+
|
|
238
289
|
### With Copilot Studio
|
|
239
290
|
|
|
240
291
|
Register as Custom Action:
|