add-mcp 1.2.1 → 1.3.0

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.
Files changed (3) hide show
  1. package/README.md +21 -22
  2. package/dist/index.js +77 -44
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Add MCP servers to your favorite coding agents with a single command.
4
4
 
5
- Supports **Claude Code**, **Codex**, **Cursor**, **OpenCode**, **VSCode** and [5 more](#supported-agents).
5
+ Supports **Claude Code**, **Codex**, **Cursor**, **OpenCode**, **VSCode** and [7 more](#supported-agents).
6
6
 
7
7
  ## Install an MCP Server
8
8
 
@@ -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
- - All agents use global config
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,29 +130,28 @@ 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
- If you explicitly select agents that don't support headers, the install will error. Auto-detected installs skip unsupported agents with a warning.
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
 
140
137
  MCP servers can be installed to any of these agents:
141
138
 
142
- | Agent | `--agent` | Project Path | Global Path |
143
- | ------------------ | -------------------- | ----------------------- | ----------------------------------------------------------------- |
144
- | Claude Code | `claude-code` | `.mcp.json` | `~/.claude.json` |
145
- | Claude Desktop | `claude-desktop` | - | `~/Library/Application Support/Claude/claude_desktop_config.json` |
146
- | Codex | `codex` | `.codex/config.toml` | `~/.codex/config.toml` |
147
- | Cursor | `cursor` | `.cursor/mcp.json` | `~/.cursor/mcp.json` |
148
- | Gemini CLI | `gemini-cli` | `.gemini/settings.json` | `~/.gemini/settings.json` |
149
- | Goose | `goose` | `.goose/config.yaml` | `~/.config/goose/config.yaml` |
150
- | GitHub Copilot CLI | `github-copilot-cli` | `.vscode/mcp.json` | `~/.copilot/mcp-config.json` |
151
- | OpenCode | `opencode` | `opencode.json` | `~/.config/opencode/opencode.json` |
152
- | VS Code | `vscode` | `.vscode/mcp.json` | `~/Library/Application Support/Code/User/mcp.json` |
153
- | Zed | `zed` | `.zed/settings.json` | `~/Library/Application Support/Zed/settings.json` |
154
-
155
- **Aliases:** `gemini` `gemini-cli`, `github-copilot` `vscode`
139
+ | Agent | `--agent` | Project Path | Global Path |
140
+ | ---------------------- | -------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------- |
141
+ | Cline VSCode Extension | `cline` | - | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
142
+ | Cline CLI | `cline-cli` | - | `~/.cline/data/settings/cline_mcp_settings.json` |
143
+ | Claude Code | `claude-code` | `.mcp.json` | `~/.claude.json` |
144
+ | Claude Desktop | `claude-desktop` | - | `~/Library/Application Support/Claude/claude_desktop_config.json` |
145
+ | Codex | `codex` | `.codex/config.toml` | `~/.codex/config.toml` |
146
+ | Cursor | `cursor` | `.cursor/mcp.json` | `~/.cursor/mcp.json` |
147
+ | Gemini CLI | `gemini-cli` | `.gemini/settings.json` | `~/.gemini/settings.json` |
148
+ | Goose | `goose` | `.goose/config.yaml` | `~/.config/goose/config.yaml` |
149
+ | GitHub Copilot CLI | `github-copilot-cli` | `.vscode/mcp.json` | `~/.copilot/mcp-config.json` |
150
+ | OpenCode | `opencode` | `opencode.json` | `~/.config/opencode/opencode.json` |
151
+ | VS Code | `vscode` | `.vscode/mcp.json` | `~/Library/Application Support/Code/User/mcp.json` |
152
+ | Zed | `zed` | `.zed/settings.json` | `~/Library/Application Support/Zed/settings.json` |
153
+
154
+ **Aliases:** `cline-vscode` → `cline`, `gemini` → `gemini-cli`, `github-copilot` → `vscode`
156
155
 
157
156
  The CLI uses smart detection to find agents in your project directory and globally installed agents. See [Smart Detection](#smart-detection) for details.
158
157
 
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import { homedir as homedir3 } from "os";
8
8
 
9
9
  // src/types.ts
10
10
  var agentAliases = {
11
+ "cline-vscode": "cline",
11
12
  gemini: "gemini-cli",
12
13
  "github-copilot": "vscode"
13
14
  };
@@ -98,6 +99,19 @@ function getPlatformPaths() {
98
99
  }
99
100
  }
100
101
  var { appSupport, vscodePath, gooseConfigPath } = getPlatformPaths();
102
+ var clineCliConfigPath = join2(
103
+ process.env.CLINE_DIR || join2(home, ".cline"),
104
+ "data",
105
+ "settings",
106
+ "cline_mcp_settings.json"
107
+ );
108
+ var clineExtensionConfigPath = join2(
109
+ vscodePath,
110
+ "globalStorage",
111
+ "saoudrizwan.claude-dev",
112
+ "settings",
113
+ "cline_mcp_settings.json"
114
+ );
101
115
  var copilotConfigPath = join2(
102
116
  process.env.XDG_CONFIG_HOME || join2(home, ".copilot"),
103
117
  "mcp-config.json"
@@ -187,6 +201,28 @@ function transformCursorConfig(_serverName, config) {
187
201
  }
188
202
  return config;
189
203
  }
204
+ function transformClineConfig(_serverName, config) {
205
+ if (config.url) {
206
+ const remoteConfig = {
207
+ url: config.url,
208
+ type: config.type === "sse" ? "sse" : "streamableHttp",
209
+ disabled: false
210
+ };
211
+ if (config.headers && Object.keys(config.headers).length > 0) {
212
+ remoteConfig.headers = config.headers;
213
+ }
214
+ return remoteConfig;
215
+ }
216
+ const localConfig = {
217
+ command: config.command,
218
+ args: config.args || [],
219
+ disabled: false
220
+ };
221
+ if (config.env && Object.keys(config.env).length > 0) {
222
+ localConfig.env = config.env;
223
+ }
224
+ return localConfig;
225
+ }
190
226
  function transformGitHubCopilotCliConfig(_serverName, config, context) {
191
227
  if (context?.local) {
192
228
  return config;
@@ -214,6 +250,34 @@ function transformGitHubCopilotCliConfig(_serverName, config, context) {
214
250
  return localConfig;
215
251
  }
216
252
  var agents = {
253
+ cline: {
254
+ name: "cline",
255
+ displayName: "Cline VSCode Extension",
256
+ configPath: clineExtensionConfigPath,
257
+ projectDetectPaths: [],
258
+ // Global only - no project support
259
+ configKey: "mcpServers",
260
+ format: "json",
261
+ supportedTransports: ["stdio", "http", "sse"],
262
+ detectGlobalInstall: async () => {
263
+ return existsSync(dirname2(clineExtensionConfigPath));
264
+ },
265
+ transformConfig: transformClineConfig
266
+ },
267
+ "cline-cli": {
268
+ name: "cline-cli",
269
+ displayName: "Cline CLI",
270
+ configPath: clineCliConfigPath,
271
+ projectDetectPaths: [],
272
+ // Global only - no project support
273
+ configKey: "mcpServers",
274
+ format: "json",
275
+ supportedTransports: ["stdio", "http", "sse"],
276
+ detectGlobalInstall: async () => {
277
+ return existsSync(dirname2(clineCliConfigPath));
278
+ },
279
+ transformConfig: transformClineConfig
280
+ },
217
281
  "claude-code": {
218
282
  name: "claude-code",
219
283
  displayName: "Claude Code",
@@ -223,7 +287,6 @@ var agents = {
223
287
  configKey: "mcpServers",
224
288
  format: "json",
225
289
  supportedTransports: ["stdio", "http", "sse"],
226
- supportsHeaders: true,
227
290
  detectGlobalInstall: async () => {
228
291
  return existsSync(join2(home, ".claude"));
229
292
  }
@@ -236,8 +299,8 @@ var agents = {
236
299
  // Global only - no project support
237
300
  configKey: "mcpServers",
238
301
  format: "json",
239
- supportedTransports: ["stdio", "http", "sse"],
240
- supportsHeaders: true,
302
+ supportedTransports: ["stdio"],
303
+ unsupportedTransportMessage: "Claude Desktop only supports local (stdio) servers via its config file. Add remote servers through Settings \u2192 Connectors in the app instead.",
241
304
  detectGlobalInstall: async () => {
242
305
  return existsSync(join2(appSupport, "Claude"));
243
306
  }
@@ -254,7 +317,6 @@ var agents = {
254
317
  configKey: "mcp_servers",
255
318
  format: "toml",
256
319
  supportedTransports: ["stdio", "http", "sse"],
257
- supportsHeaders: true,
258
320
  detectGlobalInstall: async () => {
259
321
  return existsSync(join2(home, ".codex"));
260
322
  },
@@ -269,7 +331,6 @@ var agents = {
269
331
  configKey: "mcpServers",
270
332
  format: "json",
271
333
  supportedTransports: ["stdio", "http", "sse"],
272
- supportsHeaders: true,
273
334
  detectGlobalInstall: async () => {
274
335
  return existsSync(join2(home, ".cursor"));
275
336
  },
@@ -284,7 +345,6 @@ var agents = {
284
345
  configKey: "mcpServers",
285
346
  format: "json",
286
347
  supportedTransports: ["stdio", "http", "sse"],
287
- supportsHeaders: true,
288
348
  detectGlobalInstall: async () => {
289
349
  return existsSync(join2(home, ".gemini"));
290
350
  }
@@ -298,7 +358,6 @@ var agents = {
298
358
  configKey: "extensions",
299
359
  format: "yaml",
300
360
  supportedTransports: ["stdio", "http", "sse"],
301
- supportsHeaders: true,
302
361
  detectGlobalInstall: async () => {
303
362
  return existsSync(gooseConfigPath);
304
363
  },
@@ -314,7 +373,6 @@ var agents = {
314
373
  localConfigKey: "servers",
315
374
  format: "json",
316
375
  supportedTransports: ["stdio", "http", "sse"],
317
- supportsHeaders: true,
318
376
  detectGlobalInstall: async () => {
319
377
  return existsSync(dirname2(copilotConfigPath));
320
378
  },
@@ -329,7 +387,6 @@ var agents = {
329
387
  configKey: "mcp",
330
388
  format: "json",
331
389
  supportedTransports: ["stdio", "http", "sse"],
332
- supportsHeaders: true,
333
390
  detectGlobalInstall: async () => {
334
391
  return existsSync(join2(home, ".config", "opencode"));
335
392
  },
@@ -344,7 +401,6 @@ var agents = {
344
401
  configKey: "servers",
345
402
  format: "json",
346
403
  supportedTransports: ["stdio", "http", "sse"],
347
- supportsHeaders: true,
348
404
  detectGlobalInstall: async () => {
349
405
  return existsSync(vscodePath);
350
406
  }
@@ -358,7 +414,6 @@ var agents = {
358
414
  configKey: "context_servers",
359
415
  format: "json",
360
416
  supportedTransports: ["stdio", "http", "sse"],
361
- supportsHeaders: true,
362
417
  detectGlobalInstall: async () => {
363
418
  const configDir = process.platform === "darwin" || process.platform === "win32" ? join2(appSupport, "Zed") : join2(appSupport, "zed");
364
419
  return existsSync(configDir);
@@ -943,7 +998,7 @@ function installServer(serverName, serverConfig, agentTypes, options = {}) {
943
998
  // package.json
944
999
  var package_default = {
945
1000
  name: "add-mcp",
946
- version: "1.2.1",
1001
+ version: "1.3.0",
947
1002
  description: "Add MCP servers to your favorite coding agents with a single command.",
948
1003
  author: "Andre Landgraf <andre@neon.tech>",
949
1004
  license: "Apache-2.0",
@@ -970,6 +1025,7 @@ var package_default = {
970
1025
  "mcp",
971
1026
  "model-context-protocol",
972
1027
  "ai-agents",
1028
+ "cline",
973
1029
  "claude-code",
974
1030
  "claude-desktop",
975
1031
  "codex",
@@ -1077,7 +1133,7 @@ function parseHeaders(values) {
1077
1133
  return { headers, invalid };
1078
1134
  }
1079
1135
  program.name("add-mcp").description(
1080
- "Install MCP servers onto coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex)"
1136
+ "Install MCP servers for coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex, and more \u2014 run list-agents for the full list)"
1081
1137
  ).version(version).argument("[target]", "MCP server URL (remote) or package name (local stdio)").option(
1082
1138
  "-g, --global",
1083
1139
  "Install globally (user-level) instead of project-level"
@@ -1092,10 +1148,7 @@ program.name("add-mcp").description(
1092
1148
  "HTTP header for remote servers (repeatable, 'Key: Value')",
1093
1149
  collect,
1094
1150
  []
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) => {
1151
+ ).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
1152
  await main(target, options);
1100
1153
  });
1101
1154
  program.command("list-agents").description("List all supported coding agents").action(() => {
@@ -1336,10 +1389,14 @@ async function main(target, options) {
1336
1389
  );
1337
1390
  if (unsupportedAgents.length > 0) {
1338
1391
  const unsupportedNames = unsupportedAgents.map((a) => agents[a].displayName).join(", ");
1392
+ const hints = unsupportedAgents.map((a) => agents[a].unsupportedTransportMessage).filter(Boolean);
1339
1393
  if (options.all) {
1340
1394
  p2.log.warn(
1341
1395
  `Skipping agents that don't support ${requiredTransport} transport: ${unsupportedNames}`
1342
1396
  );
1397
+ for (const hint of hints) {
1398
+ p2.log.info(hint);
1399
+ }
1343
1400
  targetAgents = targetAgents.filter(
1344
1401
  (a) => isTransportSupported(a, requiredTransport)
1345
1402
  );
@@ -1351,34 +1408,10 @@ async function main(target, options) {
1351
1408
  p2.log.error(
1352
1409
  `The following agents don't support ${requiredTransport} transport: ${unsupportedNames}`
1353
1410
  );
1354
- process.exit(1);
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);
1411
+ for (const hint of hints) {
1412
+ p2.log.info(hint);
1370
1413
  }
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);
1377
- }
1378
- p2.log.warn(
1379
- `Skipping agents that don't support HTTP headers: ${unsupportedNames}`
1380
- );
1381
- targetAgents = supportedAgents;
1414
+ process.exit(1);
1382
1415
  }
1383
1416
  }
1384
1417
  const hasSmartRouting = agentRouting.size > 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-mcp",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
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",
@@ -27,6 +27,7 @@
27
27
  "mcp",
28
28
  "model-context-protocol",
29
29
  "ai-agents",
30
+ "cline",
30
31
  "claude-code",
31
32
  "claude-desktop",
32
33
  "codex",