@artyfacts/claude 1.3.18 → 1.3.20
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/chunk-4BEMUW57.mjs +1033 -0
- package/dist/chunk-KXV4I4WJ.mjs +1033 -0
- package/dist/cli.js +13 -4
- package/dist/cli.mjs +1 -1
- package/dist/index.js +13 -4
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/mcp.ts +19 -7
package/dist/cli.js
CHANGED
|
@@ -876,8 +876,17 @@ function addMcpServer(options) {
|
|
|
876
876
|
} else {
|
|
877
877
|
const error = result.stderr || result.stdout || `Exit code ${result.status}`;
|
|
878
878
|
if (error.includes("already exists")) {
|
|
879
|
-
console.log(`[MCP] Server ${name}
|
|
880
|
-
|
|
879
|
+
console.log(`[MCP] Server ${name} exists - removing old config...`);
|
|
880
|
+
(0, import_child_process2.spawnSync)("claude", ["mcp", "remove", name], { encoding: "utf-8" });
|
|
881
|
+
const retryResult = (0, import_child_process2.spawnSync)("claude", cliArgs, {
|
|
882
|
+
encoding: "utf-8",
|
|
883
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
884
|
+
});
|
|
885
|
+
if (retryResult.status === 0) {
|
|
886
|
+
return { success: true, replaced: true };
|
|
887
|
+
} else {
|
|
888
|
+
return { success: false, error: retryResult.stderr || retryResult.stdout || "Failed after removing old config" };
|
|
889
|
+
}
|
|
881
890
|
}
|
|
882
891
|
return { success: false, error };
|
|
883
892
|
}
|
|
@@ -912,11 +921,11 @@ var McpHandler = class {
|
|
|
912
921
|
console.log(`[MCP] Triggering ${platform} OAuth via Claude...`);
|
|
913
922
|
const oauthProcess = (0, import_child_process2.spawnSync)("claude", [
|
|
914
923
|
"-p",
|
|
915
|
-
`Please
|
|
924
|
+
`Please authenticate with the ${platform} MCP server. If there's an authenticate tool, call it. Otherwise list what tools are available.`,
|
|
916
925
|
"--allowedTools",
|
|
917
926
|
`mcp__${serverName}__*`,
|
|
918
927
|
"--permission-mode",
|
|
919
|
-
"
|
|
928
|
+
"bypassPermissions"
|
|
920
929
|
], {
|
|
921
930
|
encoding: "utf-8",
|
|
922
931
|
stdio: "inherit",
|
package/dist/cli.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -6069,8 +6069,17 @@ function addMcpServer(options) {
|
|
|
6069
6069
|
} else {
|
|
6070
6070
|
const error = result.stderr || result.stdout || `Exit code ${result.status}`;
|
|
6071
6071
|
if (error.includes("already exists")) {
|
|
6072
|
-
console.log(`[MCP] Server ${name}
|
|
6073
|
-
|
|
6072
|
+
console.log(`[MCP] Server ${name} exists - removing old config...`);
|
|
6073
|
+
(0, import_child_process2.spawnSync)("claude", ["mcp", "remove", name], { encoding: "utf-8" });
|
|
6074
|
+
const retryResult = (0, import_child_process2.spawnSync)("claude", cliArgs, {
|
|
6075
|
+
encoding: "utf-8",
|
|
6076
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
6077
|
+
});
|
|
6078
|
+
if (retryResult.status === 0) {
|
|
6079
|
+
return { success: true, replaced: true };
|
|
6080
|
+
} else {
|
|
6081
|
+
return { success: false, error: retryResult.stderr || retryResult.stdout || "Failed after removing old config" };
|
|
6082
|
+
}
|
|
6074
6083
|
}
|
|
6075
6084
|
return { success: false, error };
|
|
6076
6085
|
}
|
|
@@ -6105,11 +6114,11 @@ var McpHandler = class {
|
|
|
6105
6114
|
console.log(`[MCP] Triggering ${platform} OAuth via Claude...`);
|
|
6106
6115
|
const oauthProcess = (0, import_child_process2.spawnSync)("claude", [
|
|
6107
6116
|
"-p",
|
|
6108
|
-
`Please
|
|
6117
|
+
`Please authenticate with the ${platform} MCP server. If there's an authenticate tool, call it. Otherwise list what tools are available.`,
|
|
6109
6118
|
"--allowedTools",
|
|
6110
6119
|
`mcp__${serverName}__*`,
|
|
6111
6120
|
"--permission-mode",
|
|
6112
|
-
"
|
|
6121
|
+
"bypassPermissions"
|
|
6113
6122
|
], {
|
|
6114
6123
|
encoding: "utf-8",
|
|
6115
6124
|
stdio: "inherit",
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
promptForApiKey,
|
|
15
15
|
runDeviceAuth,
|
|
16
16
|
saveCredentials
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KXV4I4WJ.mjs";
|
|
18
18
|
|
|
19
19
|
// node_modules/@anthropic-ai/sdk/internal/tslib.mjs
|
|
20
20
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
package/package.json
CHANGED
package/src/mcp.ts
CHANGED
|
@@ -101,7 +101,7 @@ function addMcpServer(options: {
|
|
|
101
101
|
args?: string[];
|
|
102
102
|
env?: Record<string, string>;
|
|
103
103
|
scope?: 'local' | 'user' | 'project';
|
|
104
|
-
}): { success: boolean; error?: string;
|
|
104
|
+
}): { success: boolean; error?: string; replaced?: boolean } {
|
|
105
105
|
const { name, transport, url, command, args = [], env = {}, scope = 'user' } = options;
|
|
106
106
|
|
|
107
107
|
const cliArgs = ['mcp', 'add', '-s', scope, '-t', transport];
|
|
@@ -136,10 +136,22 @@ function addMcpServer(options: {
|
|
|
136
136
|
} else {
|
|
137
137
|
const error = result.stderr || result.stdout || `Exit code ${result.status}`;
|
|
138
138
|
|
|
139
|
-
// "Already exists"
|
|
139
|
+
// "Already exists" - remove and retry to ensure fresh config
|
|
140
140
|
if (error.includes('already exists')) {
|
|
141
|
-
console.log(`[MCP] Server ${name}
|
|
142
|
-
|
|
141
|
+
console.log(`[MCP] Server ${name} exists - removing old config...`);
|
|
142
|
+
spawnSync('claude', ['mcp', 'remove', name], { encoding: 'utf-8' });
|
|
143
|
+
|
|
144
|
+
// Retry the add
|
|
145
|
+
const retryResult = spawnSync('claude', cliArgs, {
|
|
146
|
+
encoding: 'utf-8',
|
|
147
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
if (retryResult.status === 0) {
|
|
151
|
+
return { success: true, replaced: true };
|
|
152
|
+
} else {
|
|
153
|
+
return { success: false, error: retryResult.stderr || retryResult.stdout || 'Failed after removing old config' };
|
|
154
|
+
}
|
|
143
155
|
}
|
|
144
156
|
|
|
145
157
|
return { success: false, error };
|
|
@@ -186,13 +198,13 @@ export class McpHandler {
|
|
|
186
198
|
|
|
187
199
|
console.log(`[MCP] Added ${serverName} → ${oauthServer.url}`);
|
|
188
200
|
|
|
189
|
-
// Trigger OAuth by asking Claude to
|
|
201
|
+
// Trigger OAuth by asking Claude to authenticate with the MCP
|
|
190
202
|
console.log(`[MCP] Triggering ${platform} OAuth via Claude...`);
|
|
191
203
|
const oauthProcess = spawnSync('claude', [
|
|
192
204
|
'-p',
|
|
193
|
-
`Please
|
|
205
|
+
`Please authenticate with the ${platform} MCP server. If there's an authenticate tool, call it. Otherwise list what tools are available.`,
|
|
194
206
|
'--allowedTools', `mcp__${serverName}__*`,
|
|
195
|
-
'--permission-mode', '
|
|
207
|
+
'--permission-mode', 'bypassPermissions',
|
|
196
208
|
], {
|
|
197
209
|
encoding: 'utf-8',
|
|
198
210
|
stdio: 'inherit', // Show output and allow browser interaction
|