add-mcp 0.0.1 → 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Support. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Andre Landgraf
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # add-mcp
2
+
3
+ Install MCP servers onto coding agents with a single command.
4
+
5
+ ```bash
6
+ npx add-mcp <target>
7
+ ```
8
+
9
+ Supports Opencode, Claude Code, Codex, Cursor, and [more](https://github.com/neondatabase/add-mcp/blob/main/README.md#supported-agents).
10
+
11
+ ## Features
12
+
13
+ - Install MCP servers to multiple AI coding agents at once
14
+ - Supports both remote (HTTP/SSE) and local (stdio) MCP servers
15
+ - Handles different config formats (JSON, YAML, TOML)
16
+ - Supports project-level and global installation
17
+
18
+ ## Usage
19
+
20
+ ### Remote MCP Server (HTTP)
21
+
22
+ ```bash
23
+ # Install a remote MCP server
24
+ npx add-mcp https://mcp.example.com/api
25
+
26
+ # With custom name
27
+ npx add-mcp https://mcp.example.com/api --name my-server
28
+ ```
29
+
30
+ ### Local MCP Server (Package)
31
+
32
+ ```bash
33
+ # Install from npm package
34
+ npx add-mcp @modelcontextprotocol/server-postgres
35
+
36
+ # Install with custom name
37
+ npx add-mcp mcp-server-github --name github
38
+ ```
39
+
40
+ ### Local MCP Server (Command)
41
+
42
+ ```bash
43
+ # Install with full command
44
+ npx add-mcp "npx -y @org/mcp-server --flag value"
45
+
46
+ # Node.js script
47
+ npx add-mcp "node /path/to/server.js --port 3000"
48
+ ```
49
+
50
+ ## Options
51
+
52
+ ```
53
+ Usage: add-mcp [options] [target]
54
+
55
+ Arguments:
56
+ target MCP server URL (remote) or package name (local stdio)
57
+
58
+ Options:
59
+ -V, --version output the version number
60
+ -g, --global Install globally (user-level) instead of project-level
61
+ -a, --agent <agents...> Specify agents to install to
62
+ -n, --name <name> Server name (auto-inferred from target if not provided)
63
+ -y, --yes Skip confirmation prompts
64
+ -l, --list List supported agents
65
+ --all Install to all agents without prompts (implies -y -g)
66
+ -h, --help display help for command
67
+ ```
68
+
69
+ ## Supported Agents
70
+
71
+ <!-- AGENTS_TABLE_START -->
72
+
73
+ | Agent | CLI Key | Format | Local Support |
74
+ | -------------- | ---------------- | ------ | ------------- |
75
+ | Claude Code | `claude-code` | JSON | Yes |
76
+ | Claude Desktop | `claude-desktop` | JSON | No |
77
+ | Codex | `codex` | TOML | No |
78
+ | Cursor | `cursor` | JSON | Yes |
79
+ | Gemini CLI | `gemini-cli` | JSON | Yes |
80
+ | Goose | `goose` | YAML | No |
81
+ | OpenCode | `opencode` | JSON | Yes |
82
+ | VS Code | `vscode` | JSON | Yes |
83
+ | Zed | `zed` | JSON | No |
84
+
85
+ <!-- AGENTS_TABLE_END -->
86
+
87
+ **Aliases:** `github-copilot` → `vscode`
88
+
89
+ ## Examples
90
+
91
+ ### Install to specific agents
92
+
93
+ ```bash
94
+ # Install to Cursor and Claude Code only
95
+ npx add-mcp https://mcp.example.com/api -a cursor claude-code
96
+
97
+ # Install to VS Code (using alias)
98
+ npx add-mcp mcp-server -a github-copilot
99
+ ```
100
+
101
+ ### Project vs Global installation
102
+
103
+ ```bash
104
+ # Project-level (creates .cursor/mcp.json, .mcp.json, etc.)
105
+ npx add-mcp mcp-server
106
+
107
+ # Global (installs to ~/.cursor/mcp.json, ~/.claude.json, etc.)
108
+ npx add-mcp mcp-server --global
109
+ ```
110
+
111
+ ### Non-interactive mode
112
+
113
+ ```bash
114
+ # Skip all prompts, install globally to all detected agents
115
+ npx add-mcp https://mcp.example.com/api -y -g
116
+
117
+ # Install to all agents without any prompts
118
+ npx add-mcp mcp-server --all
119
+ ```
120
+
121
+ ## Config File Locations
122
+
123
+ | Agent | Global | Local |
124
+ | -------------- | ----------------------------------------------------------------- | ----------------------- |
125
+ | Claude Code | `~/.claude.json` | `.mcp.json` |
126
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | - |
127
+ | Codex | `~/.codex/config.toml` | - |
128
+ | Cursor | `~/.cursor/mcp.json` | `.cursor/mcp.json` |
129
+ | Gemini CLI | `~/.gemini/settings.json` | `.gemini/settings.json` |
130
+ | Goose | `~/.config/goose/config.yaml` | - |
131
+ | OpenCode | `~/.config/opencode/opencode.json` | `.opencode.json` |
132
+ | VS Code | `~/Library/Application Support/Code/User/mcp.json` | `.vscode/mcp.json` |
133
+ | Zed | `~/.config/zed/settings.json` | - |
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/index.js ADDED
@@ -0,0 +1,922 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { program } from "commander";
5
+ import * as p from "@clack/prompts";
6
+ import chalk from "chalk";
7
+ import { homedir as homedir2 } from "os";
8
+
9
+ // src/types.ts
10
+ var agentAliases = {
11
+ "github-copilot": "vscode"
12
+ };
13
+
14
+ // src/agents.ts
15
+ import { homedir } from "os";
16
+ import { join } from "path";
17
+ import { existsSync } from "fs";
18
+ var home = homedir();
19
+ function getPlatformPaths() {
20
+ const platform = process.platform;
21
+ if (platform === "win32") {
22
+ const appData = process.env.APPDATA || join(home, "AppData", "Roaming");
23
+ return {
24
+ appSupport: appData,
25
+ vscodePath: join(appData, "Code", "User")
26
+ };
27
+ } else if (platform === "darwin") {
28
+ return {
29
+ appSupport: join(home, "Library", "Application Support"),
30
+ vscodePath: join(home, "Library", "Application Support", "Code", "User")
31
+ };
32
+ } else {
33
+ const configDir = process.env.XDG_CONFIG_HOME || join(home, ".config");
34
+ return {
35
+ appSupport: configDir,
36
+ vscodePath: join(configDir, "Code", "User")
37
+ };
38
+ }
39
+ }
40
+ var { appSupport, vscodePath } = getPlatformPaths();
41
+ function transformGooseConfig(serverName, config) {
42
+ if (config.url) {
43
+ return {
44
+ name: serverName,
45
+ cmd: "echo",
46
+ args: [`Remote MCP servers not directly supported. URL: ${config.url}`],
47
+ enabled: false,
48
+ envs: {},
49
+ type: "stdio",
50
+ timeout: 300
51
+ };
52
+ }
53
+ return {
54
+ name: serverName,
55
+ cmd: config.command,
56
+ args: config.args || [],
57
+ enabled: true,
58
+ envs: config.env || {},
59
+ type: "stdio",
60
+ timeout: 300
61
+ };
62
+ }
63
+ function transformZedConfig(_serverName, config) {
64
+ if (config.url) {
65
+ return {
66
+ source: "custom",
67
+ type: config.type || "http",
68
+ url: config.url,
69
+ headers: config.headers || {}
70
+ };
71
+ }
72
+ return {
73
+ source: "custom",
74
+ command: config.command,
75
+ args: config.args || [],
76
+ env: config.env || {}
77
+ };
78
+ }
79
+ function transformOpenCodeConfig(_serverName, config) {
80
+ if (config.url) {
81
+ return {
82
+ type: "remote",
83
+ url: config.url,
84
+ enabled: true,
85
+ headers: config.headers
86
+ };
87
+ }
88
+ return {
89
+ type: "local",
90
+ command: config.command,
91
+ args: config.args || [],
92
+ enabled: true,
93
+ environment: config.env || {}
94
+ };
95
+ }
96
+ function transformCodexConfig(_serverName, config) {
97
+ if (config.url) {
98
+ return {
99
+ type: config.type || "http",
100
+ url: config.url,
101
+ headers: config.headers
102
+ };
103
+ }
104
+ return {
105
+ command: config.command,
106
+ args: config.args || [],
107
+ env: config.env
108
+ };
109
+ }
110
+ var agents = {
111
+ "claude-code": {
112
+ name: "claude-code",
113
+ displayName: "Claude Code",
114
+ configPath: join(home, ".claude.json"),
115
+ localConfigPath: ".mcp.json",
116
+ configKey: "mcpServers",
117
+ format: "json",
118
+ detectInstalled: async () => {
119
+ return existsSync(join(home, ".claude"));
120
+ }
121
+ },
122
+ "claude-desktop": {
123
+ name: "claude-desktop",
124
+ displayName: "Claude Desktop",
125
+ configPath: join(appSupport, "Claude", "claude_desktop_config.json"),
126
+ configKey: "mcpServers",
127
+ format: "json",
128
+ detectInstalled: async () => {
129
+ return existsSync(join(appSupport, "Claude"));
130
+ }
131
+ },
132
+ codex: {
133
+ name: "codex",
134
+ displayName: "Codex",
135
+ configPath: join(
136
+ process.env.CODEX_HOME || join(home, ".codex"),
137
+ "config.toml"
138
+ ),
139
+ configKey: "mcp_servers",
140
+ format: "toml",
141
+ detectInstalled: async () => {
142
+ return existsSync(join(home, ".codex"));
143
+ },
144
+ transformConfig: transformCodexConfig
145
+ },
146
+ cursor: {
147
+ name: "cursor",
148
+ displayName: "Cursor",
149
+ configPath: join(home, ".cursor", "mcp.json"),
150
+ localConfigPath: ".cursor/mcp.json",
151
+ configKey: "mcpServers",
152
+ format: "json",
153
+ detectInstalled: async () => {
154
+ return existsSync(join(home, ".cursor"));
155
+ }
156
+ },
157
+ "gemini-cli": {
158
+ name: "gemini-cli",
159
+ displayName: "Gemini CLI",
160
+ configPath: join(home, ".gemini", "settings.json"),
161
+ localConfigPath: ".gemini/settings.json",
162
+ configKey: "mcpServers",
163
+ format: "json",
164
+ detectInstalled: async () => {
165
+ return existsSync(join(home, ".gemini"));
166
+ }
167
+ },
168
+ goose: {
169
+ name: "goose",
170
+ displayName: "Goose",
171
+ configPath: join(home, ".config", "goose", "config.yaml"),
172
+ configKey: "extensions",
173
+ format: "yaml",
174
+ detectInstalled: async () => {
175
+ return existsSync(join(home, ".config", "goose"));
176
+ },
177
+ transformConfig: transformGooseConfig
178
+ },
179
+ opencode: {
180
+ name: "opencode",
181
+ displayName: "OpenCode",
182
+ configPath: join(home, ".config", "opencode", "opencode.json"),
183
+ localConfigPath: ".opencode.json",
184
+ configKey: "mcp",
185
+ format: "json",
186
+ detectInstalled: async () => {
187
+ return existsSync(join(home, ".config", "opencode"));
188
+ },
189
+ transformConfig: transformOpenCodeConfig
190
+ },
191
+ vscode: {
192
+ name: "vscode",
193
+ displayName: "VS Code",
194
+ configPath: join(vscodePath, "mcp.json"),
195
+ localConfigPath: ".vscode/mcp.json",
196
+ configKey: "mcpServers",
197
+ format: "json",
198
+ detectInstalled: async () => {
199
+ return existsSync(vscodePath);
200
+ }
201
+ },
202
+ zed: {
203
+ name: "zed",
204
+ displayName: "Zed",
205
+ configPath: process.platform === "win32" ? join(
206
+ process.env.APPDATA || join(home, "AppData", "Roaming"),
207
+ "Zed",
208
+ "settings.json"
209
+ ) : join(home, ".config", "zed", "settings.json"),
210
+ configKey: "context_servers",
211
+ format: "json",
212
+ detectInstalled: async () => {
213
+ return existsSync(join(home, ".config", "zed")) || existsSync(join(process.env.APPDATA || "", "Zed"));
214
+ },
215
+ transformConfig: transformZedConfig
216
+ }
217
+ };
218
+ function getAgentTypes() {
219
+ return Object.keys(agents);
220
+ }
221
+ async function detectInstalledAgents() {
222
+ const installed = [];
223
+ for (const [type, config] of Object.entries(agents)) {
224
+ if (await config.detectInstalled()) {
225
+ installed.push(type);
226
+ }
227
+ }
228
+ return installed;
229
+ }
230
+
231
+ // src/source-parser.ts
232
+ function isUrl(input) {
233
+ return input.startsWith("http://") || input.startsWith("https://");
234
+ }
235
+ function isCommand(input) {
236
+ if (input.includes(" ")) {
237
+ return true;
238
+ }
239
+ if (input.startsWith("npx ") || input.startsWith("node ") || input.startsWith("python ")) {
240
+ return true;
241
+ }
242
+ return false;
243
+ }
244
+ function isPackageName(input) {
245
+ if (input.startsWith("@") && input.includes("/")) {
246
+ return true;
247
+ }
248
+ if (/^[a-z0-9][\w.-]*(@[\w.-]+)?$/i.test(input)) {
249
+ return true;
250
+ }
251
+ return false;
252
+ }
253
+ function inferName(input, type) {
254
+ if (type === "remote") {
255
+ try {
256
+ const url = new URL(input);
257
+ return url.hostname.replace(/\./g, "-");
258
+ } catch {
259
+ return "mcp-server";
260
+ }
261
+ }
262
+ if (type === "command") {
263
+ const parts = input.split(" ");
264
+ let startIndex = 0;
265
+ if (parts[0] === "npx" || parts[0] === "node" || parts[0] === "python") {
266
+ startIndex = 1;
267
+ }
268
+ for (let i = startIndex; i < parts.length; i++) {
269
+ const part = parts[i];
270
+ if (part && !part.startsWith("-")) {
271
+ return extractPackageName(part);
272
+ }
273
+ }
274
+ return "mcp-server";
275
+ }
276
+ return extractPackageName(input);
277
+ }
278
+ function extractPackageName(input) {
279
+ let name = input;
280
+ const atIndex = name.lastIndexOf("@");
281
+ if (atIndex > 0 && !name.startsWith("@")) {
282
+ name = name.slice(0, atIndex);
283
+ } else if (name.startsWith("@") && name.indexOf("@", 1) > 0) {
284
+ const secondAt = name.indexOf("@", 1);
285
+ name = name.slice(0, secondAt);
286
+ }
287
+ if (name.startsWith("@") && name.includes("/")) {
288
+ const parts = name.split("/");
289
+ name = parts[1] || name;
290
+ }
291
+ name = name.replace(/^mcp-server-/, "");
292
+ name = name.replace(/^server-/, "");
293
+ name = name.replace(/-mcp$/, "");
294
+ return name || "mcp-server";
295
+ }
296
+ function parseSource(input) {
297
+ const trimmed = input.trim();
298
+ if (isUrl(trimmed)) {
299
+ return {
300
+ type: "remote",
301
+ value: trimmed,
302
+ inferredName: inferName(trimmed, "remote")
303
+ };
304
+ }
305
+ if (isCommand(trimmed)) {
306
+ return {
307
+ type: "command",
308
+ value: trimmed,
309
+ inferredName: inferName(trimmed, "command")
310
+ };
311
+ }
312
+ if (isPackageName(trimmed)) {
313
+ return {
314
+ type: "package",
315
+ value: trimmed,
316
+ inferredName: inferName(trimmed, "package")
317
+ };
318
+ }
319
+ return {
320
+ type: "package",
321
+ value: trimmed,
322
+ inferredName: inferName(trimmed, "package")
323
+ };
324
+ }
325
+ function isRemoteSource(parsed) {
326
+ return parsed.type === "remote";
327
+ }
328
+
329
+ // src/installer.ts
330
+ import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "fs";
331
+ import { join as join2, dirname as dirname4 } from "path";
332
+
333
+ // src/formats/json.ts
334
+ import { readFileSync, writeFileSync, existsSync as existsSync2, mkdirSync } from "fs";
335
+ import { dirname } from "path";
336
+ import * as jsonc from "jsonc-parser";
337
+ function detectIndent(text) {
338
+ let result = null;
339
+ jsonc.visit(text, {
340
+ onObjectProperty: (_property, offset, _length, startLine, startCharacter) => {
341
+ if (result === null && startLine > 0 && startCharacter > 0) {
342
+ const lineStart = text.lastIndexOf("\n", offset - 1) + 1;
343
+ const whitespace = text.slice(lineStart, offset);
344
+ result = {
345
+ tabSize: startCharacter,
346
+ insertSpaces: !whitespace.includes(" ")
347
+ };
348
+ }
349
+ }
350
+ });
351
+ return result || { tabSize: 2, insertSpaces: true };
352
+ }
353
+ function writeJsonConfig(filePath, config, configKey) {
354
+ const dir = dirname(filePath);
355
+ if (!existsSync2(dir)) {
356
+ mkdirSync(dir, { recursive: true });
357
+ }
358
+ let originalContent = "";
359
+ let existingConfig = {};
360
+ if (existsSync2(filePath)) {
361
+ originalContent = readFileSync(filePath, "utf-8");
362
+ existingConfig = jsonc.parse(originalContent);
363
+ }
364
+ const mergedConfig = deepMerge(existingConfig, config);
365
+ if (originalContent) {
366
+ try {
367
+ const configKeyPath = configKey.split(".");
368
+ const newValue = getNestedValue(mergedConfig, configKey);
369
+ const edits = jsonc.modify(originalContent, configKeyPath, newValue, {
370
+ formattingOptions: detectIndent(originalContent)
371
+ });
372
+ const updatedContent = jsonc.applyEdits(originalContent, edits);
373
+ writeFileSync(filePath, updatedContent);
374
+ return;
375
+ } catch {
376
+ }
377
+ }
378
+ writeFileSync(filePath, JSON.stringify(mergedConfig, null, 2));
379
+ }
380
+ function deepMerge(target, source) {
381
+ const result = { ...target };
382
+ for (const key in source) {
383
+ const sourceValue = source[key];
384
+ const targetValue = result[key];
385
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue)) {
386
+ result[key] = deepMerge(
387
+ targetValue && typeof targetValue === "object" ? targetValue : {},
388
+ sourceValue
389
+ );
390
+ } else {
391
+ result[key] = sourceValue;
392
+ }
393
+ }
394
+ return result;
395
+ }
396
+ function getNestedValue(obj, path) {
397
+ const keys = path.split(".");
398
+ let current = obj;
399
+ for (const key of keys) {
400
+ if (current && typeof current === "object" && key in current) {
401
+ current = current[key];
402
+ } else {
403
+ return void 0;
404
+ }
405
+ }
406
+ return current;
407
+ }
408
+ function setNestedValue(obj, path, value) {
409
+ const keys = path.split(".");
410
+ const lastKey = keys.pop();
411
+ if (!lastKey) return;
412
+ let current = obj;
413
+ for (const key of keys) {
414
+ if (!current[key] || typeof current[key] !== "object") {
415
+ current[key] = {};
416
+ }
417
+ current = current[key];
418
+ }
419
+ current[lastKey] = value;
420
+ }
421
+
422
+ // src/formats/yaml.ts
423
+ import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
424
+ import { dirname as dirname2 } from "path";
425
+ import yaml from "js-yaml";
426
+ function readYamlConfig(filePath) {
427
+ if (!existsSync3(filePath)) {
428
+ return {};
429
+ }
430
+ const content = readFileSync2(filePath, "utf-8");
431
+ const parsed = yaml.load(content);
432
+ return parsed || {};
433
+ }
434
+ function writeYamlConfig(filePath, config) {
435
+ const dir = dirname2(filePath);
436
+ if (!existsSync3(dir)) {
437
+ mkdirSync2(dir, { recursive: true });
438
+ }
439
+ let existingConfig = {};
440
+ if (existsSync3(filePath)) {
441
+ existingConfig = readYamlConfig(filePath);
442
+ }
443
+ const mergedConfig = deepMerge2(existingConfig, config);
444
+ const content = yaml.dump(mergedConfig, {
445
+ indent: 2,
446
+ lineWidth: -1,
447
+ noRefs: true
448
+ });
449
+ writeFileSync2(filePath, content);
450
+ }
451
+ function deepMerge2(target, source) {
452
+ const result = { ...target };
453
+ for (const key in source) {
454
+ const sourceValue = source[key];
455
+ const targetValue = result[key];
456
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue)) {
457
+ result[key] = deepMerge2(
458
+ targetValue && typeof targetValue === "object" ? targetValue : {},
459
+ sourceValue
460
+ );
461
+ } else {
462
+ result[key] = sourceValue;
463
+ }
464
+ }
465
+ return result;
466
+ }
467
+
468
+ // src/formats/toml.ts
469
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
470
+ import { dirname as dirname3 } from "path";
471
+ import * as TOML from "@iarna/toml";
472
+ function readTomlConfig(filePath) {
473
+ if (!existsSync4(filePath)) {
474
+ return {};
475
+ }
476
+ const content = readFileSync3(filePath, "utf-8");
477
+ const parsed = TOML.parse(content);
478
+ return parsed;
479
+ }
480
+ function writeTomlConfig(filePath, config) {
481
+ const dir = dirname3(filePath);
482
+ if (!existsSync4(dir)) {
483
+ mkdirSync3(dir, { recursive: true });
484
+ }
485
+ let existingConfig = {};
486
+ if (existsSync4(filePath)) {
487
+ existingConfig = readTomlConfig(filePath);
488
+ }
489
+ const mergedConfig = deepMerge3(existingConfig, config);
490
+ const content = TOML.stringify(mergedConfig);
491
+ writeFileSync3(filePath, content);
492
+ }
493
+ function deepMerge3(target, source) {
494
+ const result = { ...target };
495
+ for (const key in source) {
496
+ const sourceValue = source[key];
497
+ const targetValue = result[key];
498
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue)) {
499
+ result[key] = deepMerge3(
500
+ targetValue && typeof targetValue === "object" ? targetValue : {},
501
+ sourceValue
502
+ );
503
+ } else {
504
+ result[key] = sourceValue;
505
+ }
506
+ }
507
+ return result;
508
+ }
509
+
510
+ // src/formats/index.ts
511
+ function writeConfig(filePath, config, format, configKey) {
512
+ switch (format) {
513
+ case "json":
514
+ writeJsonConfig(filePath, config, configKey);
515
+ break;
516
+ case "yaml":
517
+ writeYamlConfig(filePath, config);
518
+ break;
519
+ case "toml":
520
+ writeTomlConfig(filePath, config);
521
+ break;
522
+ default:
523
+ throw new Error(`Unsupported config format: ${format}`);
524
+ }
525
+ }
526
+ function buildConfigWithKey(configKey, serverName, serverConfig) {
527
+ const config = {};
528
+ const servers = {};
529
+ servers[serverName] = serverConfig;
530
+ setNestedValue(config, configKey, servers);
531
+ return config;
532
+ }
533
+
534
+ // src/installer.ts
535
+ function buildServerConfig(parsed) {
536
+ if (parsed.type === "remote") {
537
+ return {
538
+ type: "http",
539
+ url: parsed.value
540
+ };
541
+ }
542
+ if (parsed.type === "command") {
543
+ const parts = parsed.value.split(" ");
544
+ const command = parts[0];
545
+ const args = parts.slice(1);
546
+ return {
547
+ command,
548
+ args
549
+ };
550
+ }
551
+ return {
552
+ command: "npx",
553
+ args: ["-y", parsed.value]
554
+ };
555
+ }
556
+ function getConfigPath(agent, options = {}) {
557
+ if (options.local && agent.localConfigPath) {
558
+ const cwd = options.cwd || process.cwd();
559
+ return join2(cwd, agent.localConfigPath);
560
+ }
561
+ return agent.configPath;
562
+ }
563
+ function installServerForAgent(serverName, serverConfig, agentType, options = {}) {
564
+ const agent = agents[agentType];
565
+ const configPath = getConfigPath(agent, options);
566
+ try {
567
+ const dir = dirname4(configPath);
568
+ if (!existsSync5(dir)) {
569
+ mkdirSync4(dir, { recursive: true });
570
+ }
571
+ const transformedConfig = agent.transformConfig ? agent.transformConfig(serverName, serverConfig) : serverConfig;
572
+ const config = buildConfigWithKey(
573
+ agent.configKey,
574
+ serverName,
575
+ transformedConfig
576
+ );
577
+ writeConfig(configPath, config, agent.format, agent.configKey);
578
+ return {
579
+ success: true,
580
+ path: configPath
581
+ };
582
+ } catch (error) {
583
+ return {
584
+ success: false,
585
+ path: configPath,
586
+ error: error instanceof Error ? error.message : "Unknown error"
587
+ };
588
+ }
589
+ }
590
+ function installServer(serverName, serverConfig, agentTypes, options = {}) {
591
+ const results = /* @__PURE__ */ new Map();
592
+ for (const agentType of agentTypes) {
593
+ const result = installServerForAgent(
594
+ serverName,
595
+ serverConfig,
596
+ agentType,
597
+ options
598
+ );
599
+ results.set(agentType, result);
600
+ }
601
+ return results;
602
+ }
603
+ function getAgentsWithLocalSupport() {
604
+ return Object.entries(agents).filter(([_, config]) => config.localConfigPath !== void 0).map(([type, _]) => type);
605
+ }
606
+
607
+ // package.json
608
+ var package_default = {
609
+ name: "add-mcp",
610
+ version: "0.1.0",
611
+ description: "Install MCP servers onto coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex)",
612
+ author: "Andre Landgraf <andre@neon.tech>",
613
+ license: "Apache-2.0",
614
+ type: "module",
615
+ bin: {
616
+ "add-mcp": "./dist/index.js"
617
+ },
618
+ files: [
619
+ "dist",
620
+ "README.md"
621
+ ],
622
+ scripts: {
623
+ fmt: "prettier --write .",
624
+ build: "tsup src/index.ts --format esm --dts --clean",
625
+ dev: "tsx src/index.ts",
626
+ test: "tsx tests/source-parser.test.ts && tsx tests/installer.test.ts && tsx tests/e2e/install.test.ts",
627
+ "test:unit": "tsx tests/source-parser.test.ts && tsx tests/installer.test.ts",
628
+ "test:e2e": "tsx tests/e2e/install.test.ts",
629
+ typecheck: "tsc --noEmit",
630
+ prepublishOnly: "npm run build"
631
+ },
632
+ keywords: [
633
+ "cli",
634
+ "mcp",
635
+ "model-context-protocol",
636
+ "ai-agents",
637
+ "claude-code",
638
+ "claude-desktop",
639
+ "codex",
640
+ "cursor",
641
+ "gemini-cli",
642
+ "goose",
643
+ "opencode",
644
+ "vscode",
645
+ "zed"
646
+ ],
647
+ repository: {
648
+ type: "git",
649
+ url: "git+https://github.com/neondatabase/add-mcp.git"
650
+ },
651
+ homepage: "https://github.com/neondatabase/add-mcp#readme",
652
+ bugs: {
653
+ url: "https://github.com/neondatabase/add-mcp/issues"
654
+ },
655
+ dependencies: {
656
+ "@clack/prompts": "^0.9.1",
657
+ "@iarna/toml": "^2.2.5",
658
+ chalk: "^5.4.1",
659
+ commander: "^13.1.0",
660
+ "js-yaml": "^4.1.0",
661
+ "jsonc-parser": "^3.3.1"
662
+ },
663
+ devDependencies: {
664
+ "@types/js-yaml": "^4.0.9",
665
+ "@types/node": "^22.10.0",
666
+ prettier: "^3.8.1",
667
+ tsup: "^8.3.5",
668
+ tsx: "^4.19.2",
669
+ typescript: "^5.7.2"
670
+ },
671
+ engines: {
672
+ node: ">=18"
673
+ }
674
+ };
675
+
676
+ // src/index.ts
677
+ var version = package_default.version;
678
+ function shortenPath(fullPath) {
679
+ const home2 = homedir2();
680
+ if (fullPath.startsWith(home2)) {
681
+ return fullPath.replace(home2, "~");
682
+ }
683
+ return fullPath;
684
+ }
685
+ function resolveAgentType(input) {
686
+ const lower = input.toLowerCase();
687
+ if (lower in agents) {
688
+ return lower;
689
+ }
690
+ if (lower in agentAliases) {
691
+ return agentAliases[lower];
692
+ }
693
+ return null;
694
+ }
695
+ program.name("add-mcp").description(
696
+ "Install MCP servers onto coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex)"
697
+ ).version(version).argument("[target]", "MCP server URL (remote) or package name (local stdio)").option(
698
+ "-g, --global",
699
+ "Install globally (user-level) instead of project-level"
700
+ ).option("-a, --agent <agents...>", "Specify agents to install to").option(
701
+ "-n, --name <name>",
702
+ "Server name (auto-inferred from target if not provided)"
703
+ ).option("-y, --yes", "Skip confirmation prompts").option("-l, --list", "List supported agents").option("--all", "Install to all agents without prompts (implies -y -g)").action(async (target, options) => {
704
+ await main(target, options);
705
+ });
706
+ program.parse();
707
+ async function main(target, options) {
708
+ if (options.all) {
709
+ options.yes = true;
710
+ options.global = true;
711
+ }
712
+ console.log();
713
+ p.intro(chalk.bgCyan.black(" add-mcp "));
714
+ if (options.list) {
715
+ console.log();
716
+ p.log.step(chalk.bold("Supported Agents"));
717
+ const allTypes = getAgentTypes();
718
+ for (const type of allTypes) {
719
+ const agent = agents[type];
720
+ const hasLocal = agent.localConfigPath ? chalk.dim(" (supports local)") : "";
721
+ p.log.message(` ${chalk.cyan(type)} - ${agent.displayName}${hasLocal}`);
722
+ }
723
+ console.log();
724
+ p.log.info(chalk.dim("Aliases: github-copilot \u2192 vscode"));
725
+ console.log();
726
+ p.outro("Use -a/--agent to specify agents");
727
+ return;
728
+ }
729
+ if (!target) {
730
+ p.log.error("Missing required argument: target");
731
+ console.log();
732
+ p.log.info(chalk.dim("Usage:"));
733
+ p.log.message(
734
+ ` ${chalk.cyan("npx add-mcp")} ${chalk.yellow("<target>")} ${chalk.dim("[options]")}`
735
+ );
736
+ console.log();
737
+ p.log.info(chalk.dim("Examples:"));
738
+ p.log.message(
739
+ ` ${chalk.cyan("npx add-mcp")} ${chalk.yellow("https://mcp.example.com/api")}`
740
+ );
741
+ p.log.message(
742
+ ` ${chalk.cyan("npx add-mcp")} ${chalk.yellow("@modelcontextprotocol/server-postgres")}`
743
+ );
744
+ console.log();
745
+ p.outro(chalk.dim("Run --help for more information"));
746
+ process.exit(1);
747
+ }
748
+ const spinner2 = p.spinner();
749
+ spinner2.start("Parsing source...");
750
+ const parsed = parseSource(target);
751
+ const sourceType = isRemoteSource(parsed) ? "remote" : "local";
752
+ spinner2.stop(`Source: ${chalk.cyan(parsed.value)} (${sourceType})`);
753
+ const serverName = options.name || parsed.inferredName;
754
+ p.log.info(`Server name: ${chalk.cyan(serverName)}`);
755
+ const serverConfig = buildServerConfig(parsed);
756
+ let targetAgents;
757
+ const allAgentTypes = getAgentTypes();
758
+ if (options.agent && options.agent.length > 0) {
759
+ const resolved = [];
760
+ const invalid = [];
761
+ for (const input of options.agent) {
762
+ const agentType = resolveAgentType(input);
763
+ if (agentType) {
764
+ resolved.push(agentType);
765
+ } else {
766
+ invalid.push(input);
767
+ }
768
+ }
769
+ if (invalid.length > 0) {
770
+ p.log.error(`Invalid agents: ${invalid.join(", ")}`);
771
+ p.log.info(`Valid agents: ${allAgentTypes.join(", ")}`);
772
+ process.exit(1);
773
+ }
774
+ targetAgents = resolved;
775
+ } else if (options.all) {
776
+ targetAgents = allAgentTypes;
777
+ p.log.info(`Installing to all ${targetAgents.length} agents`);
778
+ } else {
779
+ spinner2.start("Detecting installed agents...");
780
+ const installedAgents = await detectInstalledAgents();
781
+ spinner2.stop(
782
+ `Detected ${installedAgents.length} agent${installedAgents.length !== 1 ? "s" : ""}`
783
+ );
784
+ if (installedAgents.length === 0) {
785
+ if (options.yes) {
786
+ targetAgents = allAgentTypes;
787
+ p.log.info("Installing to all agents (none detected)");
788
+ } else {
789
+ p.log.warn(
790
+ "No coding agents detected. You can still install MCP servers."
791
+ );
792
+ const allAgentChoices = allAgentTypes.map((type) => ({
793
+ value: type,
794
+ label: agents[type].displayName
795
+ }));
796
+ const selected = await p.multiselect({
797
+ message: "Select agents to install to",
798
+ options: allAgentChoices,
799
+ required: true
800
+ });
801
+ if (p.isCancel(selected)) {
802
+ p.cancel("Installation cancelled");
803
+ process.exit(0);
804
+ }
805
+ targetAgents = selected;
806
+ }
807
+ } else if (installedAgents.length === 1 || options.yes) {
808
+ targetAgents = installedAgents;
809
+ const agentNames = installedAgents.map((a) => chalk.cyan(agents[a].displayName)).join(", ");
810
+ p.log.info(`Installing to: ${agentNames}`);
811
+ } else {
812
+ const agentChoices = installedAgents.map((a) => ({
813
+ value: a,
814
+ label: agents[a].displayName,
815
+ hint: shortenPath(agents[a].configPath)
816
+ }));
817
+ const selected = await p.multiselect({
818
+ message: "Select agents to install to",
819
+ options: agentChoices,
820
+ required: true,
821
+ initialValues: installedAgents
822
+ });
823
+ if (p.isCancel(selected)) {
824
+ p.cancel("Installation cancelled");
825
+ process.exit(0);
826
+ }
827
+ targetAgents = selected;
828
+ }
829
+ }
830
+ let installGlobally = options.global ?? false;
831
+ if (options.global === void 0 && !options.yes) {
832
+ const localSupported = getAgentsWithLocalSupport();
833
+ const selectedWithLocal = targetAgents.filter(
834
+ (a) => localSupported.includes(a)
835
+ );
836
+ if (selectedWithLocal.length > 0) {
837
+ const scope = await p.select({
838
+ message: "Installation scope",
839
+ options: [
840
+ {
841
+ value: false,
842
+ label: "Project",
843
+ hint: "Install in current directory (committed with your project)"
844
+ },
845
+ {
846
+ value: true,
847
+ label: "Global",
848
+ hint: "Install in home directory (available across all projects)"
849
+ }
850
+ ]
851
+ });
852
+ if (p.isCancel(scope)) {
853
+ p.cancel("Installation cancelled");
854
+ process.exit(0);
855
+ }
856
+ installGlobally = scope;
857
+ } else {
858
+ installGlobally = true;
859
+ p.log.info("Selected agents only support global installation");
860
+ }
861
+ }
862
+ const summaryLines = [];
863
+ summaryLines.push(`${chalk.cyan("Server:")} ${serverName}`);
864
+ summaryLines.push(`${chalk.cyan("Type:")} ${sourceType}`);
865
+ summaryLines.push(
866
+ `${chalk.cyan("Scope:")} ${installGlobally ? "Global" : "Project"}`
867
+ );
868
+ summaryLines.push(
869
+ `${chalk.cyan("Agents:")} ${targetAgents.map((a) => agents[a].displayName).join(", ")}`
870
+ );
871
+ console.log();
872
+ p.note(summaryLines.join("\n"), "Installation Summary");
873
+ if (!options.yes) {
874
+ const confirmed = await p.confirm({
875
+ message: "Proceed with installation?"
876
+ });
877
+ if (p.isCancel(confirmed) || !confirmed) {
878
+ p.cancel("Installation cancelled");
879
+ process.exit(0);
880
+ }
881
+ }
882
+ spinner2.start("Installing MCP server...");
883
+ const results = installServer(serverName, serverConfig, targetAgents, {
884
+ local: !installGlobally
885
+ });
886
+ spinner2.stop("Installation complete");
887
+ console.log();
888
+ const successful = [...results.entries()].filter(([_, r]) => r.success);
889
+ const failed = [...results.entries()].filter(([_, r]) => !r.success);
890
+ if (successful.length > 0) {
891
+ const resultLines = [];
892
+ for (const [agentType, result] of successful) {
893
+ const agent = agents[agentType];
894
+ const shortPath = shortenPath(result.path);
895
+ resultLines.push(
896
+ `${chalk.green("\u2713")} ${agent.displayName}: ${chalk.dim(shortPath)}`
897
+ );
898
+ }
899
+ p.note(
900
+ resultLines.join("\n"),
901
+ chalk.green(
902
+ `Installed to ${successful.length} agent${successful.length !== 1 ? "s" : ""}`
903
+ )
904
+ );
905
+ }
906
+ if (failed.length > 0) {
907
+ console.log();
908
+ p.log.error(
909
+ chalk.red(
910
+ `Failed to install to ${failed.length} agent${failed.length !== 1 ? "s" : ""}`
911
+ )
912
+ );
913
+ for (const [agentType, result] of failed) {
914
+ const agent = agents[agentType];
915
+ p.log.message(
916
+ ` ${chalk.red("\u2717")} ${agent.displayName}: ${chalk.dim(result.error)}`
917
+ );
918
+ }
919
+ }
920
+ console.log();
921
+ p.outro(chalk.green("Done!"));
922
+ }
package/package.json CHANGED
@@ -1,15 +1,67 @@
1
1
  {
2
2
  "name": "add-mcp",
3
- "version": "0.0.1",
4
- "publishConfig": {
5
- "access": "public"
3
+ "version": "0.1.0",
4
+ "description": "Install MCP servers onto coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex)",
5
+ "author": "Andre Landgraf <andre@neon.tech>",
6
+ "license": "Apache-2.0",
7
+ "type": "module",
8
+ "bin": {
9
+ "add-mcp": "./dist/index.js"
6
10
  },
7
- "main": "index.js",
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
8
15
  "scripts": {
9
- "test": "echo \"Error: no test specified\" && exit 1"
16
+ "fmt": "prettier --write .",
17
+ "build": "tsup src/index.ts --format esm --dts --clean",
18
+ "dev": "tsx src/index.ts",
19
+ "test": "tsx tests/source-parser.test.ts && tsx tests/installer.test.ts && tsx tests/e2e/install.test.ts",
20
+ "test:unit": "tsx tests/source-parser.test.ts && tsx tests/installer.test.ts",
21
+ "test:e2e": "tsx tests/e2e/install.test.ts",
22
+ "typecheck": "tsc --noEmit",
23
+ "prepublishOnly": "npm run build"
10
24
  },
11
- "author": "",
12
- "license": "ISC",
13
- "description": "",
14
- "packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c"
25
+ "keywords": [
26
+ "cli",
27
+ "mcp",
28
+ "model-context-protocol",
29
+ "ai-agents",
30
+ "claude-code",
31
+ "claude-desktop",
32
+ "codex",
33
+ "cursor",
34
+ "gemini-cli",
35
+ "goose",
36
+ "opencode",
37
+ "vscode",
38
+ "zed"
39
+ ],
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/neondatabase/add-mcp.git"
43
+ },
44
+ "homepage": "https://github.com/neondatabase/add-mcp#readme",
45
+ "bugs": {
46
+ "url": "https://github.com/neondatabase/add-mcp/issues"
47
+ },
48
+ "dependencies": {
49
+ "@clack/prompts": "^0.9.1",
50
+ "@iarna/toml": "^2.2.5",
51
+ "chalk": "^5.4.1",
52
+ "commander": "^13.1.0",
53
+ "js-yaml": "^4.1.0",
54
+ "jsonc-parser": "^3.3.1"
55
+ },
56
+ "devDependencies": {
57
+ "@types/js-yaml": "^4.0.9",
58
+ "@types/node": "^22.10.0",
59
+ "prettier": "^3.8.1",
60
+ "tsup": "^8.3.5",
61
+ "tsx": "^4.19.2",
62
+ "typescript": "^5.7.2"
63
+ },
64
+ "engines": {
65
+ "node": ">=18"
66
+ }
15
67
  }
package/index.js DELETED
@@ -1 +0,0 @@
1
- console.log("Hello World");