add-mcp 0.3.1 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +11 -0
  2. package/dist/index.js +52 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -41,6 +41,17 @@ npx add-mcp "node /path/to/server.js --port 3000"
41
41
  | `-y, --yes` | Skip all confirmation prompts |
42
42
  | `--all` | Install to all agents |
43
43
 
44
+ ### Commands
45
+
46
+ | Command | Description |
47
+ | ------------- | ------------------------------------------------------------ |
48
+ | `list-agents` | List all supported coding agents with scope (project/global) |
49
+
50
+ ```bash
51
+ # List all supported agents
52
+ npx add-mcp list-agents
53
+ ```
54
+
44
55
  ### Examples
45
56
 
46
57
  ```bash
package/dist/index.js CHANGED
@@ -210,7 +210,7 @@ var agents = {
210
210
  configPath: join(vscodePath, "mcp.json"),
211
211
  localConfigPath: ".vscode/mcp.json",
212
212
  projectDetectPaths: [".vscode"],
213
- configKey: "mcpServers",
213
+ configKey: "servers",
214
214
  format: "json",
215
215
  supportedTransports: ["stdio", "http", "sse"],
216
216
  detectGlobalInstall: async () => {
@@ -296,11 +296,41 @@ function isPackageName(input) {
296
296
  }
297
297
  return false;
298
298
  }
299
+ var commonTlds = /* @__PURE__ */ new Set([
300
+ "com",
301
+ "org",
302
+ "net",
303
+ "io",
304
+ "dev",
305
+ "ai",
306
+ "tech",
307
+ "co",
308
+ "app",
309
+ "cloud",
310
+ "sh",
311
+ "run"
312
+ ]);
313
+ function extractBrandFromHostname(hostname) {
314
+ const parts = hostname.split(".");
315
+ const meaningfulParts = parts.filter((part) => {
316
+ const lower = part.toLowerCase();
317
+ if (commonTlds.has(lower)) return false;
318
+ if (lower === "mcp" || lower === "api" || lower === "www") return false;
319
+ return true;
320
+ });
321
+ if (meaningfulParts.length > 0) {
322
+ return meaningfulParts[0];
323
+ }
324
+ if (parts.length >= 2) {
325
+ return parts[parts.length - 2];
326
+ }
327
+ return "mcp-server";
328
+ }
299
329
  function inferName(input, type) {
300
330
  if (type === "remote") {
301
331
  try {
302
332
  const url = new URL(input);
303
- return url.hostname.replace(/\./g, "-");
333
+ return extractBrandFromHostname(url.hostname);
304
334
  } catch {
305
335
  return "mcp-server";
306
336
  }
@@ -655,7 +685,7 @@ function installServer(serverName, serverConfig, agentTypes, options = {}) {
655
685
  // package.json
656
686
  var package_default = {
657
687
  name: "add-mcp",
658
- version: "0.3.1",
688
+ version: "0.3.4",
659
689
  description: "Add MCP servers to your favorite coding agents with a single command.",
660
690
  author: "Andre Landgraf <andre@neon.tech>",
661
691
  license: "Apache-2.0",
@@ -782,7 +812,26 @@ program.name("add-mcp").description(
782
812
  ).option("--type <type>", "Alias for --transport").option("-y, --yes", "Skip confirmation prompts").option("--all", "Install to all agents").action(async (target, options) => {
783
813
  await main(target, options);
784
814
  });
815
+ program.command("list-agents").description("List all supported coding agents").action(() => {
816
+ listAgents();
817
+ });
785
818
  program.parse();
819
+ function listAgents() {
820
+ showLogo();
821
+ console.log();
822
+ console.log(`${DIM}Supported agents:${RESET}`);
823
+ console.log();
824
+ const allAgentTypes = getAgentTypes();
825
+ for (const agentType of allAgentTypes) {
826
+ const agent = agents[agentType];
827
+ const hasProjectSupport = supportsProjectConfig(agentType);
828
+ const scope = hasProjectSupport ? "project, global" : "global";
829
+ console.log(
830
+ ` ${TEXT}${agent.displayName}${RESET} ${DIM}(${scope})${RESET}`
831
+ );
832
+ }
833
+ console.log();
834
+ }
786
835
  async function main(target, options) {
787
836
  showLogo();
788
837
  if (!target) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-mcp",
3
- "version": "0.3.1",
3
+ "version": "0.3.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",