@habitusnet/bc365 2.2.3 → 2.2.4

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,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.2.4] — 2026-02-20
6
+
7
+ ### Fixed
8
+ - `bc365 onboard --help` now shows `--scope` instead of the removed `--output` flag
9
+ - `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`
10
+
5
11
  ## [2.2.3] — 2026-02-20
6
12
 
7
13
  ### Changed
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.4",
4
4
  "description": "Smart onboarding CLI and MCP config manager for Business Central",
5
5
  "type": "module",
6
6
  "bin": {