add-mcp 1.2.0 → 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 +18 -47
- package/package.json +2 -2
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
|
@@ -160,11 +160,14 @@ function transformOpenCodeConfig(_serverName, config) {
|
|
|
160
160
|
}
|
|
161
161
|
function transformCodexConfig(_serverName, config) {
|
|
162
162
|
if (config.url) {
|
|
163
|
-
|
|
163
|
+
const remoteConfig = {
|
|
164
164
|
type: config.type || "http",
|
|
165
|
-
url: config.url
|
|
166
|
-
headers: config.headers
|
|
165
|
+
url: config.url
|
|
167
166
|
};
|
|
167
|
+
if (config.headers && Object.keys(config.headers).length > 0) {
|
|
168
|
+
remoteConfig.http_headers = config.headers;
|
|
169
|
+
}
|
|
170
|
+
return remoteConfig;
|
|
168
171
|
}
|
|
169
172
|
return {
|
|
170
173
|
command: config.command,
|
|
@@ -220,7 +223,6 @@ var agents = {
|
|
|
220
223
|
configKey: "mcpServers",
|
|
221
224
|
format: "json",
|
|
222
225
|
supportedTransports: ["stdio", "http", "sse"],
|
|
223
|
-
supportsHeaders: true,
|
|
224
226
|
detectGlobalInstall: async () => {
|
|
225
227
|
return existsSync(join2(home, ".claude"));
|
|
226
228
|
}
|
|
@@ -233,8 +235,8 @@ var agents = {
|
|
|
233
235
|
// Global only - no project support
|
|
234
236
|
configKey: "mcpServers",
|
|
235
237
|
format: "json",
|
|
236
|
-
supportedTransports: ["stdio"
|
|
237
|
-
|
|
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.",
|
|
238
240
|
detectGlobalInstall: async () => {
|
|
239
241
|
return existsSync(join2(appSupport, "Claude"));
|
|
240
242
|
}
|
|
@@ -251,7 +253,6 @@ var agents = {
|
|
|
251
253
|
configKey: "mcp_servers",
|
|
252
254
|
format: "toml",
|
|
253
255
|
supportedTransports: ["stdio", "http", "sse"],
|
|
254
|
-
supportsHeaders: true,
|
|
255
256
|
detectGlobalInstall: async () => {
|
|
256
257
|
return existsSync(join2(home, ".codex"));
|
|
257
258
|
},
|
|
@@ -266,7 +267,6 @@ var agents = {
|
|
|
266
267
|
configKey: "mcpServers",
|
|
267
268
|
format: "json",
|
|
268
269
|
supportedTransports: ["stdio", "http", "sse"],
|
|
269
|
-
supportsHeaders: true,
|
|
270
270
|
detectGlobalInstall: async () => {
|
|
271
271
|
return existsSync(join2(home, ".cursor"));
|
|
272
272
|
},
|
|
@@ -281,7 +281,6 @@ var agents = {
|
|
|
281
281
|
configKey: "mcpServers",
|
|
282
282
|
format: "json",
|
|
283
283
|
supportedTransports: ["stdio", "http", "sse"],
|
|
284
|
-
supportsHeaders: true,
|
|
285
284
|
detectGlobalInstall: async () => {
|
|
286
285
|
return existsSync(join2(home, ".gemini"));
|
|
287
286
|
}
|
|
@@ -295,7 +294,6 @@ var agents = {
|
|
|
295
294
|
configKey: "extensions",
|
|
296
295
|
format: "yaml",
|
|
297
296
|
supportedTransports: ["stdio", "http", "sse"],
|
|
298
|
-
supportsHeaders: true,
|
|
299
297
|
detectGlobalInstall: async () => {
|
|
300
298
|
return existsSync(gooseConfigPath);
|
|
301
299
|
},
|
|
@@ -311,7 +309,6 @@ var agents = {
|
|
|
311
309
|
localConfigKey: "servers",
|
|
312
310
|
format: "json",
|
|
313
311
|
supportedTransports: ["stdio", "http", "sse"],
|
|
314
|
-
supportsHeaders: true,
|
|
315
312
|
detectGlobalInstall: async () => {
|
|
316
313
|
return existsSync(dirname2(copilotConfigPath));
|
|
317
314
|
},
|
|
@@ -326,7 +323,6 @@ var agents = {
|
|
|
326
323
|
configKey: "mcp",
|
|
327
324
|
format: "json",
|
|
328
325
|
supportedTransports: ["stdio", "http", "sse"],
|
|
329
|
-
supportsHeaders: true,
|
|
330
326
|
detectGlobalInstall: async () => {
|
|
331
327
|
return existsSync(join2(home, ".config", "opencode"));
|
|
332
328
|
},
|
|
@@ -341,7 +337,6 @@ var agents = {
|
|
|
341
337
|
configKey: "servers",
|
|
342
338
|
format: "json",
|
|
343
339
|
supportedTransports: ["stdio", "http", "sse"],
|
|
344
|
-
supportsHeaders: true,
|
|
345
340
|
detectGlobalInstall: async () => {
|
|
346
341
|
return existsSync(vscodePath);
|
|
347
342
|
}
|
|
@@ -355,7 +350,6 @@ var agents = {
|
|
|
355
350
|
configKey: "context_servers",
|
|
356
351
|
format: "json",
|
|
357
352
|
supportedTransports: ["stdio", "http", "sse"],
|
|
358
|
-
supportsHeaders: true,
|
|
359
353
|
detectGlobalInstall: async () => {
|
|
360
354
|
const configDir = process.platform === "darwin" || process.platform === "win32" ? join2(appSupport, "Zed") : join2(appSupport, "zed");
|
|
361
355
|
return existsSync(configDir);
|
|
@@ -940,13 +934,13 @@ function installServer(serverName, serverConfig, agentTypes, options = {}) {
|
|
|
940
934
|
// package.json
|
|
941
935
|
var package_default = {
|
|
942
936
|
name: "add-mcp",
|
|
943
|
-
version: "1.2.
|
|
937
|
+
version: "1.2.2",
|
|
944
938
|
description: "Add MCP servers to your favorite coding agents with a single command.",
|
|
945
939
|
author: "Andre Landgraf <andre@neon.tech>",
|
|
946
940
|
license: "Apache-2.0",
|
|
947
941
|
type: "module",
|
|
948
942
|
bin: {
|
|
949
|
-
"add-mcp": "
|
|
943
|
+
"add-mcp": "dist/index.js"
|
|
950
944
|
},
|
|
951
945
|
files: [
|
|
952
946
|
"dist",
|
|
@@ -1089,10 +1083,7 @@ program.name("add-mcp").description(
|
|
|
1089
1083
|
"HTTP header for remote servers (repeatable, 'Key: Value')",
|
|
1090
1084
|
collect,
|
|
1091
1085
|
[]
|
|
1092
|
-
).option("-y, --yes", "Skip confirmation prompts").option("--all", "Install to all agents").option(
|
|
1093
|
-
"--gitignore",
|
|
1094
|
-
"Add generated project config files to .gitignore"
|
|
1095
|
-
).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) => {
|
|
1096
1087
|
await main(target, options);
|
|
1097
1088
|
});
|
|
1098
1089
|
program.command("list-agents").description("List all supported coding agents").action(() => {
|
|
@@ -1333,10 +1324,14 @@ async function main(target, options) {
|
|
|
1333
1324
|
);
|
|
1334
1325
|
if (unsupportedAgents.length > 0) {
|
|
1335
1326
|
const unsupportedNames = unsupportedAgents.map((a) => agents[a].displayName).join(", ");
|
|
1327
|
+
const hints = unsupportedAgents.map((a) => agents[a].unsupportedTransportMessage).filter(Boolean);
|
|
1336
1328
|
if (options.all) {
|
|
1337
1329
|
p2.log.warn(
|
|
1338
1330
|
`Skipping agents that don't support ${requiredTransport} transport: ${unsupportedNames}`
|
|
1339
1331
|
);
|
|
1332
|
+
for (const hint of hints) {
|
|
1333
|
+
p2.log.info(hint);
|
|
1334
|
+
}
|
|
1340
1335
|
targetAgents = targetAgents.filter(
|
|
1341
1336
|
(a) => isTransportSupported(a, requiredTransport)
|
|
1342
1337
|
);
|
|
@@ -1348,34 +1343,10 @@ async function main(target, options) {
|
|
|
1348
1343
|
p2.log.error(
|
|
1349
1344
|
`The following agents don't support ${requiredTransport} transport: ${unsupportedNames}`
|
|
1350
1345
|
);
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
}
|
|
1354
|
-
const hasHeadersForRemote = isRemote && hasHeaderValues;
|
|
1355
|
-
if (hasHeadersForRemote) {
|
|
1356
|
-
const unsupportedHeaderAgents = targetAgents.filter(
|
|
1357
|
-
(a) => !agents[a].supportsHeaders
|
|
1358
|
-
);
|
|
1359
|
-
if (unsupportedHeaderAgents.length > 0) {
|
|
1360
|
-
const unsupportedNames = unsupportedHeaderAgents.map((a) => agents[a].displayName).join(", ");
|
|
1361
|
-
const hasExplicitAgentSelection = hasExplicitAgentFlags || selectedViaPrompt;
|
|
1362
|
-
if (hasExplicitAgentSelection) {
|
|
1363
|
-
p2.log.error(
|
|
1364
|
-
`The following agents don't support HTTP headers: ${unsupportedNames}`
|
|
1365
|
-
);
|
|
1366
|
-
process.exit(1);
|
|
1367
|
-
}
|
|
1368
|
-
const supportedAgents = targetAgents.filter(
|
|
1369
|
-
(a) => agents[a].supportsHeaders
|
|
1370
|
-
);
|
|
1371
|
-
if (supportedAgents.length === 0) {
|
|
1372
|
-
p2.log.error("No selected agents support HTTP headers");
|
|
1373
|
-
process.exit(1);
|
|
1346
|
+
for (const hint of hints) {
|
|
1347
|
+
p2.log.info(hint);
|
|
1374
1348
|
}
|
|
1375
|
-
|
|
1376
|
-
`Skipping agents that don't support HTTP headers: ${unsupportedNames}`
|
|
1377
|
-
);
|
|
1378
|
-
targetAgents = supportedAgents;
|
|
1349
|
+
process.exit(1);
|
|
1379
1350
|
}
|
|
1380
1351
|
}
|
|
1381
1352
|
const hasSmartRouting = agentRouting.size > 0;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "add-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Add MCP servers to your favorite coding agents with a single command.",
|
|
5
5
|
"author": "Andre Landgraf <andre@neon.tech>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"bin": {
|
|
9
|
-
"add-mcp": "
|
|
9
|
+
"add-mcp": "dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|