bc-telemetry-buddy-mcp 3.0.2 → 3.1.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 +30 -0
- package/README.md +82 -1
- package/config-schema.json +251 -0
- package/dist/cli.js +400 -282
- package/dist/server.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.1.0] - 2026-02-26
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Agentic Autonomous Telemetry Monitoring** (`src/agent/`) — complete implementation of the autonomous monitoring runtime described in `Instructions/4. Agentic Monitoring/Design.md`
|
|
14
|
+
- `AgentRuntime` (`runtime.ts`): ReAct loop that drives agents through LLM reasoning + tool calls
|
|
15
|
+
- `AgentContextManager` (`context.ts`): Manages agent state, instruction, run logs, and sliding-window context compaction
|
|
16
|
+
- `ActionDispatcher` (`actions.ts`): Executes external actions — Teams webhook, SMTP email, Graph API email, generic webhooks, Azure DevOps pipeline triggers
|
|
17
|
+
- `prompts.ts`: System prompt, prompt builder, structured output parser, tool scope filtering
|
|
18
|
+
- `report.ts`: Markdown run report generator (creates human-readable `.md` alongside `.json` audit trail)
|
|
19
|
+
- `providers/anthropic.ts`: Anthropic/Claude LLM provider (translates OpenAI-style tool calls ↔ Anthropic Messages API)
|
|
20
|
+
- **Agent CLI commands** (`bctb-mcp agent <command>`):
|
|
21
|
+
- `agent start <instruction> --name <name>` — Create a new monitoring agent
|
|
22
|
+
- `agent run <name> --once` — Run a single monitoring pass
|
|
23
|
+
- `agent run-all --once` — Run all active agents
|
|
24
|
+
- `agent list` — List all agents with status and issue counts
|
|
25
|
+
- `agent history <name> --limit <n>` — Show run history
|
|
26
|
+
- `agent pause <name>` / `agent resume <name>` — Set agent status
|
|
27
|
+
- **LLM Provider Abstraction**: `LLMProvider` interface decouples runtime from any specific SDK. Supports Azure OpenAI (default) and Anthropic/Claude.
|
|
28
|
+
- **Pipeline Templates** (`templates/`):
|
|
29
|
+
- `templates/github-actions/telemetry-agent.yml` + `README.md` — GitHub Actions hourly schedule with state commit
|
|
30
|
+
- `templates/azure-devops/azure-pipelines.yml` + `README.md` — Azure DevOps pipeline equivalent
|
|
31
|
+
- `templates/agents/` — Four fully-documented example agent instruction templates:
|
|
32
|
+
- `appsource-validation` — Monitors AppSource extension validation failures
|
|
33
|
+
- `performance-monitoring` — Tracks page/report/AL performance with p95 thresholds
|
|
34
|
+
- `error-rate-monitoring` — Catch-all error rate monitor with dynamic event discovery
|
|
35
|
+
- `post-deployment-check` — Short-lived post-deployment regression monitor
|
|
36
|
+
- **Config Schema** (`config-schema.json`): Added `agents` section schema with full type definitions for LLM config, defaults, and all 5 action types
|
|
37
|
+
- **Config Template** (`bctb-mcp init`): Now includes agents section template with Azure OpenAI placeholder
|
|
38
|
+
- **7 new test files** (`src/__tests__/agent/`): `context.test.ts`, `runtime.test.ts`, `runtime.integration.test.ts`, `actions.test.ts`, `prompts.test.ts`, `providers.test.ts`, `report.test.ts`, `cli-agent.test.ts` — 18+ new tests; all 564 MCP tests pass
|
|
39
|
+
|
|
10
40
|
## [3.0.2] - 2026-02-26
|
|
11
41
|
|
|
12
42
|
### Fixed
|
package/README.md
CHANGED
|
@@ -12,9 +12,10 @@ BC Telemetry Buddy MCP Server is a **standalone NPM package** that enables AI as
|
|
|
12
12
|
**Key Features:**
|
|
13
13
|
- 🚀 **Standalone Package**: Install globally with `npm install -g bc-telemetry-buddy-mcp` - no dependencies on VSCode extension
|
|
14
14
|
- 🤖 **AI Assistant Ready**: Works with GitHub Copilot, Claude Desktop, Claude Code, Copilot Studio, and Cursor via the official MCP SDK over stdio
|
|
15
|
-
- 🔧 **CLI Interface**: `bctb-mcp` command with init, validate, test-auth, and
|
|
15
|
+
- 🔧 **CLI Interface**: `bctb-mcp` command with init, validate, test-auth, start, and **agent** subcommands
|
|
16
16
|
- 📁 **File-Based Config**: Simple `.bctb-config.json` with schema validation and environment variable substitution
|
|
17
17
|
- 👥 **Multi-Profile Support**: Manage multiple customers/environments in single config file with profile switching
|
|
18
|
+
- 🤖 **Agentic Monitoring**: Autonomous scheduled telemetry monitoring via CI/CD pipelines — LLM-powered reasoning, issue tracking, Teams/email alerts
|
|
18
19
|
- 🔌 **Optional for VSCode**: VSCode extension works standalone; MCP only required for chat participant features
|
|
19
20
|
- 🔄 **Automatic Updates**: Update notifications on startup when newer versions are available on NPM
|
|
20
21
|
- 🧪 **Comprehensive Testing**: 70%+ test coverage with dedicated test suites for Claude Desktop workflows
|
|
@@ -263,6 +264,86 @@ bctb-mcp --version
|
|
|
263
264
|
bctb-mcp --help
|
|
264
265
|
```
|
|
265
266
|
|
|
267
|
+
## Agentic Monitoring
|
|
268
|
+
|
|
269
|
+
BC Telemetry Buddy MCP includes a built-in **autonomous agent runtime** for scheduled telemetry monitoring. Agents use an LLM (Azure OpenAI or Anthropic) to query telemetry, reason about findings, track issues across runs, and take action — all without manual intervention.
|
|
270
|
+
|
|
271
|
+
### Agent CLI Commands
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Create a new monitoring agent
|
|
275
|
+
bctb-mcp agent start "<instruction>" --name <agent-name>
|
|
276
|
+
|
|
277
|
+
# Run one monitoring pass
|
|
278
|
+
bctb-mcp agent run <agent-name> --once
|
|
279
|
+
|
|
280
|
+
# Run all active agents
|
|
281
|
+
bctb-mcp agent run-all --once
|
|
282
|
+
|
|
283
|
+
# List agents with status
|
|
284
|
+
bctb-mcp agent list
|
|
285
|
+
|
|
286
|
+
# View run history
|
|
287
|
+
bctb-mcp agent history <agent-name> [--limit 10]
|
|
288
|
+
|
|
289
|
+
# Pause / resume an agent
|
|
290
|
+
bctb-mcp agent pause <agent-name>
|
|
291
|
+
bctb-mcp agent resume <agent-name>
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Minimal Config for Agents
|
|
295
|
+
|
|
296
|
+
Add an `agents` section to `.bctb-config.json`:
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"profiles": { ... },
|
|
301
|
+
"defaultProfile": "default",
|
|
302
|
+
"agents": {
|
|
303
|
+
"llm": {
|
|
304
|
+
"provider": "azure-openai",
|
|
305
|
+
"endpoint": "https://your-resource.openai.azure.com",
|
|
306
|
+
"deployment": "gpt-4o",
|
|
307
|
+
"apiVersion": "2024-10-21"
|
|
308
|
+
},
|
|
309
|
+
"actions": {
|
|
310
|
+
"teams-webhook": { "url": "${TEAMS_WEBHOOK_URL}" }
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Set `AZURE_OPENAI_KEY` environment variable (or `ANTHROPIC_API_KEY` for Anthropic).
|
|
317
|
+
|
|
318
|
+
### CI/CD Pipeline Integration
|
|
319
|
+
|
|
320
|
+
Copy a ready-made pipeline template from the npm package:
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
# GitHub Actions
|
|
324
|
+
cp node_modules/bc-telemetry-buddy-mcp/templates/github-actions/telemetry-agent.yml .github/workflows/
|
|
325
|
+
|
|
326
|
+
# Azure DevOps
|
|
327
|
+
cp node_modules/bc-telemetry-buddy-mcp/templates/azure-devops/azure-pipelines.yml ./
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Pre-Built Agent Templates
|
|
331
|
+
|
|
332
|
+
| Template | Use Case |
|
|
333
|
+
|----------|----------|
|
|
334
|
+
| `appsource-validation` | Monitor extension install/update failures |
|
|
335
|
+
| `performance-monitoring` | Track p95 latencies and slow operations |
|
|
336
|
+
| `error-rate-monitoring` | Catch-all error rate monitoring |
|
|
337
|
+
| `post-deployment-check` | Short-lived regression detection after deployments |
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Copy a template to your workspace
|
|
341
|
+
cp -r node_modules/bc-telemetry-buddy-mcp/templates/agents/performance-monitoring agents/
|
|
342
|
+
bctb-mcp agent run performance-monitoring --once
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
See the [User Guide](https://github.com/waldo1001/waldo.BCTelemetryBuddy/blob/main/docs/UserGuide.md#agentic-monitoring) for full docs including action types, state management, and troubleshooting.
|
|
346
|
+
|
|
266
347
|
## Features
|
|
267
348
|
|
|
268
349
|
- **Authentication**: Azure CLI, Device Code, and Client Credentials flows via MSAL
|
package/config-schema.json
CHANGED
|
@@ -98,6 +98,103 @@
|
|
|
98
98
|
"items": {
|
|
99
99
|
"$ref": "#/definitions/reference"
|
|
100
100
|
}
|
|
101
|
+
},
|
|
102
|
+
"agents": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"description": "Agentic Autonomous Telemetry Monitoring — configuration for scheduled monitoring agents that run via bctb-mcp agent commands or CI/CD pipelines.",
|
|
105
|
+
"properties": {
|
|
106
|
+
"llm": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"description": "LLM provider configuration for agent reasoning.",
|
|
109
|
+
"properties": {
|
|
110
|
+
"provider": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"enum": [
|
|
113
|
+
"azure-openai",
|
|
114
|
+
"anthropic"
|
|
115
|
+
],
|
|
116
|
+
"description": "LLM provider. 'azure-openai' uses AZURE_OPENAI_KEY env var; 'anthropic' uses ANTHROPIC_API_KEY env var.",
|
|
117
|
+
"default": "azure-openai"
|
|
118
|
+
},
|
|
119
|
+
"endpoint": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"description": "Azure OpenAI endpoint URL (azure-openai only). Can also be set via AZURE_OPENAI_ENDPOINT env var."
|
|
122
|
+
},
|
|
123
|
+
"deployment": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"description": "Azure OpenAI deployment name or Anthropic model (e.g. 'gpt-4o', 'claude-opus-4-5'). Can also be set via AZURE_OPENAI_DEPLOYMENT / ANTHROPIC_MODEL env var."
|
|
126
|
+
},
|
|
127
|
+
"model": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"description": "Alias for 'deployment'. Preferred for Anthropic configs (e.g. 'claude-opus-4-5')."
|
|
130
|
+
},
|
|
131
|
+
"apiVersion": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"description": "Azure OpenAI API version (azure-openai only).",
|
|
134
|
+
"default": "2024-10-21"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"required": [
|
|
138
|
+
"provider"
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
"defaults": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"description": "Default runtime settings applied to all agents.",
|
|
144
|
+
"properties": {
|
|
145
|
+
"maxToolCalls": {
|
|
146
|
+
"type": "number",
|
|
147
|
+
"description": "Maximum LLM tool calls per agent run before aborting.",
|
|
148
|
+
"default": 20
|
|
149
|
+
},
|
|
150
|
+
"maxTokens": {
|
|
151
|
+
"type": "number",
|
|
152
|
+
"description": "Maximum tokens per LLM response.",
|
|
153
|
+
"default": 4096
|
|
154
|
+
},
|
|
155
|
+
"contextWindowRuns": {
|
|
156
|
+
"type": "number",
|
|
157
|
+
"description": "Sliding window size for recent runs kept in state.json.",
|
|
158
|
+
"default": 5
|
|
159
|
+
},
|
|
160
|
+
"resolvedIssueTTLDays": {
|
|
161
|
+
"type": "number",
|
|
162
|
+
"description": "Days to keep resolved issues in state.json before pruning.",
|
|
163
|
+
"default": 30
|
|
164
|
+
},
|
|
165
|
+
"toolScope": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"enum": [
|
|
168
|
+
"read-only",
|
|
169
|
+
"full"
|
|
170
|
+
],
|
|
171
|
+
"description": "Tool access scope for agents. 'read-only' prevents save_query and other write tools.",
|
|
172
|
+
"default": "read-only"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"actions": {
|
|
177
|
+
"type": "object",
|
|
178
|
+
"description": "External action configurations (Teams, email, webhooks, pipelines). Secrets should be provided as environment variables, not stored here.",
|
|
179
|
+
"properties": {
|
|
180
|
+
"teams-webhook": {
|
|
181
|
+
"$ref": "#/definitions/teamsWebhookAction"
|
|
182
|
+
},
|
|
183
|
+
"email-smtp": {
|
|
184
|
+
"$ref": "#/definitions/emailSmtpAction"
|
|
185
|
+
},
|
|
186
|
+
"email-graph": {
|
|
187
|
+
"$ref": "#/definitions/emailGraphAction"
|
|
188
|
+
},
|
|
189
|
+
"generic-webhook": {
|
|
190
|
+
"$ref": "#/definitions/genericWebhookAction"
|
|
191
|
+
},
|
|
192
|
+
"pipeline-trigger": {
|
|
193
|
+
"$ref": "#/definitions/pipelineTriggerAction"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
101
198
|
}
|
|
102
199
|
},
|
|
103
200
|
"definitions": {
|
|
@@ -202,6 +299,160 @@
|
|
|
202
299
|
"type",
|
|
203
300
|
"url"
|
|
204
301
|
]
|
|
302
|
+
},
|
|
303
|
+
"teamsWebhookAction": {
|
|
304
|
+
"type": "object",
|
|
305
|
+
"description": "Microsoft Teams Incoming Webhook action.",
|
|
306
|
+
"properties": {
|
|
307
|
+
"url": {
|
|
308
|
+
"type": "string",
|
|
309
|
+
"description": "Teams Incoming Webhook URL. Can also be set via TEAMS_WEBHOOK_URL env var."
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"required": [
|
|
313
|
+
"url"
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
"emailSmtpAction": {
|
|
317
|
+
"type": "object",
|
|
318
|
+
"description": "Email via SMTP relay (SendGrid, Office 365, etc.).",
|
|
319
|
+
"properties": {
|
|
320
|
+
"host": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"description": "SMTP host"
|
|
323
|
+
},
|
|
324
|
+
"port": {
|
|
325
|
+
"type": "number",
|
|
326
|
+
"description": "SMTP port (587 for TLS, 465 for SSL)",
|
|
327
|
+
"default": 587
|
|
328
|
+
},
|
|
329
|
+
"secure": {
|
|
330
|
+
"type": "boolean",
|
|
331
|
+
"description": "Use TLS (true for port 465)",
|
|
332
|
+
"default": false
|
|
333
|
+
},
|
|
334
|
+
"auth": {
|
|
335
|
+
"type": "object",
|
|
336
|
+
"properties": {
|
|
337
|
+
"user": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"description": "SMTP username or 'apikey' for SendGrid"
|
|
340
|
+
},
|
|
341
|
+
"pass": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"description": "SMTP password (prefer SMTP_PASSWORD env var)"
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"required": [
|
|
347
|
+
"user"
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
"from": {
|
|
351
|
+
"type": "string",
|
|
352
|
+
"description": "From address"
|
|
353
|
+
},
|
|
354
|
+
"defaultTo": {
|
|
355
|
+
"type": "array",
|
|
356
|
+
"items": {
|
|
357
|
+
"type": "string"
|
|
358
|
+
},
|
|
359
|
+
"description": "Default recipient email addresses"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"required": [
|
|
363
|
+
"host",
|
|
364
|
+
"port",
|
|
365
|
+
"auth",
|
|
366
|
+
"from",
|
|
367
|
+
"defaultTo"
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
"emailGraphAction": {
|
|
371
|
+
"type": "object",
|
|
372
|
+
"description": "Email via Microsoft Graph API (requires Mail.Send app permission).",
|
|
373
|
+
"properties": {
|
|
374
|
+
"tenantId": {
|
|
375
|
+
"type": "string",
|
|
376
|
+
"description": "Azure AD tenant ID"
|
|
377
|
+
},
|
|
378
|
+
"clientId": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"description": "App Registration client ID with Mail.Send permission"
|
|
381
|
+
},
|
|
382
|
+
"from": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"description": "Sender mailbox UPN (the mailbox the app sends from)"
|
|
385
|
+
},
|
|
386
|
+
"defaultTo": {
|
|
387
|
+
"type": "array",
|
|
388
|
+
"items": {
|
|
389
|
+
"type": "string"
|
|
390
|
+
},
|
|
391
|
+
"description": "Default recipient email addresses"
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"required": [
|
|
395
|
+
"tenantId",
|
|
396
|
+
"clientId",
|
|
397
|
+
"from",
|
|
398
|
+
"defaultTo"
|
|
399
|
+
]
|
|
400
|
+
},
|
|
401
|
+
"genericWebhookAction": {
|
|
402
|
+
"type": "object",
|
|
403
|
+
"description": "Generic HTTP webhook (Slack, PagerDuty, custom endpoints).",
|
|
404
|
+
"properties": {
|
|
405
|
+
"url": {
|
|
406
|
+
"type": "string",
|
|
407
|
+
"description": "Webhook URL"
|
|
408
|
+
},
|
|
409
|
+
"method": {
|
|
410
|
+
"type": "string",
|
|
411
|
+
"enum": [
|
|
412
|
+
"POST",
|
|
413
|
+
"PUT",
|
|
414
|
+
"PATCH"
|
|
415
|
+
],
|
|
416
|
+
"default": "POST"
|
|
417
|
+
},
|
|
418
|
+
"headers": {
|
|
419
|
+
"type": "object",
|
|
420
|
+
"description": "Additional HTTP headers (e.g. Authorization for Slack or PagerDuty)",
|
|
421
|
+
"additionalProperties": {
|
|
422
|
+
"type": "string"
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
"required": [
|
|
427
|
+
"url"
|
|
428
|
+
]
|
|
429
|
+
},
|
|
430
|
+
"pipelineTriggerAction": {
|
|
431
|
+
"type": "object",
|
|
432
|
+
"description": "Azure DevOps pipeline trigger action.",
|
|
433
|
+
"properties": {
|
|
434
|
+
"orgUrl": {
|
|
435
|
+
"type": "string",
|
|
436
|
+
"description": "Azure DevOps organization URL (e.g. https://dev.azure.com/contoso)"
|
|
437
|
+
},
|
|
438
|
+
"project": {
|
|
439
|
+
"type": "string",
|
|
440
|
+
"description": "Azure DevOps project name"
|
|
441
|
+
},
|
|
442
|
+
"pipelineId": {
|
|
443
|
+
"type": "number",
|
|
444
|
+
"description": "Pipeline definition ID"
|
|
445
|
+
},
|
|
446
|
+
"pat": {
|
|
447
|
+
"type": "string",
|
|
448
|
+
"description": "Personal Access Token (prefer DEVOPS_PAT env var)"
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"required": [
|
|
452
|
+
"orgUrl",
|
|
453
|
+
"project",
|
|
454
|
+
"pipelineId"
|
|
455
|
+
]
|
|
205
456
|
}
|
|
206
457
|
}
|
|
207
458
|
}
|