@habitusnet/bc365 2.2.3 → 2.2.5

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 CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.2.5] — 2026-02-20
6
+
7
+ ### Changed
8
+ - README: documents `--scope` flag with reference table and examples for `onboard` and `switch`
9
+
10
+ ## [2.2.4] — 2026-02-20
11
+
12
+ ### Fixed
13
+ - `bc365 onboard --help` now shows `--scope` instead of the removed `--output` flag
14
+ - `bc365 switch` now re-registers MCP servers via `claude mcp add-json -s <scope>` instead of writing `.mcp.json`; accepts the same `--scope` option as `onboard`
15
+
5
16
  ## [2.2.3] — 2026-02-20
6
17
 
7
18
  ### Changed
package/README.md CHANGED
@@ -44,7 +44,20 @@ npx @habitusnet/bc365 onboard
44
44
  - **`bc-data`** — query and update BC data via OData (customers, items, orders, G/L entries)
45
45
  - **`bc-admin`** — manage environments, apps, feature flags, and sessions
46
46
 
47
- Servers are registered at local scope (`.claude/settings.local.json`, gitignored and per-user). Run with `--scope project` to write a shared `.mcp.json` instead.
47
+ Servers are registered at local scope (`.claude/settings.local.json`, gitignored and per-user). Pass `--scope` to override:
48
+
49
+ | Scope | Stored in | Use when |
50
+ |-------|-----------|----------|
51
+ | `local` (default) | `.claude/settings.local.json` | Per-user, gitignored — recommended |
52
+ | `user` | `~/.claude.json` | All projects for this user |
53
+ | `project` | `.mcp.json` | Shared team config, committed to git |
54
+
55
+ ```bash
56
+ bc365 onboard # local scope (default)
57
+ bc365 onboard --scope project # writes .mcp.json
58
+ bc365 switch habitusnet-prod # re-register saved profile at local scope
59
+ bc365 switch habitusnet-prod --scope user # re-register at user scope
60
+ ```
48
61
 
49
62
  ## Claude Code Skills
50
63
 
@@ -68,9 +81,9 @@ Skills are also bundled in this package under `skills/` for offline use.
68
81
 
69
82
  | Command | Description |
70
83
  |---------|-------------|
71
- | `bc365 onboard [--scope local\|project]` | Discover and register MCP servers |
84
+ | `bc365 onboard [-s local\|user\|project]` | Discover and register MCP servers |
85
+ | `bc365 switch <profile> [-s local\|user\|project]` | Re-register servers from a saved profile |
72
86
  | `bc365 profiles` | List saved profiles |
73
- | `bc365 switch <profile>` | Switch to a saved profile |
74
87
  | `bc365 check` | Check latest npm versions of bc365 packages |
75
88
 
76
89
  ## Multi-Tenant Usage
package/lib/cli.js CHANGED
@@ -17,13 +17,13 @@ program
17
17
 
18
18
  program
19
19
  .command('onboard')
20
- .description('Auto-discover tenant/environment/company and write .mcp.json')
20
+ .description('Auto-discover tenant/environment/company and register MCP servers with Claude Code')
21
21
  .option('-t, --tenant-id <id>', 'Azure AD tenant ID (skip Graph lookup)')
22
- .option('-o, --output <path>', 'Output path for .mcp.json', '.mcp.json')
22
+ .option('-s, --scope <scope>', 'Configuration scope: local, user, or project (default: local)', 'local')
23
23
  .option('-p, --profile <name>', 'Profile name to save (default: tenantId/envName)')
24
24
  .action(async (opts) => {
25
25
  try {
26
- await onboard({ tenantId: opts.tenantId, output: opts.output, profileName: opts.profile });
26
+ await onboard({ tenantId: opts.tenantId, scope: opts.scope, profileName: opts.profile });
27
27
  } catch (err) {
28
28
  console.error(chalk.red(`✗ ${err.message}`));
29
29
  process.exit(1);
@@ -32,8 +32,8 @@ program
32
32
 
33
33
  program
34
34
  .command('switch <profile>')
35
- .description('Switch active profile (writes .mcp.json from saved profile)')
36
- .option('-o, --output <path>', 'Output path', '.mcp.json')
35
+ .description('Switch active profile (re-registers MCP servers from saved profile)')
36
+ .option('-s, --scope <scope>', 'Configuration scope: local, user, or project (default: local)', 'local')
37
37
  .action(async (profileName, opts) => {
38
38
  try {
39
39
  const profile = await loadProfile(profileName);
@@ -41,11 +41,15 @@ program
41
41
  console.error(chalk.red(`✗ Profile '${profileName}' not found. Run 'bc365 onboard' first.`));
42
42
  process.exit(1);
43
43
  }
44
- const { writeFile } = await import('node:fs/promises');
44
+ const { execFile: _execFile } = await import('node:child_process');
45
+ const { promisify } = await import('node:util');
46
+ const execFile = promisify(_execFile);
45
47
  const { buildMcpConfig } = await import('./onboard.js');
46
48
  const config = buildMcpConfig(profile);
47
- await writeFile(opts.output, JSON.stringify(config, null, 2), 'utf8');
48
- console.log(chalk.green(`✓ Switched to profile '${profileName}'`));
49
+ for (const [name, serverConfig] of Object.entries(config.mcpServers)) {
50
+ await execFile('claude', ['mcp', 'add-json', '-s', opts.scope, name, JSON.stringify(serverConfig)]);
51
+ }
52
+ console.log(chalk.green(`✓ Switched to profile '${profileName}' (scope: ${opts.scope})`));
49
53
  } catch (err) {
50
54
  console.error(chalk.red(`✗ ${err.message}`));
51
55
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@habitusnet/bc365",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "Smart onboarding CLI and MCP config manager for Business Central",
5
5
  "type": "module",
6
6
  "bin": {