add-mcp 1.10.3 → 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
@@ -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
@@ -152,7 +166,7 @@ npx add-mcp https://mcp.example.com/mcp -a cursor -y --gitignore
152
166
  | `-a, --agent <agent>` | Target specific agents (e.g., `cursor`, `claude-code`). Can be repeated. |
153
167
  | `-t, --transport <type>` | Transport type for remote servers: `http` (default), `sse` |
154
168
  | `--type <type>` | Alias for `--transport` |
155
- | `--header <header>` | HTTP header for remote servers (repeatable, `Key: Value`) |
169
+ | `-h, --header <header>` | HTTP header for remote servers (repeatable, `Key: Value`) |
156
170
  | `--env <env>` | Env var for local stdio servers (repeatable, `KEY=VALUE`) |
157
171
  | `-n, --name <name>` | Server name (auto-inferred if not provided) |
158
172
  | `-y, --yes` | Skip all confirmation prompts |
package/dist/index.js CHANGED
@@ -782,7 +782,7 @@ async function runFind(query, options) {
782
782
  // package.json
783
783
  var package_default = {
784
784
  name: "add-mcp",
785
- version: "1.10.3",
785
+ version: "1.10.4",
786
786
  description: "Add MCP servers to your favorite coding agents with a single command.",
787
787
  author: "Andre Landgraf <andre@neon.tech>",
788
788
  license: "Apache-2.0",
@@ -973,7 +973,7 @@ function extractSubcommandOptionsFromArgv() {
973
973
  result.gitignore = true;
974
974
  continue;
975
975
  }
976
- if (arg === "--header" && argv[i + 1]) {
976
+ if ((arg === "-h" || arg === "--header") && argv[i + 1]) {
977
977
  const headers = result.header ? [...result.header] : [];
978
978
  headers.push(argv[i + 1]);
979
979
  result.header = headers;
@@ -1095,7 +1095,7 @@ function omitEmptyStringValues(record) {
1095
1095
  }
1096
1096
  program.name("add-mcp").description(
1097
1097
  "Install MCP servers for coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex, and more \u2014 run list-agents for the full list)"
1098
- ).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(
1099
1099
  "-g, --global",
1100
1100
  "Install globally (user-level) instead of project-level"
1101
1101
  ).option("-a, --agent <agent>", "Specify agents to install to", collect, []).option(
@@ -1105,7 +1105,7 @@ program.name("add-mcp").description(
1105
1105
  "-t, --transport <type>",
1106
1106
  "Transport type for remote servers (http, sse)"
1107
1107
  ).option("--type <type>", "Alias for --transport").option(
1108
- "--header <header>",
1108
+ "-h, --header <header>",
1109
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}.",
1110
1110
  collect,
1111
1111
  []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-mcp",
3
- "version": "1.10.3",
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",