add-mcp 1.2.2 → 1.4.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 +18 -15
  2. package/dist/index.js +102 -4
  3. package/package.json +3 -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 [8 more](#supported-agents).
6
6
 
7
7
  ## Install an MCP Server
8
8
 
@@ -136,20 +136,23 @@ Header support is available for remote installs across all supported agents.
136
136
 
137
137
  MCP servers can be installed to any of these agents:
138
138
 
139
- | Agent | `--agent` | Project Path | Global Path |
140
- | ------------------ | -------------------- | ----------------------- | ----------------------------------------------------------------- |
141
- | Claude Code | `claude-code` | `.mcp.json` | `~/.claude.json` |
142
- | Claude Desktop | `claude-desktop` | - | `~/Library/Application Support/Claude/claude_desktop_config.json` |
143
- | Codex | `codex` | `.codex/config.toml` | `~/.codex/config.toml` |
144
- | Cursor | `cursor` | `.cursor/mcp.json` | `~/.cursor/mcp.json` |
145
- | Gemini CLI | `gemini-cli` | `.gemini/settings.json` | `~/.gemini/settings.json` |
146
- | Goose | `goose` | `.goose/config.yaml` | `~/.config/goose/config.yaml` |
147
- | GitHub Copilot CLI | `github-copilot-cli` | `.vscode/mcp.json` | `~/.copilot/mcp-config.json` |
148
- | OpenCode | `opencode` | `opencode.json` | `~/.config/opencode/opencode.json` |
149
- | VS Code | `vscode` | `.vscode/mcp.json` | `~/Library/Application Support/Code/User/mcp.json` |
150
- | Zed | `zed` | `.zed/settings.json` | `~/Library/Application Support/Zed/settings.json` |
151
-
152
- **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
+ | MCPorter | `mcporter` | `config/mcporter.json` | `~/.mcporter/mcporter.json` (or existing `~/.mcporter/mcporter.jsonc`) |
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:** `cline-vscode` → `cline`, `gemini` → `gemini-cli`, `github-copilot` → `vscode`
153
156
 
154
157
  The CLI uses smart detection to find agents in your project directory and globally installed agents. See [Smart Detection](#smart-detection) for details.
155
158
 
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;
@@ -213,7 +249,49 @@ function transformGitHubCopilotCliConfig(_serverName, config, context) {
213
249
  }
214
250
  return localConfig;
215
251
  }
252
+ function resolveMcporterConfigPath(agent, options) {
253
+ if (options.local && agent.localConfigPath) {
254
+ return join2(options.cwd, agent.localConfigPath);
255
+ }
256
+ const globalJsonPath = agent.configPath;
257
+ const globalJsoncPath = join2(dirname2(globalJsonPath), "mcporter.jsonc");
258
+ if (existsSync(globalJsonPath)) {
259
+ return globalJsonPath;
260
+ }
261
+ if (existsSync(globalJsoncPath)) {
262
+ return globalJsoncPath;
263
+ }
264
+ return globalJsonPath;
265
+ }
216
266
  var agents = {
267
+ cline: {
268
+ name: "cline",
269
+ displayName: "Cline VSCode Extension",
270
+ configPath: clineExtensionConfigPath,
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(clineExtensionConfigPath));
278
+ },
279
+ transformConfig: transformClineConfig
280
+ },
281
+ "cline-cli": {
282
+ name: "cline-cli",
283
+ displayName: "Cline CLI",
284
+ configPath: clineCliConfigPath,
285
+ projectDetectPaths: [],
286
+ // Global only - no project support
287
+ configKey: "mcpServers",
288
+ format: "json",
289
+ supportedTransports: ["stdio", "http", "sse"],
290
+ detectGlobalInstall: async () => {
291
+ return existsSync(dirname2(clineCliConfigPath));
292
+ },
293
+ transformConfig: transformClineConfig
294
+ },
217
295
  "claude-code": {
218
296
  name: "claude-code",
219
297
  displayName: "Claude Code",
@@ -314,6 +392,20 @@ var agents = {
314
392
  },
315
393
  transformConfig: transformGitHubCopilotCliConfig
316
394
  },
395
+ mcporter: {
396
+ name: "mcporter",
397
+ displayName: "MCPorter",
398
+ configPath: join2(home, ".mcporter", "mcporter.json"),
399
+ localConfigPath: "config/mcporter.json",
400
+ projectDetectPaths: ["config/mcporter.json"],
401
+ configKey: "mcpServers",
402
+ format: "json",
403
+ supportedTransports: ["stdio", "http", "sse"],
404
+ detectGlobalInstall: async () => {
405
+ return existsSync(join2(home, ".mcporter"));
406
+ },
407
+ resolveConfigPath: resolveMcporterConfigPath
408
+ },
317
409
  opencode: {
318
410
  name: "opencode",
319
411
  displayName: "OpenCode",
@@ -874,8 +966,12 @@ function updateGitignoreWithPaths(paths, options = {}) {
874
966
  };
875
967
  }
876
968
  function getConfigPath(agent, options = {}) {
877
- if (options.local && agent.localConfigPath) {
878
- const cwd = options.cwd || process.cwd();
969
+ const local = Boolean(options.local);
970
+ const cwd = options.cwd || process.cwd();
971
+ if (agent.resolveConfigPath) {
972
+ return agent.resolveConfigPath(agent, { local, cwd });
973
+ }
974
+ if (local && agent.localConfigPath) {
879
975
  return join3(cwd, agent.localConfigPath);
880
976
  }
881
977
  return agent.configPath;
@@ -934,7 +1030,7 @@ function installServer(serverName, serverConfig, agentTypes, options = {}) {
934
1030
  // package.json
935
1031
  var package_default = {
936
1032
  name: "add-mcp",
937
- version: "1.2.2",
1033
+ version: "1.4.0",
938
1034
  description: "Add MCP servers to your favorite coding agents with a single command.",
939
1035
  author: "Andre Landgraf <andre@neon.tech>",
940
1036
  license: "Apache-2.0",
@@ -961,6 +1057,7 @@ var package_default = {
961
1057
  "mcp",
962
1058
  "model-context-protocol",
963
1059
  "ai-agents",
1060
+ "cline",
964
1061
  "claude-code",
965
1062
  "claude-desktop",
966
1063
  "codex",
@@ -968,6 +1065,7 @@ var package_default = {
968
1065
  "github-copilot-cli",
969
1066
  "gemini-cli",
970
1067
  "goose",
1068
+ "mcporter",
971
1069
  "opencode",
972
1070
  "vscode",
973
1071
  "zed"
@@ -1068,7 +1166,7 @@ function parseHeaders(values) {
1068
1166
  return { headers, invalid };
1069
1167
  }
1070
1168
  program.name("add-mcp").description(
1071
- "Install MCP servers onto coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex)"
1169
+ "Install MCP servers for coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex, and more \u2014 run list-agents for the full list)"
1072
1170
  ).version(version).argument("[target]", "MCP server URL (remote) or package name (local stdio)").option(
1073
1171
  "-g, --global",
1074
1172
  "Install globally (user-level) instead of project-level"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-mcp",
3
- "version": "1.2.2",
3
+ "version": "1.4.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",
@@ -34,6 +35,7 @@
34
35
  "github-copilot-cli",
35
36
  "gemini-cli",
36
37
  "goose",
38
+ "mcporter",
37
39
  "opencode",
38
40
  "vscode",
39
41
  "zed"