add-mcp 1.2.1 → 1.2.2
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 +4 -7
- package/dist/index.js +11 -43
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ npx add-mcp https://mcp.example.com/mcp -a cursor -y --gitignore
|
|
|
71
71
|
| `-n, --name <name>` | Server name (auto-inferred if not provided) |
|
|
72
72
|
| `-y, --yes` | Skip all confirmation prompts |
|
|
73
73
|
| `--all` | Install to all agents |
|
|
74
|
-
| `--gitignore` | Add generated config files to `.gitignore`
|
|
74
|
+
| `--gitignore` | Add generated config files to `.gitignore` |
|
|
75
75
|
|
|
76
76
|
### Additional Commands
|
|
77
77
|
|
|
@@ -102,12 +102,12 @@ The CLI automatically detects agents based on your environment:
|
|
|
102
102
|
- Detects project-level config files (`.cursor/`, `.vscode/`, `.mcp.json`, etc.)
|
|
103
103
|
- Selects detected agents (have project config in the current directory) by default
|
|
104
104
|
- Shows detected agents plus all other supported agents for selection
|
|
105
|
-
- Installs to project-level config files
|
|
106
105
|
|
|
107
106
|
**With `-g` (global mode):**
|
|
108
107
|
|
|
109
108
|
- Detects all globally-installed agents (including Claude Desktop, Codex, Zed)
|
|
110
|
-
-
|
|
109
|
+
- Selects detected agents by default
|
|
110
|
+
- Shows detected agents plus all other supported agents for selection
|
|
111
111
|
|
|
112
112
|
**No agents detected:**
|
|
113
113
|
|
|
@@ -130,10 +130,7 @@ Note that some agents like Cursor and opencode do not require the `type` informa
|
|
|
130
130
|
## HTTP Headers
|
|
131
131
|
|
|
132
132
|
Use `--header` to pass custom headers for remote servers. The flag can be repeated.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Agents that support headers: Claude Code, Claude Desktop, Codex, Cursor, Gemini CLI, OpenCode, VS Code, Zed.
|
|
136
|
-
Agents that do not support headers: Goose.
|
|
133
|
+
Header support is available for remote installs across all supported agents.
|
|
137
134
|
|
|
138
135
|
## Supported Agents
|
|
139
136
|
|
package/dist/index.js
CHANGED
|
@@ -223,7 +223,6 @@ var agents = {
|
|
|
223
223
|
configKey: "mcpServers",
|
|
224
224
|
format: "json",
|
|
225
225
|
supportedTransports: ["stdio", "http", "sse"],
|
|
226
|
-
supportsHeaders: true,
|
|
227
226
|
detectGlobalInstall: async () => {
|
|
228
227
|
return existsSync(join2(home, ".claude"));
|
|
229
228
|
}
|
|
@@ -236,8 +235,8 @@ var agents = {
|
|
|
236
235
|
// Global only - no project support
|
|
237
236
|
configKey: "mcpServers",
|
|
238
237
|
format: "json",
|
|
239
|
-
supportedTransports: ["stdio"
|
|
240
|
-
|
|
238
|
+
supportedTransports: ["stdio"],
|
|
239
|
+
unsupportedTransportMessage: "Claude Desktop only supports local (stdio) servers via its config file. Add remote servers through Settings \u2192 Connectors in the app instead.",
|
|
241
240
|
detectGlobalInstall: async () => {
|
|
242
241
|
return existsSync(join2(appSupport, "Claude"));
|
|
243
242
|
}
|
|
@@ -254,7 +253,6 @@ var agents = {
|
|
|
254
253
|
configKey: "mcp_servers",
|
|
255
254
|
format: "toml",
|
|
256
255
|
supportedTransports: ["stdio", "http", "sse"],
|
|
257
|
-
supportsHeaders: true,
|
|
258
256
|
detectGlobalInstall: async () => {
|
|
259
257
|
return existsSync(join2(home, ".codex"));
|
|
260
258
|
},
|
|
@@ -269,7 +267,6 @@ var agents = {
|
|
|
269
267
|
configKey: "mcpServers",
|
|
270
268
|
format: "json",
|
|
271
269
|
supportedTransports: ["stdio", "http", "sse"],
|
|
272
|
-
supportsHeaders: true,
|
|
273
270
|
detectGlobalInstall: async () => {
|
|
274
271
|
return existsSync(join2(home, ".cursor"));
|
|
275
272
|
},
|
|
@@ -284,7 +281,6 @@ var agents = {
|
|
|
284
281
|
configKey: "mcpServers",
|
|
285
282
|
format: "json",
|
|
286
283
|
supportedTransports: ["stdio", "http", "sse"],
|
|
287
|
-
supportsHeaders: true,
|
|
288
284
|
detectGlobalInstall: async () => {
|
|
289
285
|
return existsSync(join2(home, ".gemini"));
|
|
290
286
|
}
|
|
@@ -298,7 +294,6 @@ var agents = {
|
|
|
298
294
|
configKey: "extensions",
|
|
299
295
|
format: "yaml",
|
|
300
296
|
supportedTransports: ["stdio", "http", "sse"],
|
|
301
|
-
supportsHeaders: true,
|
|
302
297
|
detectGlobalInstall: async () => {
|
|
303
298
|
return existsSync(gooseConfigPath);
|
|
304
299
|
},
|
|
@@ -314,7 +309,6 @@ var agents = {
|
|
|
314
309
|
localConfigKey: "servers",
|
|
315
310
|
format: "json",
|
|
316
311
|
supportedTransports: ["stdio", "http", "sse"],
|
|
317
|
-
supportsHeaders: true,
|
|
318
312
|
detectGlobalInstall: async () => {
|
|
319
313
|
return existsSync(dirname2(copilotConfigPath));
|
|
320
314
|
},
|
|
@@ -329,7 +323,6 @@ var agents = {
|
|
|
329
323
|
configKey: "mcp",
|
|
330
324
|
format: "json",
|
|
331
325
|
supportedTransports: ["stdio", "http", "sse"],
|
|
332
|
-
supportsHeaders: true,
|
|
333
326
|
detectGlobalInstall: async () => {
|
|
334
327
|
return existsSync(join2(home, ".config", "opencode"));
|
|
335
328
|
},
|
|
@@ -344,7 +337,6 @@ var agents = {
|
|
|
344
337
|
configKey: "servers",
|
|
345
338
|
format: "json",
|
|
346
339
|
supportedTransports: ["stdio", "http", "sse"],
|
|
347
|
-
supportsHeaders: true,
|
|
348
340
|
detectGlobalInstall: async () => {
|
|
349
341
|
return existsSync(vscodePath);
|
|
350
342
|
}
|
|
@@ -358,7 +350,6 @@ var agents = {
|
|
|
358
350
|
configKey: "context_servers",
|
|
359
351
|
format: "json",
|
|
360
352
|
supportedTransports: ["stdio", "http", "sse"],
|
|
361
|
-
supportsHeaders: true,
|
|
362
353
|
detectGlobalInstall: async () => {
|
|
363
354
|
const configDir = process.platform === "darwin" || process.platform === "win32" ? join2(appSupport, "Zed") : join2(appSupport, "zed");
|
|
364
355
|
return existsSync(configDir);
|
|
@@ -943,7 +934,7 @@ function installServer(serverName, serverConfig, agentTypes, options = {}) {
|
|
|
943
934
|
// package.json
|
|
944
935
|
var package_default = {
|
|
945
936
|
name: "add-mcp",
|
|
946
|
-
version: "1.2.
|
|
937
|
+
version: "1.2.2",
|
|
947
938
|
description: "Add MCP servers to your favorite coding agents with a single command.",
|
|
948
939
|
author: "Andre Landgraf <andre@neon.tech>",
|
|
949
940
|
license: "Apache-2.0",
|
|
@@ -1092,10 +1083,7 @@ program.name("add-mcp").description(
|
|
|
1092
1083
|
"HTTP header for remote servers (repeatable, 'Key: Value')",
|
|
1093
1084
|
collect,
|
|
1094
1085
|
[]
|
|
1095
|
-
).option("-y, --yes", "Skip confirmation prompts").option("--all", "Install to all agents").option(
|
|
1096
|
-
"--gitignore",
|
|
1097
|
-
"Add generated project config files to .gitignore"
|
|
1098
|
-
).action(async (target, options) => {
|
|
1086
|
+
).option("-y, --yes", "Skip confirmation prompts").option("--all", "Install to all agents").option("--gitignore", "Add generated project config files to .gitignore").action(async (target, options) => {
|
|
1099
1087
|
await main(target, options);
|
|
1100
1088
|
});
|
|
1101
1089
|
program.command("list-agents").description("List all supported coding agents").action(() => {
|
|
@@ -1336,10 +1324,14 @@ async function main(target, options) {
|
|
|
1336
1324
|
);
|
|
1337
1325
|
if (unsupportedAgents.length > 0) {
|
|
1338
1326
|
const unsupportedNames = unsupportedAgents.map((a) => agents[a].displayName).join(", ");
|
|
1327
|
+
const hints = unsupportedAgents.map((a) => agents[a].unsupportedTransportMessage).filter(Boolean);
|
|
1339
1328
|
if (options.all) {
|
|
1340
1329
|
p2.log.warn(
|
|
1341
1330
|
`Skipping agents that don't support ${requiredTransport} transport: ${unsupportedNames}`
|
|
1342
1331
|
);
|
|
1332
|
+
for (const hint of hints) {
|
|
1333
|
+
p2.log.info(hint);
|
|
1334
|
+
}
|
|
1343
1335
|
targetAgents = targetAgents.filter(
|
|
1344
1336
|
(a) => isTransportSupported(a, requiredTransport)
|
|
1345
1337
|
);
|
|
@@ -1351,34 +1343,10 @@ async function main(target, options) {
|
|
|
1351
1343
|
p2.log.error(
|
|
1352
1344
|
`The following agents don't support ${requiredTransport} transport: ${unsupportedNames}`
|
|
1353
1345
|
);
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
}
|
|
1357
|
-
const hasHeadersForRemote = isRemote && hasHeaderValues;
|
|
1358
|
-
if (hasHeadersForRemote) {
|
|
1359
|
-
const unsupportedHeaderAgents = targetAgents.filter(
|
|
1360
|
-
(a) => !agents[a].supportsHeaders
|
|
1361
|
-
);
|
|
1362
|
-
if (unsupportedHeaderAgents.length > 0) {
|
|
1363
|
-
const unsupportedNames = unsupportedHeaderAgents.map((a) => agents[a].displayName).join(", ");
|
|
1364
|
-
const hasExplicitAgentSelection = hasExplicitAgentFlags || selectedViaPrompt;
|
|
1365
|
-
if (hasExplicitAgentSelection) {
|
|
1366
|
-
p2.log.error(
|
|
1367
|
-
`The following agents don't support HTTP headers: ${unsupportedNames}`
|
|
1368
|
-
);
|
|
1369
|
-
process.exit(1);
|
|
1370
|
-
}
|
|
1371
|
-
const supportedAgents = targetAgents.filter(
|
|
1372
|
-
(a) => agents[a].supportsHeaders
|
|
1373
|
-
);
|
|
1374
|
-
if (supportedAgents.length === 0) {
|
|
1375
|
-
p2.log.error("No selected agents support HTTP headers");
|
|
1376
|
-
process.exit(1);
|
|
1346
|
+
for (const hint of hints) {
|
|
1347
|
+
p2.log.info(hint);
|
|
1377
1348
|
}
|
|
1378
|
-
|
|
1379
|
-
`Skipping agents that don't support HTTP headers: ${unsupportedNames}`
|
|
1380
|
-
);
|
|
1381
|
-
targetAgents = supportedAgents;
|
|
1349
|
+
process.exit(1);
|
|
1382
1350
|
}
|
|
1383
1351
|
}
|
|
1384
1352
|
const hasSmartRouting = agentRouting.size > 0;
|