@getmcp/cli 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 getmcp Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # @getmcp/cli
2
+
3
+ CLI tool to install MCP servers into any AI application with one command. Auto-detects installed apps, generates the correct config format, and merges it into existing config files without overwriting.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ # Run directly with npx (no install needed)
9
+ npx @getmcp/cli add github
10
+
11
+ # Or install globally
12
+ npm install -g @getmcp/cli
13
+ ```
14
+
15
+ ## Commands
16
+
17
+ ### `getmcp add [server-id]`
18
+
19
+ Install an MCP server into your AI apps.
20
+
21
+ ```bash
22
+ # Interactive mode — select a server and target apps
23
+ getmcp add
24
+
25
+ # Install a specific server
26
+ getmcp add github
27
+
28
+ # Install with environment variables prompted interactively
29
+ getmcp add brave-search
30
+ # => Prompts: Enter BRAVE_API_KEY: ****
31
+ ```
32
+
33
+ The `add` command will:
34
+ 1. Look up the server in the built-in registry
35
+ 2. Auto-detect which AI apps you have installed
36
+ 3. Ask which apps you want to configure (or configure all)
37
+ 4. Prompt for any required environment variables
38
+ 5. Generate the correct config format for each app
39
+ 6. Merge the config into each app's config file (never overwrites existing servers)
40
+
41
+ ### `getmcp remove <server-name>`
42
+
43
+ Remove an MCP server from your AI app configs.
44
+
45
+ ```bash
46
+ getmcp remove github
47
+ ```
48
+
49
+ ### `getmcp list`
50
+
51
+ Browse the server registry.
52
+
53
+ ```bash
54
+ # List all available servers
55
+ getmcp list
56
+
57
+ # Search for servers
58
+ getmcp list --search=database
59
+
60
+ # Filter by category
61
+ getmcp list --category=developer-tools
62
+
63
+ # List servers installed in your detected apps
64
+ getmcp list --installed
65
+ ```
66
+
67
+ ## Supported Apps
68
+
69
+ The CLI auto-detects and generates configs for:
70
+
71
+ | App | Config Location |
72
+ |-----|----------------|
73
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS), `%AppData%\Claude\claude_desktop_config.json` (Windows) |
74
+ | Claude Code | `.mcp.json` (project), `~/.claude.json` (user) |
75
+ | VS Code / Copilot | `.vscode/mcp.json` |
76
+ | Cursor | `.cursor/mcp.json` |
77
+ | Cline | `cline_mcp_settings.json` (VS Code globalStorage) |
78
+ | Roo Code | `mcp_settings.json` (VS Code globalStorage) |
79
+ | Goose | `~/.config/goose/config.yaml` |
80
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
81
+ | OpenCode | `opencode.json` |
82
+ | Zed | `settings.json` (Zed settings) |
83
+
84
+ ## Programmatic API
85
+
86
+ The CLI also exports its functions for use as a library:
87
+
88
+ ```ts
89
+ import {
90
+ detectApps,
91
+ detectInstalledApps,
92
+ readConfigFile,
93
+ writeConfigFile,
94
+ mergeServerIntoConfig,
95
+ removeServerFromConfig,
96
+ listServersInConfig,
97
+ } from "@getmcp/cli";
98
+
99
+ // Detect which apps are installed
100
+ const apps = await detectInstalledApps();
101
+
102
+ // Read an app's config file
103
+ const config = await readConfigFile("/path/to/config.json");
104
+
105
+ // Merge a new server into an existing config
106
+ const updated = mergeServerIntoConfig(config, "github", serverConfig, "claude-desktop");
107
+
108
+ // Write back (preserves existing content)
109
+ await writeConfigFile("/path/to/config.json", updated);
110
+ ```
111
+
112
+ ## Options
113
+
114
+ ```
115
+ getmcp --help Show help message
116
+ getmcp --version Show version number
117
+ ```
118
+
119
+ ## License
120
+
121
+ MIT
package/dist/bin.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * getmcp CLI entry point.
4
+ *
5
+ * Usage:
6
+ * getmcp add [server-id] Install an MCP server
7
+ * getmcp remove <server-name> Remove an MCP server
8
+ * getmcp list [--installed] List available or installed servers
9
+ * getmcp list [--search=query] Search the registry
10
+ * getmcp list [--category=cat] Filter by category
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG"}
package/dist/bin.js ADDED
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * getmcp CLI entry point.
4
+ *
5
+ * Usage:
6
+ * getmcp add [server-id] Install an MCP server
7
+ * getmcp remove <server-name> Remove an MCP server
8
+ * getmcp list [--installed] List available or installed servers
9
+ * getmcp list [--search=query] Search the registry
10
+ * getmcp list [--category=cat] Filter by category
11
+ */
12
+ import { addCommand } from "./commands/add.js";
13
+ import { removeCommand } from "./commands/remove.js";
14
+ import { listCommand } from "./commands/list.js";
15
+ const VERSION = "0.1.0";
16
+ function printHelp() {
17
+ console.log(`
18
+ getmcp v${VERSION} — Install MCP servers into any AI application
19
+
20
+ Usage:
21
+ getmcp add [server-id] Install an MCP server interactively
22
+ getmcp remove <server-name> Remove an MCP server from app configs
23
+ getmcp list List all available MCP servers
24
+ getmcp list --installed List servers installed in detected apps
25
+ getmcp list --search=<query> Search the registry
26
+ getmcp list --category=<cat> Filter by category
27
+
28
+ Options:
29
+ --help, -h Show this help message
30
+ --version, -v Show version number
31
+
32
+ Examples:
33
+ getmcp add # Interactive server selection
34
+ getmcp add github # Install GitHub MCP server
35
+ getmcp remove github # Remove GitHub from all apps
36
+ getmcp list --search=database # Find database-related servers
37
+ getmcp list --installed # See what's configured in your apps
38
+ `);
39
+ }
40
+ async function main() {
41
+ const args = process.argv.slice(2);
42
+ if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
43
+ printHelp();
44
+ return;
45
+ }
46
+ if (args.includes("--version") || args.includes("-v")) {
47
+ console.log(VERSION);
48
+ return;
49
+ }
50
+ const command = args[0];
51
+ switch (command) {
52
+ case "add": {
53
+ const serverId = args[1];
54
+ await addCommand(serverId);
55
+ break;
56
+ }
57
+ case "remove": {
58
+ const serverName = args[1];
59
+ await removeCommand(serverName);
60
+ break;
61
+ }
62
+ case "list": {
63
+ const installed = args.includes("--installed");
64
+ const searchArg = args.find((a) => a.startsWith("--search="));
65
+ const categoryArg = args.find((a) => a.startsWith("--category="));
66
+ await listCommand({
67
+ installed,
68
+ search: searchArg?.split("=")[1],
69
+ category: categoryArg?.split("=")[1],
70
+ });
71
+ break;
72
+ }
73
+ default:
74
+ console.error(`Unknown command: ${command}`);
75
+ printHelp();
76
+ process.exit(1);
77
+ }
78
+ }
79
+ main().catch((err) => {
80
+ // Graceful exit on Ctrl+C / prompt cancellation
81
+ if (err instanceof Error &&
82
+ (err.message.includes("User force closed") ||
83
+ err.message.includes("prompt was canceled"))) {
84
+ console.log("\nCancelled.");
85
+ process.exit(0);
86
+ }
87
+ console.error(err);
88
+ process.exit(1);
89
+ });
90
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin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@@
1
+ /**
2
+ * `getmcp add` command.
3
+ *
4
+ * Workflow:
5
+ * 1. User picks a server from the registry (or provides ID as argument)
6
+ * 2. If server has required env vars, prompt for them
7
+ * 3. Detect installed AI apps
8
+ * 4. User selects which apps to configure
9
+ * 5. Generate config for each selected app
10
+ * 6. Merge into existing config files (never overwrite)
11
+ */
12
+ export declare function addCommand(serverIdArg?: string): Promise<void>;
13
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAcH,wBAAsB,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsGpE"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * `getmcp add` command.
3
+ *
4
+ * Workflow:
5
+ * 1. User picks a server from the registry (or provides ID as argument)
6
+ * 2. If server has required env vars, prompt for them
7
+ * 3. Detect installed AI apps
8
+ * 4. User selects which apps to configure
9
+ * 5. Generate config for each selected app
10
+ * 6. Merge into existing config files (never overwrite)
11
+ */
12
+ import { select, checkbox, input } from "@inquirer/prompts";
13
+ import { getAllServers, getServer, searchServers, } from "@getmcp/registry";
14
+ import { getGenerator } from "@getmcp/generators";
15
+ import { isStdioConfig } from "@getmcp/core";
16
+ import { detectInstalledApps } from "../detect.js";
17
+ import { mergeServerIntoConfig, writeConfigFile } from "../config-file.js";
18
+ export async function addCommand(serverIdArg) {
19
+ // Step 1: Select server
20
+ let entry;
21
+ if (serverIdArg) {
22
+ const found = getServer(serverIdArg);
23
+ if (!found) {
24
+ // Try fuzzy search
25
+ const matches = searchServers(serverIdArg);
26
+ if (matches.length === 0) {
27
+ console.error(`Server "${serverIdArg}" not found in registry.`);
28
+ process.exit(1);
29
+ }
30
+ if (matches.length === 1) {
31
+ entry = matches[0];
32
+ }
33
+ else {
34
+ entry = await select({
35
+ message: `Multiple matches for "${serverIdArg}". Pick one:`,
36
+ choices: matches.map((s) => ({
37
+ name: `${s.name} — ${s.description}`,
38
+ value: s,
39
+ })),
40
+ });
41
+ }
42
+ }
43
+ else {
44
+ entry = found;
45
+ }
46
+ }
47
+ else {
48
+ const servers = getAllServers();
49
+ entry = await select({
50
+ message: "Select an MCP server to install:",
51
+ choices: servers.map((s) => ({
52
+ name: `${s.name} — ${s.description}`,
53
+ value: s,
54
+ })),
55
+ });
56
+ }
57
+ console.log(`\nInstalling: ${entry.name}`);
58
+ console.log(` ${entry.description}\n`);
59
+ // Step 2: Prompt for required environment variables
60
+ const config = structuredClone(entry.config);
61
+ if (entry.requiredEnvVars.length > 0 && isStdioConfig(config)) {
62
+ console.log("This server requires environment variables:\n");
63
+ for (const envVar of entry.requiredEnvVars) {
64
+ const value = await input({
65
+ message: ` ${envVar}:`,
66
+ validate: (val) => (val.trim() ? true : `${envVar} is required`),
67
+ });
68
+ config.env[envVar] = value.trim();
69
+ }
70
+ console.log();
71
+ }
72
+ // Step 3: Detect installed apps
73
+ const installed = detectInstalledApps();
74
+ if (installed.length === 0) {
75
+ console.log("No AI applications detected on this system.");
76
+ console.log("You can manually copy the config from below:\n");
77
+ printManualConfig(entry, config);
78
+ return;
79
+ }
80
+ // Step 4: Select target apps
81
+ const selectedApps = await checkbox({
82
+ message: "Select apps to configure:",
83
+ choices: installed.map((app) => ({
84
+ name: app.name,
85
+ value: app,
86
+ checked: true, // Pre-select all detected apps
87
+ })),
88
+ validate: (selected) => selected.length > 0 ? true : "Select at least one app",
89
+ });
90
+ // Step 5+6: Generate and merge for each selected app
91
+ for (const app of selectedApps) {
92
+ try {
93
+ const generator = getGenerator(app.id);
94
+ const generatedConfig = generator.generate(entry.id, config);
95
+ const merged = mergeServerIntoConfig(app.configPath, generatedConfig);
96
+ writeConfigFile(app.configPath, merged);
97
+ console.log(` + ${app.name}: ${app.configPath}`);
98
+ }
99
+ catch (err) {
100
+ console.error(` ! ${app.name}: Failed — ${err instanceof Error ? err.message : String(err)}`);
101
+ }
102
+ }
103
+ console.log(`\nDone! "${entry.name}" has been configured.`);
104
+ // Reminder for apps that need restart
105
+ const needsRestart = selectedApps.some((a) => ["claude-desktop", "windsurf", "cursor"].includes(a.id));
106
+ if (needsRestart) {
107
+ console.log("Note: Some apps may need to be restarted to pick up changes.");
108
+ }
109
+ }
110
+ function printManualConfig(entry, config) {
111
+ // Show the canonical format
112
+ const canonical = {
113
+ mcpServers: {
114
+ [entry.id]: config,
115
+ },
116
+ };
117
+ console.log(JSON.stringify(canonical, null, 2));
118
+ }
119
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAW,MAAM,mBAAmB,CAAC;AACrE,OAAO,EACL,aAAa,EACb,SAAS,EACT,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAoB,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE3E,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,WAAoB;IACnD,wBAAwB;IACxB,IAAI,KAAwB,CAAC;IAE7B,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,mBAAmB;YACnB,MAAM,OAAO,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;YAC3C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,WAAW,WAAW,0BAA0B,CAAC,CAA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ACF,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `getmcp list` command.
3
+ *
4
+ * Lists all MCP servers from the registry, or lists servers
5
+ * installed in detected AI apps.
6
+ */
7
+ export declare function listCommand(options: {
8
+ installed?: boolean;
9
+ search?: string;
10
+ category?: string;
11
+ }): Promise<void>;
12
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,wBAAsB,WAAW,CAAC,OAAO,EAAE;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * `getmcp list` command.
3
+ *
4
+ * Lists all MCP servers from the registry, or lists servers
5
+ * installed in detected AI apps.
6
+ */
7
+ import { getAllServers, searchServers, getCategories, getServersByCategory, getServerCount, } from "@getmcp/registry";
8
+ import { detectInstalledApps } from "../detect.js";
9
+ import { listServersInConfig } from "../config-file.js";
10
+ export async function listCommand(options) {
11
+ if (options.installed) {
12
+ return listInstalledServers();
13
+ }
14
+ if (options.category) {
15
+ return listByCategory(options.category);
16
+ }
17
+ return listRegistry(options.search);
18
+ }
19
+ async function listRegistry(search) {
20
+ const servers = search ? searchServers(search) : getAllServers();
21
+ if (servers.length === 0) {
22
+ console.log(search ? `No servers matching "${search}".` : "No servers in registry.");
23
+ return;
24
+ }
25
+ const title = search
26
+ ? `Servers matching "${search}" (${servers.length}):`
27
+ : `Available MCP servers (${getServerCount()}):`;
28
+ console.log(`\n${title}\n`);
29
+ for (const server of servers) {
30
+ const transport = "command" in server.config ? "stdio" : "remote";
31
+ const envCount = server.requiredEnvVars.length;
32
+ const envNote = envCount > 0 ? ` [${envCount} env var${envCount > 1 ? "s" : ""} required]` : "";
33
+ console.log(` ${server.id}`);
34
+ console.log(` ${server.name} — ${server.description}`);
35
+ console.log(` Transport: ${transport}${envNote}`);
36
+ if (server.categories && server.categories.length > 0) {
37
+ console.log(` Categories: ${server.categories.join(", ")}`);
38
+ }
39
+ console.log();
40
+ }
41
+ }
42
+ async function listByCategory(category) {
43
+ const servers = getServersByCategory(category);
44
+ if (servers.length === 0) {
45
+ console.log(`No servers in category "${category}".`);
46
+ console.log(`\nAvailable categories: ${getCategories().join(", ")}`);
47
+ return;
48
+ }
49
+ console.log(`\nServers in category "${category}" (${servers.length}):\n`);
50
+ for (const server of servers) {
51
+ console.log(` ${server.id} — ${server.name}`);
52
+ console.log(` ${server.description}`);
53
+ console.log();
54
+ }
55
+ }
56
+ async function listInstalledServers() {
57
+ const apps = detectInstalledApps();
58
+ if (apps.length === 0) {
59
+ console.log("No AI applications detected on this system.");
60
+ return;
61
+ }
62
+ console.log(`\nDetected AI applications (${apps.length}):\n`);
63
+ for (const app of apps) {
64
+ console.log(` ${app.name}`);
65
+ console.log(` Config: ${app.configPath}`);
66
+ try {
67
+ const servers = listServersInConfig(app.configPath);
68
+ if (servers.length > 0) {
69
+ console.log(` Servers: ${servers.join(", ")}`);
70
+ }
71
+ else {
72
+ console.log(` Servers: (none configured)`);
73
+ }
74
+ }
75
+ catch {
76
+ console.log(` Servers: (config not readable)`);
77
+ }
78
+ console.log();
79
+ }
80
+ }
81
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA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,CAAC,WAAW,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,oBAAoB;IACjC,MAAM,IAAI,GAAG,mBAAmB,EAAE,CAAC;IAEnC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC;IAE9D,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QAE7C,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACpD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvB,OAAO,CAAC,GAAG,CAAC,gBAAgB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `getmcp remove` command.
3
+ *
4
+ * Workflow:
5
+ * 1. User provides server name to remove
6
+ * 2. Detect installed apps
7
+ * 3. User selects which apps to remove from (or all)
8
+ * 4. Remove server from each selected config file
9
+ */
10
+ export declare function removeCommand(serverName?: string): Promise<void>;
11
+ //# sourceMappingURL=remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/commands/remove.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,wBAAsB,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoFtE"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * `getmcp remove` command.
3
+ *
4
+ * Workflow:
5
+ * 1. User provides server name to remove
6
+ * 2. Detect installed apps
7
+ * 3. User selects which apps to remove from (or all)
8
+ * 4. Remove server from each selected config file
9
+ */
10
+ import { checkbox, confirm } from "@inquirer/prompts";
11
+ import { detectInstalledApps } from "../detect.js";
12
+ import { removeServerFromConfig, writeConfigFile, listServersInConfig, } from "../config-file.js";
13
+ export async function removeCommand(serverName) {
14
+ if (!serverName) {
15
+ console.error("Usage: getmcp remove <server-name>");
16
+ console.error(" Provide the name/key of the MCP server to remove.");
17
+ process.exit(1);
18
+ }
19
+ const installed = detectInstalledApps();
20
+ if (installed.length === 0) {
21
+ console.log("No AI applications detected on this system.");
22
+ return;
23
+ }
24
+ // Find which apps have this server configured
25
+ const appsWithServer = [];
26
+ for (const app of installed) {
27
+ try {
28
+ const servers = listServersInConfig(app.configPath);
29
+ if (servers.includes(serverName)) {
30
+ appsWithServer.push(app);
31
+ }
32
+ }
33
+ catch {
34
+ // Skip apps with unreadable config
35
+ }
36
+ }
37
+ if (appsWithServer.length === 0) {
38
+ console.log(`Server "${serverName}" was not found in any detected app config.`);
39
+ return;
40
+ }
41
+ console.log(`\nFound "${serverName}" in ${appsWithServer.length} app(s):\n`);
42
+ for (const app of appsWithServer) {
43
+ console.log(` - ${app.name} (${app.configPath})`);
44
+ }
45
+ console.log();
46
+ // Confirm removal
47
+ const selectedApps = await checkbox({
48
+ message: "Select apps to remove from:",
49
+ choices: appsWithServer.map((app) => ({
50
+ name: app.name,
51
+ value: app,
52
+ checked: true,
53
+ })),
54
+ });
55
+ if (selectedApps.length === 0) {
56
+ console.log("No apps selected. Cancelled.");
57
+ return;
58
+ }
59
+ const yes = await confirm({
60
+ message: `Remove "${serverName}" from ${selectedApps.length} app(s)?`,
61
+ default: true,
62
+ });
63
+ if (!yes) {
64
+ console.log("Cancelled.");
65
+ return;
66
+ }
67
+ for (const app of selectedApps) {
68
+ try {
69
+ const updated = removeServerFromConfig(app.configPath, serverName);
70
+ if (updated) {
71
+ writeConfigFile(app.configPath, updated);
72
+ console.log(` - ${app.name}: removed`);
73
+ }
74
+ else {
75
+ console.log(` - ${app.name}: not found (skipped)`);
76
+ }
77
+ }
78
+ catch (err) {
79
+ console.error(` ! ${app.name}: Failed — ${err instanceof Error ? err.message : String(err)}`);
80
+ }
81
+ }
82
+ console.log(`\nDone! "${serverName}" has been removed.`);
83
+ }
84
+ //# sourceMappingURL=remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.js","sourceRoot":"","sources":["../../src/commands/remove.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAoB,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,UAAmB;IACrD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACpD,OAAO,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,SAAS,GAAG,mBAAmB,EAAE,CAAC;IAExC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC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AAM,GAAG,GAAG,MAAM,OAAO,CAAC;QACxB,OAAO,EAAE,WAAW,UAAU,UAAU,YAAY,CAAC,MAAM,UAAU;QACrE,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,sBAAsB,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;YACnE,IAAI,OAAO,EAAE,CAAC;gBACZ,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;gBACzC,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,IAAI,WAAW,CAAC,CAAC;YAC1C,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,IAAI,uBAAuB,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CACX,OAAO,GAAG,CAAC,IAAI,cAAc,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAChF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,YAAY,UAAU,qBAAqB,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Config file reading, merging, and writing.
3
+ *
4
+ * Key principle: NEVER overwrite existing config files.
5
+ * Always read the existing config, merge the new server in, and write back.
6
+ */
7
+ /**
8
+ * Read and parse a JSON config file.
9
+ * Returns an empty object if the file doesn't exist.
10
+ * Handles JSONC (strips comments) for VS Code/OpenCode compatibility.
11
+ */
12
+ export declare function readConfigFile(filePath: string): Record<string, unknown>;
13
+ /**
14
+ * Write a config object to a JSON file.
15
+ * Creates parent directories if they don't exist.
16
+ */
17
+ export declare function writeConfigFile(filePath: string, config: Record<string, unknown>): void;
18
+ /**
19
+ * Merge a generated server config into an existing config file.
20
+ *
21
+ * The generated config has the shape:
22
+ * { rootKey: { serverName: { ...serverConfig } } }
23
+ *
24
+ * This function deep-merges the server into the existing file's root key,
25
+ * preserving all other existing servers and config.
26
+ */
27
+ export declare function mergeServerIntoConfig(filePath: string, generatedConfig: Record<string, unknown>): Record<string, unknown>;
28
+ /**
29
+ * Remove a server from a config file.
30
+ *
31
+ * Looks through all object values at the top level for a key matching
32
+ * the server name and removes it.
33
+ *
34
+ * Returns the updated config, or null if the server wasn't found.
35
+ */
36
+ export declare function removeServerFromConfig(filePath: string, serverName: string): Record<string, unknown> | null;
37
+ /**
38
+ * List all server names found in a config file.
39
+ * Scans known root keys: mcpServers, servers, extensions, mcp, context_servers.
40
+ */
41
+ export declare function listServersInConfig(filePath: string): string[];
42
+ //# sourceMappingURL=config-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../src/config-file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkBxE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,IAAI,CAMN;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBzB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAmBhC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GACf,MAAM,EAAE,CAaV"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Config file reading, merging, and writing.
3
+ *
4
+ * Key principle: NEVER overwrite existing config files.
5
+ * Always read the existing config, merge the new server in, and write back.
6
+ */
7
+ import * as fs from "node:fs";
8
+ import * as path from "node:path";
9
+ /**
10
+ * Read and parse a JSON config file.
11
+ * Returns an empty object if the file doesn't exist.
12
+ * Handles JSONC (strips comments) for VS Code/OpenCode compatibility.
13
+ */
14
+ export function readConfigFile(filePath) {
15
+ if (!fs.existsSync(filePath)) {
16
+ return {};
17
+ }
18
+ const raw = fs.readFileSync(filePath, "utf-8");
19
+ if (!raw.trim())
20
+ return {};
21
+ // Strip single-line and multi-line comments for JSONC support
22
+ const stripped = raw
23
+ .replace(/\/\/.*$/gm, "")
24
+ .replace(/\/\*[\s\S]*?\*\//g, "");
25
+ try {
26
+ return JSON.parse(stripped);
27
+ }
28
+ catch {
29
+ throw new Error(`Failed to parse config file: ${filePath}`);
30
+ }
31
+ }
32
+ /**
33
+ * Write a config object to a JSON file.
34
+ * Creates parent directories if they don't exist.
35
+ */
36
+ export function writeConfigFile(filePath, config) {
37
+ const dir = path.dirname(filePath);
38
+ if (!fs.existsSync(dir)) {
39
+ fs.mkdirSync(dir, { recursive: true });
40
+ }
41
+ fs.writeFileSync(filePath, JSON.stringify(config, null, 2) + "\n", "utf-8");
42
+ }
43
+ /**
44
+ * Merge a generated server config into an existing config file.
45
+ *
46
+ * The generated config has the shape:
47
+ * { rootKey: { serverName: { ...serverConfig } } }
48
+ *
49
+ * This function deep-merges the server into the existing file's root key,
50
+ * preserving all other existing servers and config.
51
+ */
52
+ export function mergeServerIntoConfig(filePath, generatedConfig) {
53
+ const existing = readConfigFile(filePath);
54
+ // Deep merge: for each top-level key in generated config
55
+ for (const [rootKey, value] of Object.entries(generatedConfig)) {
56
+ if (typeof value === "object" &&
57
+ value !== null &&
58
+ !Array.isArray(value)) {
59
+ const existingSection = existing[rootKey] ?? {};
60
+ existing[rootKey] = {
61
+ ...existingSection,
62
+ ...value,
63
+ };
64
+ }
65
+ else {
66
+ existing[rootKey] = value;
67
+ }
68
+ }
69
+ return existing;
70
+ }
71
+ /**
72
+ * Remove a server from a config file.
73
+ *
74
+ * Looks through all object values at the top level for a key matching
75
+ * the server name and removes it.
76
+ *
77
+ * Returns the updated config, or null if the server wasn't found.
78
+ */
79
+ export function removeServerFromConfig(filePath, serverName) {
80
+ const existing = readConfigFile(filePath);
81
+ let found = false;
82
+ for (const [rootKey, value] of Object.entries(existing)) {
83
+ if (typeof value === "object" &&
84
+ value !== null &&
85
+ !Array.isArray(value)) {
86
+ const section = value;
87
+ if (serverName in section) {
88
+ delete section[serverName];
89
+ found = true;
90
+ }
91
+ }
92
+ }
93
+ return found ? existing : null;
94
+ }
95
+ /**
96
+ * List all server names found in a config file.
97
+ * Scans known root keys: mcpServers, servers, extensions, mcp, context_servers.
98
+ */
99
+ export function listServersInConfig(filePath) {
100
+ const existing = readConfigFile(filePath);
101
+ const rootKeys = ["mcpServers", "servers", "extensions", "mcp", "context_servers"];
102
+ const servers = [];
103
+ for (const rootKey of rootKeys) {
104
+ const section = existing[rootKey];
105
+ if (typeof section === "object" && section !== null && !Array.isArray(section)) {
106
+ servers.push(...Object.keys(section));
107
+ }
108
+ }
109
+ return servers;
110
+ }
111
+ //# sourceMappingURL=config-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-file.js","sourceRoot":"","sources":["../src/config-file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC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1C,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACnF,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/E,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,OAAkC,CAAC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * App auto-detection.
3
+ *
4
+ * Checks if AI applications are installed by looking for their
5
+ * config files (or parent directories) on the current platform.
6
+ */
7
+ import type { AppIdType, AppMetadata } from "@getmcp/core";
8
+ /**
9
+ * Resolve platform-specific path placeholders.
10
+ */
11
+ export declare function resolvePath(configPath: string): string;
12
+ /**
13
+ * Get the resolved config path for an app on the current platform.
14
+ * Returns undefined if the app has no config path for this platform.
15
+ */
16
+ export declare function getConfigPath(app: AppMetadata): string | undefined;
17
+ export interface DetectedApp {
18
+ id: AppIdType;
19
+ name: string;
20
+ configPath: string;
21
+ exists: boolean;
22
+ }
23
+ /**
24
+ * Detect which AI apps are installed by checking for config files.
25
+ * Returns all apps with their resolved config paths and existence status.
26
+ */
27
+ export declare function detectApps(): DetectedApp[];
28
+ /**
29
+ * Get only the apps that appear to be installed.
30
+ */
31
+ export declare function detectInstalledApps(): DetectedApp[];
32
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAqBtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAKlE;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,SAAS,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,WAAW,EAAE,CAqB1C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,WAAW,EAAE,CAEnD"}
package/dist/detect.js ADDED
@@ -0,0 +1,68 @@
1
+ /**
2
+ * App auto-detection.
3
+ *
4
+ * Checks if AI applications are installed by looking for their
5
+ * config files (or parent directories) on the current platform.
6
+ */
7
+ import * as fs from "node:fs";
8
+ import * as path from "node:path";
9
+ import * as os from "node:os";
10
+ import { generators } from "@getmcp/generators";
11
+ /**
12
+ * Resolve platform-specific path placeholders.
13
+ */
14
+ export function resolvePath(configPath) {
15
+ let resolved = configPath;
16
+ // ~ → home directory
17
+ if (resolved.startsWith("~/")) {
18
+ resolved = path.join(os.homedir(), resolved.slice(2));
19
+ }
20
+ // %AppData% → Windows AppData\Roaming
21
+ resolved = resolved.replace(/%AppData%/gi, process.env.APPDATA ?? path.join(os.homedir(), "AppData", "Roaming"));
22
+ // %UserProfile% → Windows home
23
+ resolved = resolved.replace(/%UserProfile%/gi, os.homedir());
24
+ // %LocalAppData% → Windows AppData\Local
25
+ resolved = resolved.replace(/%LocalAppData%/gi, process.env.LOCALAPPDATA ?? path.join(os.homedir(), "AppData", "Local"));
26
+ return path.normalize(resolved);
27
+ }
28
+ /**
29
+ * Get the resolved config path for an app on the current platform.
30
+ * Returns undefined if the app has no config path for this platform.
31
+ */
32
+ export function getConfigPath(app) {
33
+ const platform = process.platform;
34
+ const configPath = app.configPaths[platform];
35
+ if (!configPath)
36
+ return undefined;
37
+ return resolvePath(configPath);
38
+ }
39
+ /**
40
+ * Detect which AI apps are installed by checking for config files.
41
+ * Returns all apps with their resolved config paths and existence status.
42
+ */
43
+ export function detectApps() {
44
+ const results = [];
45
+ for (const generator of Object.values(generators)) {
46
+ const configPath = getConfigPath(generator.app);
47
+ if (!configPath)
48
+ continue;
49
+ // Check if the config file itself exists, or its parent directory exists
50
+ // (some apps create the config file on first MCP server addition)
51
+ const fileExists = fs.existsSync(configPath);
52
+ const parentExists = fs.existsSync(path.dirname(configPath));
53
+ results.push({
54
+ id: generator.app.id,
55
+ name: generator.app.name,
56
+ configPath,
57
+ exists: fileExists || parentExists,
58
+ });
59
+ }
60
+ return results;
61
+ }
62
+ /**
63
+ * Get only the apps that appear to be installed.
64
+ */
65
+ export function detectInstalledApps() {
66
+ return detectApps().filter((app) => app.exists);
67
+ }
68
+ //# sourceMappingURL=detect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.js","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,UAAkB;IAC5C,IAAI,QAAQ,GAAG,UAAU,CAAC;IAE1B,qBAAqB;IACrB,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,sCAAsC;I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,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;QAE7D,OAAO,CAAC,IAAI,CAAC;YACX,EAAE,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE;YACpB,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,IAAI;YACxB,UAAU;YACV,MAAM,EAAE,UAAU,IAAI,YAAY;SACnC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @getmcp/cli
3
+ *
4
+ * CLI tool to install MCP servers into any AI application.
5
+ * Supports: add, remove, list commands.
6
+ */
7
+ export { addCommand } from "./commands/add.js";
8
+ export { removeCommand } from "./commands/remove.js";
9
+ export { listCommand } from "./commands/list.js";
10
+ export { detectApps, detectInstalledApps, resolvePath, getConfigPath } from "./detect.js";
11
+ export { readConfigFile, writeConfigFile, mergeServerIntoConfig, removeServerFromConfig, listServersInConfig, } from "./config-file.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @getmcp/cli
3
+ *
4
+ * CLI tool to install MCP servers into any AI application.
5
+ * Supports: add, remove, list commands.
6
+ */
7
+ export { addCommand } from "./commands/add.js";
8
+ export { removeCommand } from "./commands/remove.js";
9
+ export { listCommand } from "./commands/list.js";
10
+ export { detectApps, detectInstalledApps, resolvePath, getConfigPath } from "./detect.js";
11
+ export { readConfigFile, writeConfigFile, mergeServerIntoConfig, removeServerFromConfig, listServersInConfig, } from "./config-file.js";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@getmcp/cli",
3
+ "version": "0.1.1",
4
+ "description": "CLI tool to install MCP servers into any AI application with one command",
5
+ "type": "module",
6
+ "bin": {
7
+ "getmcp": "./dist/bin.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc",
24
+ "test": "vitest run",
25
+ "lint": "tsc --noEmit",
26
+ "prepublishOnly": "npm run build"
27
+ },
28
+ "keywords": [
29
+ "mcp",
30
+ "model-context-protocol",
31
+ "cli",
32
+ "installer",
33
+ "claude-desktop",
34
+ "cursor",
35
+ "vscode",
36
+ "windsurf",
37
+ "cline",
38
+ "roo-code",
39
+ "goose",
40
+ "opencode",
41
+ "zed",
42
+ "ai-tools"
43
+ ],
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/RodrigoTomeES/getmcp.git",
48
+ "directory": "packages/cli"
49
+ },
50
+ "homepage": "https://github.com/RodrigoTomeES/getmcp/tree/main/packages/cli#readme",
51
+ "bugs": {
52
+ "url": "https://github.com/RodrigoTomeES/getmcp/issues"
53
+ },
54
+ "engines": {
55
+ "node": ">=22.0.0"
56
+ },
57
+ "dependencies": {
58
+ "@getmcp/core": "^0.1.0",
59
+ "@getmcp/generators": "^0.1.0",
60
+ "@getmcp/registry": "^0.1.0",
61
+ "@inquirer/prompts": "^7.0.0"
62
+ }
63
+ }