add-mcp 1.10.2 → 1.10.4

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 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 [9 more](#supported-agents).
5
+ Supports **Claude Code**, **Codex**, **Cursor**, **OpenCode**, **VSCode** and [10 more](#supported-agents).
6
6
 
7
7
  ## Install an MCP Server
8
8
 
@@ -18,6 +18,20 @@ Example installing the Context7 remote MCP server:
18
18
  npx add-mcp https://mcp.context7.com/mcp
19
19
  ```
20
20
 
21
+ Example installing the Context7 remote MCP server via the programmatic API — great for integrating add-mcp in your own CLI tool:
22
+
23
+ ```ts
24
+ import { upsertServer } from "add-mcp";
25
+
26
+ const result = upsertServer(
27
+ "cursor",
28
+ "context7",
29
+ { type: "http", url: "https://mcp.context7.com/mcp" },
30
+ { local: true },
31
+ );
32
+ console.log(result);
33
+ ```
34
+
21
35
  You can add env variables and arguments (stdio) and headers (remote) to the server config using the `--env`, `--args` and `--header` options. With `${VAR}` placeholders, interactive installs prompt for each variable (omit skipped optional keys so empty strings are not written to config).
22
36
 
23
37
  ## Find an MCP Servers
@@ -49,9 +63,10 @@ MCP servers can be installed to any of these agents:
49
63
  | MCPorter | `mcporter` | `config/mcporter.json` | `~/.mcporter/mcporter.json` (or existing `~/.mcporter/mcporter.jsonc`) |
50
64
  | OpenCode | `opencode` | `opencode.json` | `~/.config/opencode/opencode.json` |
51
65
  | VS Code | `vscode` | `.vscode/mcp.json` | `~/Library/Application Support/Code/User/mcp.json` |
66
+ | Windsurf | `windsurf` | - | `~/.codeium/windsurf/mcp_config.json` |
52
67
  | Zed | `zed` | `.zed/settings.json` | `~/Library/Application Support/Zed/settings.json` |
53
68
 
54
- **Aliases:** `cline-vscode` → `cline`, `gemini` → `gemini-cli`, `github-copilot` → `vscode`
69
+ **Aliases:** `codeium`, `cascade` → `windsurf`, `cline-vscode` → `cline`, `gemini` → `gemini-cli`, `github-copilot` → `vscode`
55
70
 
56
71
  ## Installation Scope
57
72
 
@@ -151,7 +166,7 @@ npx add-mcp https://mcp.example.com/mcp -a cursor -y --gitignore
151
166
  | `-a, --agent <agent>` | Target specific agents (e.g., `cursor`, `claude-code`). Can be repeated. |
152
167
  | `-t, --transport <type>` | Transport type for remote servers: `http` (default), `sse` |
153
168
  | `--type <type>` | Alias for `--transport` |
154
- | `--header <header>` | HTTP header for remote servers (repeatable, `Key: Value`) |
169
+ | `-h, --header <header>` | HTTP header for remote servers (repeatable, `Key: Value`) |
155
170
  | `--env <env>` | Env var for local stdio servers (repeatable, `KEY=VALUE`) |
156
171
  | `-n, --name <name>` | Server name (auto-inferred if not provided) |
157
172
  | `-y, --yes` | Skip all confirmation prompts |
@@ -153,6 +153,12 @@ var copilotConfigPath = join2(
153
153
  process.env.XDG_CONFIG_HOME || join2(home, ".copilot"),
154
154
  "mcp-config.json"
155
155
  );
156
+ var windsurfConfigPath = join2(
157
+ home,
158
+ ".codeium",
159
+ "windsurf",
160
+ "mcp_config.json"
161
+ );
156
162
  function transformGooseConfig(serverName, config) {
157
163
  if (config.url) {
158
164
  const gooseType = config.type === "sse" ? "sse" : "streamable_http";
@@ -503,6 +509,20 @@ var agents = {
503
509
  return existsSync(vscodePath);
504
510
  }
505
511
  },
512
+ windsurf: {
513
+ name: "windsurf",
514
+ displayName: "Windsurf",
515
+ configPath: windsurfConfigPath,
516
+ projectDetectPaths: [],
517
+ // Global only - no project support
518
+ configKey: "mcpServers",
519
+ format: "json",
520
+ supportedTransports: ["stdio", "http", "sse"],
521
+ detectGlobalInstall: async () => {
522
+ return existsSync(join2(home, ".codeium", "windsurf"));
523
+ },
524
+ transformConfig: transformAntigravityConfig
525
+ },
506
526
  zed: {
507
527
  name: "zed",
508
528
  displayName: "Zed",
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  selectAgentsInteractive,
23
23
  supportsProjectConfig,
24
24
  updateGitignoreWithPaths
25
- } from "./chunk-B27GVIBZ.js";
25
+ } from "./chunk-ONLHW5AV.js";
26
26
 
27
27
  // src/index.ts
28
28
  import { program } from "commander";
@@ -33,6 +33,8 @@ import { homedir } from "os";
33
33
  // src/types.ts
34
34
  var agentAliases = {
35
35
  "cline-vscode": "cline",
36
+ codeium: "windsurf",
37
+ cascade: "windsurf",
36
38
  gemini: "gemini-cli",
37
39
  "github-copilot": "vscode"
38
40
  };
@@ -780,7 +782,7 @@ async function runFind(query, options) {
780
782
  // package.json
781
783
  var package_default = {
782
784
  name: "add-mcp",
783
- version: "1.10.2",
785
+ version: "1.10.4",
784
786
  description: "Add MCP servers to your favorite coding agents with a single command.",
785
787
  author: "Andre Landgraf <andre@neon.tech>",
786
788
  license: "Apache-2.0",
@@ -831,6 +833,7 @@ var package_default = {
831
833
  "mcporter",
832
834
  "opencode",
833
835
  "vscode",
836
+ "windsurf",
834
837
  "zed"
835
838
  ],
836
839
  repository: {
@@ -970,7 +973,7 @@ function extractSubcommandOptionsFromArgv() {
970
973
  result.gitignore = true;
971
974
  continue;
972
975
  }
973
- if (arg === "--header" && argv[i + 1]) {
976
+ if ((arg === "-h" || arg === "--header") && argv[i + 1]) {
974
977
  const headers = result.header ? [...result.header] : [];
975
978
  headers.push(argv[i + 1]);
976
979
  result.header = headers;
@@ -1092,7 +1095,7 @@ function omitEmptyStringValues(record) {
1092
1095
  }
1093
1096
  program.name("add-mcp").description(
1094
1097
  "Install MCP servers for coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex, and more \u2014 run list-agents for the full list)"
1095
- ).version(version).argument("[target]", "MCP server URL (remote) or package name (local stdio)").option(
1098
+ ).version(version).helpOption("--help", "display help for command").argument("[target]", "MCP server URL (remote) or package name (local stdio)").option(
1096
1099
  "-g, --global",
1097
1100
  "Install globally (user-level) instead of project-level"
1098
1101
  ).option("-a, --agent <agent>", "Specify agents to install to", collect, []).option(
@@ -1102,7 +1105,7 @@ program.name("add-mcp").description(
1102
1105
  "-t, --transport <type>",
1103
1106
  "Transport type for remote servers (http, sse)"
1104
1107
  ).option("--type <type>", "Alias for --transport").option(
1105
- "--header <header>",
1108
+ "-h, --header <header>",
1106
1109
  "HTTP header for remote servers (repeatable, 'Key: Value'). Placeholders ${VAR} prompt interactively when not using --yes. Use single quotes so your shell does not expand the ${VAR}.",
1107
1110
  collect,
1108
1111
  []
package/dist/lib.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type AgentType = "antigravity" | "cline" | "cline-cli" | "claude-code" | "claude-desktop" | "codex" | "cursor" | "gemini-cli" | "goose" | "github-copilot-cli" | "mcporter" | "opencode" | "vscode" | "zed";
1
+ type AgentType = "antigravity" | "cline" | "cline-cli" | "claude-code" | "claude-desktop" | "codex" | "cursor" | "gemini-cli" | "goose" | "github-copilot-cli" | "mcporter" | "opencode" | "vscode" | "windsurf" | "zed";
2
2
  type ConfigFormat = "json" | "yaml" | "toml";
3
3
  interface AgentConfig {
4
4
  /** Internal name */
package/dist/lib.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  listInstalledServers,
11
11
  readConfig,
12
12
  removeServerFromConfig
13
- } from "./chunk-B27GVIBZ.js";
13
+ } from "./chunk-ONLHW5AV.js";
14
14
 
15
15
  // src/lib.ts
16
16
  import { existsSync } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-mcp",
3
- "version": "1.10.2",
3
+ "version": "1.10.4",
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",
@@ -51,6 +51,7 @@
51
51
  "mcporter",
52
52
  "opencode",
53
53
  "vscode",
54
+ "windsurf",
54
55
  "zed"
55
56
  ],
56
57
  "repository": {