@lightupai/polaris 0.0.21 → 0.0.23
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/package.json +1 -1
- package/src/cli/cli.ts +18 -28
package/package.json
CHANGED
package/src/cli/cli.ts
CHANGED
|
@@ -115,7 +115,7 @@ async function install(participantId?: string) {
|
|
|
115
115
|
|
|
116
116
|
console.log(" Installing MCP server to ~/.polaris/mcp/...");
|
|
117
117
|
const npmInstall = Bun.spawnSync(
|
|
118
|
-
["npm", "install", "--prefix", mcpDir, "@lightupai/polaris
|
|
118
|
+
["npm", "install", "--prefix", mcpDir, "@lightupai/polaris"],
|
|
119
119
|
{ stdout: "ignore", stderr: "pipe" }
|
|
120
120
|
);
|
|
121
121
|
if (npmInstall.exitCode !== 0) {
|
|
@@ -126,33 +126,23 @@ async function install(participantId?: string) {
|
|
|
126
126
|
// The binary is at ~/.polaris/mcp/node_modules/.bin/polaris-mcp
|
|
127
127
|
const mcpBin = join(mcpDir, "node_modules", ".bin", "polaris-mcp");
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const mergedMcp = {
|
|
148
|
-
...existingMcp,
|
|
149
|
-
mcpServers: {
|
|
150
|
-
...(existingMcp as { mcpServers?: Record<string, unknown> }).mcpServers,
|
|
151
|
-
...mcpConfig.mcpServers,
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
await writeFile(mcpConfigPath, JSON.stringify(mergedMcp, null, 2));
|
|
155
|
-
console.log(" ✓ MCP server config written");
|
|
129
|
+
// Register MCP server with Claude Code via `claude mcp add`
|
|
130
|
+
// This writes to the correct config location that Claude Code reads
|
|
131
|
+
// Remove first to avoid duplicates, then add with user scope
|
|
132
|
+
Bun.spawnSync(["claude", "mcp", "remove", "polaris", "-s", "user"], {
|
|
133
|
+
stdout: "ignore", stderr: "ignore",
|
|
134
|
+
});
|
|
135
|
+
const mcpAdd = Bun.spawnSync(
|
|
136
|
+
["claude", "mcp", "add", "polaris", "-s", "user", "-e", "POLARIS_DAEMON_URL=http://127.0.0.1:4322", "--", mcpBin],
|
|
137
|
+
{ stdout: "pipe", stderr: "pipe" }
|
|
138
|
+
);
|
|
139
|
+
if (mcpAdd.exitCode === 0) {
|
|
140
|
+
console.log(" ✓ MCP server registered with Claude Code");
|
|
141
|
+
} else {
|
|
142
|
+
console.error(" Warning: could not register MCP server with Claude Code.");
|
|
143
|
+
console.error(" " + mcpAdd.stderr.toString().trim());
|
|
144
|
+
console.error(` Run manually: claude mcp add -s user -e POLARIS_DAEMON_URL=http://127.0.0.1:4322 polaris -- ${mcpBin}`);
|
|
145
|
+
}
|
|
156
146
|
|
|
157
147
|
// Hooks
|
|
158
148
|
const captureShPath = join(import.meta.dir, "..", "..", "hooks", "capture.sh");
|