claude-brain 0.27.0 → 0.27.1

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/README.md CHANGED
@@ -32,7 +32,7 @@ bun install -g claude-brain
32
32
  claude-brain setup
33
33
 
34
34
  # Register with Claude Code
35
- claude mcp add claude-brain -- bunx claude-brain@latest
35
+ claude mcp add claude-brain -s user -- bunx claude-brain@latest
36
36
  ```
37
37
 
38
38
  That's it. Every Claude Code session now has 25 brain tools available.
@@ -42,7 +42,7 @@ That's it. Every Claude Code session now has 25 brain tools available.
42
42
  Skip the global install — just register with Claude Code directly:
43
43
 
44
44
  ```bash
45
- claude mcp add claude-brain -- bunx claude-brain@latest
45
+ claude mcp add claude-brain -s user -- bunx claude-brain@latest
46
46
  ```
47
47
 
48
48
  On first run, `~/.claude-brain/` is auto-created with default config.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.27.0
1
+ 0.27.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-brain",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
4
4
  "description": "Local development assistant bridging Obsidian vaults with Claude Code via MCP",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -37,7 +37,26 @@ export async function runInstall() {
37
37
  console.log()
38
38
 
39
39
  if (isMcpAlreadyConfigured()) {
40
- console.log(box(successText('Already MCP configured. Claude Brain is registered as an MCP server.'), 'Success'))
40
+ // Ensure user scope remove local/project scope if present, then register at user scope
41
+ for (const scope of ['local', 'project']) {
42
+ try {
43
+ execSync(`claude mcp remove claude-brain -s ${scope}`, {
44
+ encoding: 'utf-8',
45
+ stdio: ['pipe', 'pipe', 'pipe']
46
+ })
47
+ } catch {
48
+ // OK — may not exist at this scope
49
+ }
50
+ }
51
+ try {
52
+ execSync('claude mcp add claude-brain -s user -- claude-brain serve', {
53
+ encoding: 'utf-8',
54
+ stdio: ['pipe', 'pipe', 'pipe']
55
+ })
56
+ } catch {
57
+ // OK — may already be registered at user scope
58
+ }
59
+ console.log(box(successText('MCP registered at user scope. Claude Brain is available in all projects.'), 'Success'))
41
60
  } else {
42
61
  try {
43
62
  await withSpinner('Registering with Claude Code', async () => {
@@ -115,6 +115,19 @@ function sleep(ms: number): Promise<void> {
115
115
  return new Promise(resolve => setTimeout(resolve, ms))
116
116
  }
117
117
 
118
+ function cleanupLocalMcpScopes(): void {
119
+ try {
120
+ execSync('claude mcp remove claude-brain -s local', {
121
+ encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 10_000,
122
+ })
123
+ } catch {}
124
+ try {
125
+ execSync('claude mcp remove claude-brain -s project', {
126
+ encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 10_000,
127
+ })
128
+ } catch {}
129
+ }
130
+
118
131
  function isMcpConfigured(): boolean {
119
132
  try {
120
133
  const result = execSync('claude mcp list', {
@@ -279,9 +292,12 @@ export async function runRefresh() {
279
292
  }
280
293
 
281
294
  // 3e. MCP registration
282
- const mcpOk = await withSpinner('Checking MCP registration', async () => {
283
- if (isMcpConfigured()) return true
284
- return registerMcp()
295
+ const mcpOk = await withSpinner('Ensuring MCP at user scope', async () => {
296
+ cleanupLocalMcpScopes()
297
+ if (!isMcpConfigured()) {
298
+ return registerMcp()
299
+ }
300
+ return true
285
301
  })
286
302
  if (mcpOk) {
287
303
  results.push(['MCP', 'ok', 'Registered in Claude Code'])