@brain-mcps/setup 0.2.1 → 0.2.3

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/dist/index.d.ts CHANGED
@@ -14,6 +14,13 @@ export interface ClientDef {
14
14
  buildEntry: (url: string) => Record<string, unknown>;
15
15
  /** If set, only these platforms are supported. Otherwise all platforms. */
16
16
  supportedPlatforms?: NodeJS.Platform[];
17
+ /**
18
+ * ~-prefixed path whose existence marks the client as installed (used by
19
+ * detectInstalledClients). Defaults to the config file's parent directory.
20
+ * Needed when the config lives directly in the home dir (Claude Code's
21
+ * ~/.claude.json), where the parent is ~ and would always "exist".
22
+ */
23
+ detectPath?: string;
17
24
  }
18
25
  export interface ClientConfig extends ClientDef {
19
26
  configPath: string;
package/dist/index.js CHANGED
@@ -50,8 +50,8 @@ const PRODUCT_URLS = {
50
50
  mentor: "https://mcp.mentor4ai.app/mcp",
51
51
  };
52
52
  const PRODUCT_SERVER_NAMES = {
53
- brain: "cerebro-externo",
54
- mentor: "forge-mentor",
53
+ brain: "brain4ai",
54
+ mentor: "mentor4ai",
55
55
  };
56
56
  // ── Client Definitions ───────────────────────────────────────────────────
57
57
  const CLAUDE_DESKTOP_PLATFORMS = ["darwin", "win32"];
@@ -66,9 +66,17 @@ exports.CLIENT_DEFS = {
66
66
  "claude-code": {
67
67
  id: "claude-code",
68
68
  name: "Claude Code",
69
- configPathTemplate: "~/.claude/settings.json",
69
+ // Claude Code reads user-scoped MCP servers from ~/.claude.json (what
70
+ // `claude mcp add -s user` writes), NOT ~/.claude/settings.json (which is
71
+ // for settings and silently ignores an mcpServers key). Remote HTTP
72
+ // servers use transport type "http" (verified against Claude Code 2.1.x).
73
+ configPathTemplate: "~/.claude.json",
74
+ // ~/.claude.json sits directly in the home dir, so detect Claude Code by
75
+ // its ~/.claude directory instead of the config file's parent (which is ~,
76
+ // and would always report as installed).
77
+ detectPath: "~/.claude",
70
78
  serversKey: ["mcpServers"],
71
- buildEntry: (url) => ({ type: "url", url }),
79
+ buildEntry: (url) => ({ type: "http", url }),
72
80
  },
73
81
  "claude-desktop": {
74
82
  id: "claude-desktop",
@@ -206,12 +214,15 @@ function setupClient(clientId, product, options = {}) {
206
214
  return { client: clientId, configPath, action, serverName };
207
215
  }
208
216
  function detectInstalledClients(homeDir) {
217
+ const home = homeDir ?? os.homedir();
209
218
  return Object.keys(exports.CLIENT_DEFS).filter((id) => {
210
219
  if (!isClientSupportedOnPlatform(id))
211
220
  return false;
212
- const configPath = resolveConfigPath(id, homeDir);
213
- const configDir = path.dirname(configPath);
214
- return fs.existsSync(configDir);
221
+ const def = exports.CLIENT_DEFS[id];
222
+ const marker = def.detectPath
223
+ ? def.detectPath.replace(/^~/, home)
224
+ : path.dirname(resolveConfigPath(id, homeDir));
225
+ return fs.existsSync(marker);
215
226
  });
216
227
  }
217
228
  function listClients(homeDir) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brain-mcps/setup",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Configure AI assistant clients to connect to Brain4AI and Mentor4AI MCP servers",
5
5
  "bin": {
6
6
  "brain-mcp-setup": "dist/cli.js"