add-mcp 0.0.1 → 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 +201 -0
- package/README.md +152 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +965 -0
- package/package.json +61 -9
- package/index.js +0 -1
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,152 @@
|
|
|
1
|
+
# add-mcp
|
|
2
|
+
|
|
3
|
+
Install MCP servers onto coding agents with a single command.
|
|
4
|
+
|
|
5
|
+
<!-- agent-list:start -->
|
|
6
|
+
|
|
7
|
+
Supports **OpenCode**, **Claude Code**, **Codex**, **Cursor**, and [5 more](#supported-agents).
|
|
8
|
+
|
|
9
|
+
<!-- agent-list:end -->
|
|
10
|
+
|
|
11
|
+
## Install an MCP Server
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx add-mcp https://mcp.example.com/sse
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Source Formats
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Remote MCP server (HTTP streamable - default)
|
|
21
|
+
npx add-mcp https://mcp.example.com/mcp
|
|
22
|
+
|
|
23
|
+
# Remote MCP server (SSE transport)
|
|
24
|
+
npx add-mcp https://mcp.example.com/sse --transport sse
|
|
25
|
+
|
|
26
|
+
# npm package (runs via npx)
|
|
27
|
+
npx add-mcp @modelcontextprotocol/server-postgres
|
|
28
|
+
|
|
29
|
+
# Full command with arguments
|
|
30
|
+
npx add-mcp "npx -y @org/mcp-server --flag value"
|
|
31
|
+
|
|
32
|
+
# Node.js script
|
|
33
|
+
npx add-mcp "node /path/to/server.js --port 3000"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Options
|
|
37
|
+
|
|
38
|
+
| Option | Description |
|
|
39
|
+
| ------------------------ | ------------------------------------------------------------------------ |
|
|
40
|
+
| `-g, --global` | Install to user directory instead of project |
|
|
41
|
+
| `-a, --agent <agent>` | Target specific agents (e.g., `cursor`, `claude-code`). Can be repeated. |
|
|
42
|
+
| `-t, --transport <type>` | Transport type for remote servers: `http` (default), `sse` |
|
|
43
|
+
| `--type <type>` | Alias for `--transport` |
|
|
44
|
+
| `-n, --name <name>` | Server name (auto-inferred if not provided) |
|
|
45
|
+
| `-y, --yes` | Skip all confirmation prompts |
|
|
46
|
+
| `--all` | Install to all agents without prompts |
|
|
47
|
+
|
|
48
|
+
### Examples
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Install to specific agents
|
|
52
|
+
npx add-mcp https://mcp.example.com/mcp -a cursor -a claude-code
|
|
53
|
+
|
|
54
|
+
# Install with SSE transport
|
|
55
|
+
npx add-mcp https://mcp.neon.tech/sse --transport sse
|
|
56
|
+
|
|
57
|
+
# Install with custom server name
|
|
58
|
+
npx add-mcp @modelcontextprotocol/server-postgres --name postgres
|
|
59
|
+
|
|
60
|
+
# Non-interactive installation (CI/CD friendly)
|
|
61
|
+
npx add-mcp https://mcp.example.com/mcp -g -a claude-code -y
|
|
62
|
+
|
|
63
|
+
# Install to all agents without prompts
|
|
64
|
+
npx add-mcp mcp-server-github --all
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Installation Scope
|
|
68
|
+
|
|
69
|
+
| Scope | Flag | Location | Use Case |
|
|
70
|
+
| ----------- | --------- | ----------------------- | --------------------------------------------- |
|
|
71
|
+
| **Project** | (default) | `.cursor/mcp.json` etc. | Committed with your project, shared with team |
|
|
72
|
+
| **Global** | `-g` | `~/.cursor/mcp.json` | Available across all projects |
|
|
73
|
+
|
|
74
|
+
## Transport Types
|
|
75
|
+
|
|
76
|
+
MCP supports different transport mechanisms for remote servers:
|
|
77
|
+
|
|
78
|
+
| Transport | Flag | Description |
|
|
79
|
+
| --------- | ------------------ | ---------------------------------------------- |
|
|
80
|
+
| **HTTP** | `--transport http` | Streamable HTTP (default, modern standard) |
|
|
81
|
+
| **SSE** | `--transport sse` | Server-Sent Events (legacy, still widely used) |
|
|
82
|
+
|
|
83
|
+
Local servers (npm packages, commands) always use **stdio** transport.
|
|
84
|
+
|
|
85
|
+
## Supported Agents
|
|
86
|
+
|
|
87
|
+
MCP servers can be installed to any of these agents:
|
|
88
|
+
|
|
89
|
+
<!-- supported-agents:start -->
|
|
90
|
+
|
|
91
|
+
| Agent | `--agent` | Project Path | Global Path |
|
|
92
|
+
| -------------- | ---------------- | ----------------------- | ----------------------------------------------------------------- |
|
|
93
|
+
| Claude Code | `claude-code` | `.mcp.json` | `~/.claude.json` |
|
|
94
|
+
| Claude Desktop | `claude-desktop` | - | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
95
|
+
| Codex | `codex` | - | `~/.codex/config.toml` |
|
|
96
|
+
| Cursor | `cursor` | `.cursor/mcp.json` | `~/.cursor/mcp.json` |
|
|
97
|
+
| Gemini CLI | `gemini-cli` | `.gemini/settings.json` | `~/.gemini/settings.json` |
|
|
98
|
+
| Goose | `goose` | - | `~/.config/goose/config.yaml` |
|
|
99
|
+
| OpenCode | `opencode` | `.opencode.json` | `~/.config/opencode/opencode.json` |
|
|
100
|
+
| VS Code | `vscode` | `.vscode/mcp.json` | `~/Library/Application Support/Code/User/mcp.json` |
|
|
101
|
+
| Zed | `zed` | - | `~/.config/zed/settings.json` |
|
|
102
|
+
|
|
103
|
+
<!-- supported-agents:end -->
|
|
104
|
+
|
|
105
|
+
**Aliases:** `github-copilot` → `vscode`
|
|
106
|
+
|
|
107
|
+
The CLI automatically detects which coding agents you have installed. If none are detected, you'll be prompted to select which agents to install to.
|
|
108
|
+
|
|
109
|
+
### Transport Support
|
|
110
|
+
|
|
111
|
+
Not all agents support all transport types:
|
|
112
|
+
|
|
113
|
+
| Agent | stdio | http | sse |
|
|
114
|
+
| -------------- | ----- | ---- | --- |
|
|
115
|
+
| Claude Code | ✓ | ✓ | ✓ |
|
|
116
|
+
| Claude Desktop | ✓ | ✓ | ✓ |
|
|
117
|
+
| Codex | ✓ | ✓ | ✓ |
|
|
118
|
+
| Cursor | ✓ | ✓ | ✓ |
|
|
119
|
+
| Gemini CLI | ✓ | ✓ | ✓ |
|
|
120
|
+
| Goose | ✓ | ✓ | ✗ |
|
|
121
|
+
| OpenCode | ✓ | ✓ | ✓ |
|
|
122
|
+
| VS Code | ✓ | ✓ | ✓ |
|
|
123
|
+
| Zed | ✓ | ✓ | ✓ |
|
|
124
|
+
|
|
125
|
+
## What are MCP Servers?
|
|
126
|
+
|
|
127
|
+
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers extend your coding agent's capabilities by providing tools, resources, and context. MCP servers can:
|
|
128
|
+
|
|
129
|
+
- Connect to databases (PostgreSQL, MySQL, etc.)
|
|
130
|
+
- Integrate with external services (GitHub, Linear, Notion)
|
|
131
|
+
- Provide file system access
|
|
132
|
+
- Offer specialized tools for your workflow
|
|
133
|
+
|
|
134
|
+
## Troubleshooting
|
|
135
|
+
|
|
136
|
+
### Transport mismatch error
|
|
137
|
+
|
|
138
|
+
If you get an error about transport not being supported, check that the agent supports your chosen transport type. For example, Goose doesn't support SSE transport.
|
|
139
|
+
|
|
140
|
+
### Server not loading
|
|
141
|
+
|
|
142
|
+
- Verify the server URL is correct and accessible
|
|
143
|
+
- Check the agent's MCP configuration file for syntax errors
|
|
144
|
+
- Ensure the server name doesn't conflict with existing servers
|
|
145
|
+
|
|
146
|
+
### Permission errors
|
|
147
|
+
|
|
148
|
+
Ensure you have write access to the target configuration directory.
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
Apache 2.0
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,965 @@
|
|
|
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
|
+
type: "streamable_http",
|
|
46
|
+
url: config.url,
|
|
47
|
+
enabled: true,
|
|
48
|
+
timeout: 300
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
name: serverName,
|
|
53
|
+
cmd: config.command,
|
|
54
|
+
args: config.args || [],
|
|
55
|
+
enabled: true,
|
|
56
|
+
envs: config.env || {},
|
|
57
|
+
type: "stdio",
|
|
58
|
+
timeout: 300
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function transformZedConfig(_serverName, config) {
|
|
62
|
+
if (config.url) {
|
|
63
|
+
return {
|
|
64
|
+
source: "custom",
|
|
65
|
+
type: config.type || "http",
|
|
66
|
+
url: config.url,
|
|
67
|
+
headers: config.headers || {}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
source: "custom",
|
|
72
|
+
command: config.command,
|
|
73
|
+
args: config.args || [],
|
|
74
|
+
env: config.env || {}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function transformOpenCodeConfig(_serverName, config) {
|
|
78
|
+
if (config.url) {
|
|
79
|
+
return {
|
|
80
|
+
type: "remote",
|
|
81
|
+
url: config.url,
|
|
82
|
+
enabled: true,
|
|
83
|
+
headers: config.headers
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
type: "local",
|
|
88
|
+
command: config.command,
|
|
89
|
+
args: config.args || [],
|
|
90
|
+
enabled: true,
|
|
91
|
+
environment: config.env || {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function transformCodexConfig(_serverName, config) {
|
|
95
|
+
if (config.url) {
|
|
96
|
+
return {
|
|
97
|
+
type: config.type || "http",
|
|
98
|
+
url: config.url,
|
|
99
|
+
headers: config.headers
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
command: config.command,
|
|
104
|
+
args: config.args || [],
|
|
105
|
+
env: config.env
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
var agents = {
|
|
109
|
+
"claude-code": {
|
|
110
|
+
name: "claude-code",
|
|
111
|
+
displayName: "Claude Code",
|
|
112
|
+
configPath: join(home, ".claude.json"),
|
|
113
|
+
localConfigPath: ".mcp.json",
|
|
114
|
+
configKey: "mcpServers",
|
|
115
|
+
format: "json",
|
|
116
|
+
supportedTransports: ["stdio", "http", "sse"],
|
|
117
|
+
detectInstalled: async () => {
|
|
118
|
+
return existsSync(join(home, ".claude"));
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"claude-desktop": {
|
|
122
|
+
name: "claude-desktop",
|
|
123
|
+
displayName: "Claude Desktop",
|
|
124
|
+
configPath: join(appSupport, "Claude", "claude_desktop_config.json"),
|
|
125
|
+
configKey: "mcpServers",
|
|
126
|
+
format: "json",
|
|
127
|
+
supportedTransports: ["stdio", "http", "sse"],
|
|
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
|
+
supportedTransports: ["stdio", "http", "sse"],
|
|
142
|
+
detectInstalled: async () => {
|
|
143
|
+
return existsSync(join(home, ".codex"));
|
|
144
|
+
},
|
|
145
|
+
transformConfig: transformCodexConfig
|
|
146
|
+
},
|
|
147
|
+
cursor: {
|
|
148
|
+
name: "cursor",
|
|
149
|
+
displayName: "Cursor",
|
|
150
|
+
configPath: join(home, ".cursor", "mcp.json"),
|
|
151
|
+
localConfigPath: ".cursor/mcp.json",
|
|
152
|
+
configKey: "mcpServers",
|
|
153
|
+
format: "json",
|
|
154
|
+
supportedTransports: ["stdio", "http", "sse"],
|
|
155
|
+
detectInstalled: async () => {
|
|
156
|
+
return existsSync(join(home, ".cursor"));
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"gemini-cli": {
|
|
160
|
+
name: "gemini-cli",
|
|
161
|
+
displayName: "Gemini CLI",
|
|
162
|
+
configPath: join(home, ".gemini", "settings.json"),
|
|
163
|
+
localConfigPath: ".gemini/settings.json",
|
|
164
|
+
configKey: "mcpServers",
|
|
165
|
+
format: "json",
|
|
166
|
+
supportedTransports: ["stdio", "http", "sse"],
|
|
167
|
+
detectInstalled: async () => {
|
|
168
|
+
return existsSync(join(home, ".gemini"));
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
goose: {
|
|
172
|
+
name: "goose",
|
|
173
|
+
displayName: "Goose",
|
|
174
|
+
configPath: join(home, ".config", "goose", "config.yaml"),
|
|
175
|
+
configKey: "extensions",
|
|
176
|
+
format: "yaml",
|
|
177
|
+
supportedTransports: ["stdio", "http"],
|
|
178
|
+
// Goose does not support SSE
|
|
179
|
+
detectInstalled: async () => {
|
|
180
|
+
return existsSync(join(home, ".config", "goose"));
|
|
181
|
+
},
|
|
182
|
+
transformConfig: transformGooseConfig
|
|
183
|
+
},
|
|
184
|
+
opencode: {
|
|
185
|
+
name: "opencode",
|
|
186
|
+
displayName: "OpenCode",
|
|
187
|
+
configPath: join(home, ".config", "opencode", "opencode.json"),
|
|
188
|
+
localConfigPath: ".opencode.json",
|
|
189
|
+
configKey: "mcp",
|
|
190
|
+
format: "json",
|
|
191
|
+
supportedTransports: ["stdio", "http", "sse"],
|
|
192
|
+
detectInstalled: async () => {
|
|
193
|
+
return existsSync(join(home, ".config", "opencode"));
|
|
194
|
+
},
|
|
195
|
+
transformConfig: transformOpenCodeConfig
|
|
196
|
+
},
|
|
197
|
+
vscode: {
|
|
198
|
+
name: "vscode",
|
|
199
|
+
displayName: "VS Code",
|
|
200
|
+
configPath: join(vscodePath, "mcp.json"),
|
|
201
|
+
localConfigPath: ".vscode/mcp.json",
|
|
202
|
+
configKey: "mcpServers",
|
|
203
|
+
format: "json",
|
|
204
|
+
supportedTransports: ["stdio", "http", "sse"],
|
|
205
|
+
detectInstalled: async () => {
|
|
206
|
+
return existsSync(vscodePath);
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
zed: {
|
|
210
|
+
name: "zed",
|
|
211
|
+
displayName: "Zed",
|
|
212
|
+
configPath: process.platform === "win32" ? join(
|
|
213
|
+
process.env.APPDATA || join(home, "AppData", "Roaming"),
|
|
214
|
+
"Zed",
|
|
215
|
+
"settings.json"
|
|
216
|
+
) : join(home, ".config", "zed", "settings.json"),
|
|
217
|
+
configKey: "context_servers",
|
|
218
|
+
format: "json",
|
|
219
|
+
supportedTransports: ["stdio", "http", "sse"],
|
|
220
|
+
detectInstalled: async () => {
|
|
221
|
+
return existsSync(join(home, ".config", "zed")) || existsSync(join(process.env.APPDATA || "", "Zed"));
|
|
222
|
+
},
|
|
223
|
+
transformConfig: transformZedConfig
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
function getAgentTypes() {
|
|
227
|
+
return Object.keys(agents);
|
|
228
|
+
}
|
|
229
|
+
async function detectInstalledAgents() {
|
|
230
|
+
const installed = [];
|
|
231
|
+
for (const [type, config] of Object.entries(agents)) {
|
|
232
|
+
if (await config.detectInstalled()) {
|
|
233
|
+
installed.push(type);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return installed;
|
|
237
|
+
}
|
|
238
|
+
function isTransportSupported(agentType, transport) {
|
|
239
|
+
return agents[agentType].supportedTransports.includes(transport);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// src/source-parser.ts
|
|
243
|
+
function isUrl(input) {
|
|
244
|
+
return input.startsWith("http://") || input.startsWith("https://");
|
|
245
|
+
}
|
|
246
|
+
function isCommand(input) {
|
|
247
|
+
if (input.includes(" ")) {
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
if (input.startsWith("npx ") || input.startsWith("node ") || input.startsWith("python ")) {
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
function isPackageName(input) {
|
|
256
|
+
if (input.startsWith("@") && input.includes("/")) {
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
if (/^[a-z0-9][\w.-]*(@[\w.-]+)?$/i.test(input)) {
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
function inferName(input, type) {
|
|
265
|
+
if (type === "remote") {
|
|
266
|
+
try {
|
|
267
|
+
const url = new URL(input);
|
|
268
|
+
return url.hostname.replace(/\./g, "-");
|
|
269
|
+
} catch {
|
|
270
|
+
return "mcp-server";
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (type === "command") {
|
|
274
|
+
const parts = input.split(" ");
|
|
275
|
+
let startIndex = 0;
|
|
276
|
+
if (parts[0] === "npx" || parts[0] === "node" || parts[0] === "python") {
|
|
277
|
+
startIndex = 1;
|
|
278
|
+
}
|
|
279
|
+
for (let i = startIndex; i < parts.length; i++) {
|
|
280
|
+
const part = parts[i];
|
|
281
|
+
if (part && !part.startsWith("-")) {
|
|
282
|
+
return extractPackageName(part);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return "mcp-server";
|
|
286
|
+
}
|
|
287
|
+
return extractPackageName(input);
|
|
288
|
+
}
|
|
289
|
+
function extractPackageName(input) {
|
|
290
|
+
let name = input;
|
|
291
|
+
const atIndex = name.lastIndexOf("@");
|
|
292
|
+
if (atIndex > 0 && !name.startsWith("@")) {
|
|
293
|
+
name = name.slice(0, atIndex);
|
|
294
|
+
} else if (name.startsWith("@") && name.indexOf("@", 1) > 0) {
|
|
295
|
+
const secondAt = name.indexOf("@", 1);
|
|
296
|
+
name = name.slice(0, secondAt);
|
|
297
|
+
}
|
|
298
|
+
if (name.startsWith("@") && name.includes("/")) {
|
|
299
|
+
const parts = name.split("/");
|
|
300
|
+
name = parts[1] || name;
|
|
301
|
+
}
|
|
302
|
+
name = name.replace(/^mcp-server-/, "");
|
|
303
|
+
name = name.replace(/^server-/, "");
|
|
304
|
+
name = name.replace(/-mcp$/, "");
|
|
305
|
+
return name || "mcp-server";
|
|
306
|
+
}
|
|
307
|
+
function parseSource(input) {
|
|
308
|
+
const trimmed = input.trim();
|
|
309
|
+
if (isUrl(trimmed)) {
|
|
310
|
+
return {
|
|
311
|
+
type: "remote",
|
|
312
|
+
value: trimmed,
|
|
313
|
+
inferredName: inferName(trimmed, "remote")
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
if (isCommand(trimmed)) {
|
|
317
|
+
return {
|
|
318
|
+
type: "command",
|
|
319
|
+
value: trimmed,
|
|
320
|
+
inferredName: inferName(trimmed, "command")
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
if (isPackageName(trimmed)) {
|
|
324
|
+
return {
|
|
325
|
+
type: "package",
|
|
326
|
+
value: trimmed,
|
|
327
|
+
inferredName: inferName(trimmed, "package")
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
return {
|
|
331
|
+
type: "package",
|
|
332
|
+
value: trimmed,
|
|
333
|
+
inferredName: inferName(trimmed, "package")
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function isRemoteSource(parsed) {
|
|
337
|
+
return parsed.type === "remote";
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// src/installer.ts
|
|
341
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "fs";
|
|
342
|
+
import { join as join2, dirname as dirname4 } from "path";
|
|
343
|
+
|
|
344
|
+
// src/formats/json.ts
|
|
345
|
+
import { readFileSync, writeFileSync, existsSync as existsSync2, mkdirSync } from "fs";
|
|
346
|
+
import { dirname } from "path";
|
|
347
|
+
import * as jsonc from "jsonc-parser";
|
|
348
|
+
function detectIndent(text) {
|
|
349
|
+
let result = null;
|
|
350
|
+
jsonc.visit(text, {
|
|
351
|
+
onObjectProperty: (_property, offset, _length, startLine, startCharacter) => {
|
|
352
|
+
if (result === null && startLine > 0 && startCharacter > 0) {
|
|
353
|
+
const lineStart = text.lastIndexOf("\n", offset - 1) + 1;
|
|
354
|
+
const whitespace = text.slice(lineStart, offset);
|
|
355
|
+
result = {
|
|
356
|
+
tabSize: startCharacter,
|
|
357
|
+
insertSpaces: !whitespace.includes(" ")
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
return result || { tabSize: 2, insertSpaces: true };
|
|
363
|
+
}
|
|
364
|
+
function writeJsonConfig(filePath, config, configKey) {
|
|
365
|
+
const dir = dirname(filePath);
|
|
366
|
+
if (!existsSync2(dir)) {
|
|
367
|
+
mkdirSync(dir, { recursive: true });
|
|
368
|
+
}
|
|
369
|
+
let originalContent = "";
|
|
370
|
+
let existingConfig = {};
|
|
371
|
+
if (existsSync2(filePath)) {
|
|
372
|
+
originalContent = readFileSync(filePath, "utf-8");
|
|
373
|
+
existingConfig = jsonc.parse(originalContent);
|
|
374
|
+
}
|
|
375
|
+
const mergedConfig = deepMerge(existingConfig, config);
|
|
376
|
+
if (originalContent) {
|
|
377
|
+
try {
|
|
378
|
+
const configKeyPath = configKey.split(".");
|
|
379
|
+
const newValue = getNestedValue(mergedConfig, configKey);
|
|
380
|
+
const edits = jsonc.modify(originalContent, configKeyPath, newValue, {
|
|
381
|
+
formattingOptions: detectIndent(originalContent)
|
|
382
|
+
});
|
|
383
|
+
const updatedContent = jsonc.applyEdits(originalContent, edits);
|
|
384
|
+
writeFileSync(filePath, updatedContent);
|
|
385
|
+
return;
|
|
386
|
+
} catch {
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
writeFileSync(filePath, JSON.stringify(mergedConfig, null, 2));
|
|
390
|
+
}
|
|
391
|
+
function deepMerge(target, source) {
|
|
392
|
+
const result = { ...target };
|
|
393
|
+
for (const key in source) {
|
|
394
|
+
const sourceValue = source[key];
|
|
395
|
+
const targetValue = result[key];
|
|
396
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue)) {
|
|
397
|
+
result[key] = deepMerge(
|
|
398
|
+
targetValue && typeof targetValue === "object" ? targetValue : {},
|
|
399
|
+
sourceValue
|
|
400
|
+
);
|
|
401
|
+
} else {
|
|
402
|
+
result[key] = sourceValue;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return result;
|
|
406
|
+
}
|
|
407
|
+
function getNestedValue(obj, path) {
|
|
408
|
+
const keys = path.split(".");
|
|
409
|
+
let current = obj;
|
|
410
|
+
for (const key of keys) {
|
|
411
|
+
if (current && typeof current === "object" && key in current) {
|
|
412
|
+
current = current[key];
|
|
413
|
+
} else {
|
|
414
|
+
return void 0;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return current;
|
|
418
|
+
}
|
|
419
|
+
function setNestedValue(obj, path, value) {
|
|
420
|
+
const keys = path.split(".");
|
|
421
|
+
const lastKey = keys.pop();
|
|
422
|
+
if (!lastKey) return;
|
|
423
|
+
let current = obj;
|
|
424
|
+
for (const key of keys) {
|
|
425
|
+
if (!current[key] || typeof current[key] !== "object") {
|
|
426
|
+
current[key] = {};
|
|
427
|
+
}
|
|
428
|
+
current = current[key];
|
|
429
|
+
}
|
|
430
|
+
current[lastKey] = value;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// src/formats/yaml.ts
|
|
434
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
435
|
+
import { dirname as dirname2 } from "path";
|
|
436
|
+
import yaml from "js-yaml";
|
|
437
|
+
function readYamlConfig(filePath) {
|
|
438
|
+
if (!existsSync3(filePath)) {
|
|
439
|
+
return {};
|
|
440
|
+
}
|
|
441
|
+
const content = readFileSync2(filePath, "utf-8");
|
|
442
|
+
const parsed = yaml.load(content);
|
|
443
|
+
return parsed || {};
|
|
444
|
+
}
|
|
445
|
+
function writeYamlConfig(filePath, config) {
|
|
446
|
+
const dir = dirname2(filePath);
|
|
447
|
+
if (!existsSync3(dir)) {
|
|
448
|
+
mkdirSync2(dir, { recursive: true });
|
|
449
|
+
}
|
|
450
|
+
let existingConfig = {};
|
|
451
|
+
if (existsSync3(filePath)) {
|
|
452
|
+
existingConfig = readYamlConfig(filePath);
|
|
453
|
+
}
|
|
454
|
+
const mergedConfig = deepMerge2(existingConfig, config);
|
|
455
|
+
const content = yaml.dump(mergedConfig, {
|
|
456
|
+
indent: 2,
|
|
457
|
+
lineWidth: -1,
|
|
458
|
+
noRefs: true
|
|
459
|
+
});
|
|
460
|
+
writeFileSync2(filePath, content);
|
|
461
|
+
}
|
|
462
|
+
function deepMerge2(target, source) {
|
|
463
|
+
const result = { ...target };
|
|
464
|
+
for (const key in source) {
|
|
465
|
+
const sourceValue = source[key];
|
|
466
|
+
const targetValue = result[key];
|
|
467
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue)) {
|
|
468
|
+
result[key] = deepMerge2(
|
|
469
|
+
targetValue && typeof targetValue === "object" ? targetValue : {},
|
|
470
|
+
sourceValue
|
|
471
|
+
);
|
|
472
|
+
} else {
|
|
473
|
+
result[key] = sourceValue;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return result;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// src/formats/toml.ts
|
|
480
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
|
|
481
|
+
import { dirname as dirname3 } from "path";
|
|
482
|
+
import * as TOML from "@iarna/toml";
|
|
483
|
+
function readTomlConfig(filePath) {
|
|
484
|
+
if (!existsSync4(filePath)) {
|
|
485
|
+
return {};
|
|
486
|
+
}
|
|
487
|
+
const content = readFileSync3(filePath, "utf-8");
|
|
488
|
+
const parsed = TOML.parse(content);
|
|
489
|
+
return parsed;
|
|
490
|
+
}
|
|
491
|
+
function writeTomlConfig(filePath, config) {
|
|
492
|
+
const dir = dirname3(filePath);
|
|
493
|
+
if (!existsSync4(dir)) {
|
|
494
|
+
mkdirSync3(dir, { recursive: true });
|
|
495
|
+
}
|
|
496
|
+
let existingConfig = {};
|
|
497
|
+
if (existsSync4(filePath)) {
|
|
498
|
+
existingConfig = readTomlConfig(filePath);
|
|
499
|
+
}
|
|
500
|
+
const mergedConfig = deepMerge3(existingConfig, config);
|
|
501
|
+
const content = TOML.stringify(mergedConfig);
|
|
502
|
+
writeFileSync3(filePath, content);
|
|
503
|
+
}
|
|
504
|
+
function deepMerge3(target, source) {
|
|
505
|
+
const result = { ...target };
|
|
506
|
+
for (const key in source) {
|
|
507
|
+
const sourceValue = source[key];
|
|
508
|
+
const targetValue = result[key];
|
|
509
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue)) {
|
|
510
|
+
result[key] = deepMerge3(
|
|
511
|
+
targetValue && typeof targetValue === "object" ? targetValue : {},
|
|
512
|
+
sourceValue
|
|
513
|
+
);
|
|
514
|
+
} else {
|
|
515
|
+
result[key] = sourceValue;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
return result;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// src/formats/index.ts
|
|
522
|
+
function writeConfig(filePath, config, format, configKey) {
|
|
523
|
+
switch (format) {
|
|
524
|
+
case "json":
|
|
525
|
+
writeJsonConfig(filePath, config, configKey);
|
|
526
|
+
break;
|
|
527
|
+
case "yaml":
|
|
528
|
+
writeYamlConfig(filePath, config);
|
|
529
|
+
break;
|
|
530
|
+
case "toml":
|
|
531
|
+
writeTomlConfig(filePath, config);
|
|
532
|
+
break;
|
|
533
|
+
default:
|
|
534
|
+
throw new Error(`Unsupported config format: ${format}`);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
function buildConfigWithKey(configKey, serverName, serverConfig) {
|
|
538
|
+
const config = {};
|
|
539
|
+
const servers = {};
|
|
540
|
+
servers[serverName] = serverConfig;
|
|
541
|
+
setNestedValue(config, configKey, servers);
|
|
542
|
+
return config;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// src/installer.ts
|
|
546
|
+
function buildServerConfig(parsed, options = {}) {
|
|
547
|
+
if (parsed.type === "remote") {
|
|
548
|
+
return {
|
|
549
|
+
type: options.transport ?? "http",
|
|
550
|
+
url: parsed.value
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
if (parsed.type === "command") {
|
|
554
|
+
const parts = parsed.value.split(" ");
|
|
555
|
+
const command = parts[0];
|
|
556
|
+
const args = parts.slice(1);
|
|
557
|
+
return {
|
|
558
|
+
command,
|
|
559
|
+
args
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
return {
|
|
563
|
+
command: "npx",
|
|
564
|
+
args: ["-y", parsed.value]
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
function getConfigPath(agent, options = {}) {
|
|
568
|
+
if (options.local && agent.localConfigPath) {
|
|
569
|
+
const cwd = options.cwd || process.cwd();
|
|
570
|
+
return join2(cwd, agent.localConfigPath);
|
|
571
|
+
}
|
|
572
|
+
return agent.configPath;
|
|
573
|
+
}
|
|
574
|
+
function installServerForAgent(serverName, serverConfig, agentType, options = {}) {
|
|
575
|
+
const agent = agents[agentType];
|
|
576
|
+
const configPath = getConfigPath(agent, options);
|
|
577
|
+
try {
|
|
578
|
+
const dir = dirname4(configPath);
|
|
579
|
+
if (!existsSync5(dir)) {
|
|
580
|
+
mkdirSync4(dir, { recursive: true });
|
|
581
|
+
}
|
|
582
|
+
const transformedConfig = agent.transformConfig ? agent.transformConfig(serverName, serverConfig) : serverConfig;
|
|
583
|
+
const config = buildConfigWithKey(
|
|
584
|
+
agent.configKey,
|
|
585
|
+
serverName,
|
|
586
|
+
transformedConfig
|
|
587
|
+
);
|
|
588
|
+
writeConfig(configPath, config, agent.format, agent.configKey);
|
|
589
|
+
return {
|
|
590
|
+
success: true,
|
|
591
|
+
path: configPath
|
|
592
|
+
};
|
|
593
|
+
} catch (error) {
|
|
594
|
+
return {
|
|
595
|
+
success: false,
|
|
596
|
+
path: configPath,
|
|
597
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
function installServer(serverName, serverConfig, agentTypes, options = {}) {
|
|
602
|
+
const results = /* @__PURE__ */ new Map();
|
|
603
|
+
for (const agentType of agentTypes) {
|
|
604
|
+
const result = installServerForAgent(
|
|
605
|
+
serverName,
|
|
606
|
+
serverConfig,
|
|
607
|
+
agentType,
|
|
608
|
+
options
|
|
609
|
+
);
|
|
610
|
+
results.set(agentType, result);
|
|
611
|
+
}
|
|
612
|
+
return results;
|
|
613
|
+
}
|
|
614
|
+
function getAgentsWithLocalSupport() {
|
|
615
|
+
return Object.entries(agents).filter(([_, config]) => config.localConfigPath !== void 0).map(([type, _]) => type);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// package.json
|
|
619
|
+
var package_default = {
|
|
620
|
+
name: "add-mcp",
|
|
621
|
+
version: "0.1.1",
|
|
622
|
+
description: "Install MCP servers onto coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex)",
|
|
623
|
+
author: "Andre Landgraf <andre@neon.tech>",
|
|
624
|
+
license: "Apache-2.0",
|
|
625
|
+
type: "module",
|
|
626
|
+
bin: {
|
|
627
|
+
"add-mcp": "./dist/index.js"
|
|
628
|
+
},
|
|
629
|
+
files: [
|
|
630
|
+
"dist",
|
|
631
|
+
"README.md"
|
|
632
|
+
],
|
|
633
|
+
scripts: {
|
|
634
|
+
fmt: "prettier --write .",
|
|
635
|
+
build: "tsup src/index.ts --format esm --dts --clean",
|
|
636
|
+
dev: "tsx src/index.ts",
|
|
637
|
+
test: "tsx tests/source-parser.test.ts && tsx tests/installer.test.ts && tsx tests/e2e/install.test.ts",
|
|
638
|
+
"test:unit": "tsx tests/source-parser.test.ts && tsx tests/installer.test.ts",
|
|
639
|
+
"test:e2e": "tsx tests/e2e/install.test.ts",
|
|
640
|
+
typecheck: "tsc --noEmit",
|
|
641
|
+
prepublishOnly: "npm run build"
|
|
642
|
+
},
|
|
643
|
+
keywords: [
|
|
644
|
+
"cli",
|
|
645
|
+
"mcp",
|
|
646
|
+
"model-context-protocol",
|
|
647
|
+
"ai-agents",
|
|
648
|
+
"claude-code",
|
|
649
|
+
"claude-desktop",
|
|
650
|
+
"codex",
|
|
651
|
+
"cursor",
|
|
652
|
+
"gemini-cli",
|
|
653
|
+
"goose",
|
|
654
|
+
"opencode",
|
|
655
|
+
"vscode",
|
|
656
|
+
"zed"
|
|
657
|
+
],
|
|
658
|
+
repository: {
|
|
659
|
+
type: "git",
|
|
660
|
+
url: "git+https://github.com/neondatabase/add-mcp.git"
|
|
661
|
+
},
|
|
662
|
+
homepage: "https://github.com/neondatabase/add-mcp#readme",
|
|
663
|
+
bugs: {
|
|
664
|
+
url: "https://github.com/neondatabase/add-mcp/issues"
|
|
665
|
+
},
|
|
666
|
+
dependencies: {
|
|
667
|
+
"@clack/prompts": "^0.9.1",
|
|
668
|
+
"@iarna/toml": "^2.2.5",
|
|
669
|
+
chalk: "^5.4.1",
|
|
670
|
+
commander: "^13.1.0",
|
|
671
|
+
"js-yaml": "^4.1.0",
|
|
672
|
+
"jsonc-parser": "^3.3.1"
|
|
673
|
+
},
|
|
674
|
+
devDependencies: {
|
|
675
|
+
"@types/js-yaml": "^4.0.9",
|
|
676
|
+
"@types/node": "^22.10.0",
|
|
677
|
+
prettier: "^3.8.1",
|
|
678
|
+
tsup: "^8.3.5",
|
|
679
|
+
tsx: "^4.19.2",
|
|
680
|
+
typescript: "^5.7.2"
|
|
681
|
+
},
|
|
682
|
+
engines: {
|
|
683
|
+
node: ">=18"
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
// src/index.ts
|
|
688
|
+
var version = package_default.version;
|
|
689
|
+
function shortenPath(fullPath) {
|
|
690
|
+
const home2 = homedir2();
|
|
691
|
+
if (fullPath.startsWith(home2)) {
|
|
692
|
+
return fullPath.replace(home2, "~");
|
|
693
|
+
}
|
|
694
|
+
return fullPath;
|
|
695
|
+
}
|
|
696
|
+
function resolveAgentType(input) {
|
|
697
|
+
const lower = input.toLowerCase();
|
|
698
|
+
if (lower in agents) {
|
|
699
|
+
return lower;
|
|
700
|
+
}
|
|
701
|
+
if (lower in agentAliases) {
|
|
702
|
+
return agentAliases[lower];
|
|
703
|
+
}
|
|
704
|
+
return null;
|
|
705
|
+
}
|
|
706
|
+
function collect(value, previous) {
|
|
707
|
+
return previous.concat([value]);
|
|
708
|
+
}
|
|
709
|
+
program.name("add-mcp").description(
|
|
710
|
+
"Install MCP servers onto coding agents (Claude Code, Cursor, VS Code, OpenCode, Codex)"
|
|
711
|
+
).version(version).argument("[target]", "MCP server URL (remote) or package name (local stdio)").option(
|
|
712
|
+
"-g, --global",
|
|
713
|
+
"Install globally (user-level) instead of project-level"
|
|
714
|
+
).option("-a, --agent <agent>", "Specify agents to install to", collect, []).option(
|
|
715
|
+
"-n, --name <name>",
|
|
716
|
+
"Server name (auto-inferred from target if not provided)"
|
|
717
|
+
).option(
|
|
718
|
+
"-t, --transport <type>",
|
|
719
|
+
"Transport type for remote servers (http, sse)"
|
|
720
|
+
).option("--type <type>", "Alias for --transport").option("-y, --yes", "Skip confirmation prompts").option("--all", "Install to all agents without prompts (implies -y -g)").action(async (target, options) => {
|
|
721
|
+
await main(target, options);
|
|
722
|
+
});
|
|
723
|
+
program.parse();
|
|
724
|
+
async function main(target, options) {
|
|
725
|
+
if (options.all) {
|
|
726
|
+
options.yes = true;
|
|
727
|
+
options.global = true;
|
|
728
|
+
}
|
|
729
|
+
console.log();
|
|
730
|
+
p.intro(chalk.bgCyan.black(" add-mcp "));
|
|
731
|
+
if (!target) {
|
|
732
|
+
p.log.error("Missing required argument: target");
|
|
733
|
+
console.log();
|
|
734
|
+
p.log.info(chalk.dim("Usage:"));
|
|
735
|
+
p.log.message(
|
|
736
|
+
` ${chalk.cyan("npx add-mcp")} ${chalk.yellow("<target>")} ${chalk.dim("[options]")}`
|
|
737
|
+
);
|
|
738
|
+
console.log();
|
|
739
|
+
p.log.info(chalk.dim("Examples:"));
|
|
740
|
+
p.log.message(
|
|
741
|
+
` ${chalk.cyan("npx add-mcp")} ${chalk.yellow("https://mcp.example.com/api")}`
|
|
742
|
+
);
|
|
743
|
+
p.log.message(
|
|
744
|
+
` ${chalk.cyan("npx add-mcp")} ${chalk.yellow("@modelcontextprotocol/server-postgres")}`
|
|
745
|
+
);
|
|
746
|
+
console.log();
|
|
747
|
+
p.outro(chalk.dim("Run --help for more information"));
|
|
748
|
+
process.exit(1);
|
|
749
|
+
}
|
|
750
|
+
const spinner2 = p.spinner();
|
|
751
|
+
spinner2.start("Parsing source...");
|
|
752
|
+
const parsed = parseSource(target);
|
|
753
|
+
const sourceType = isRemoteSource(parsed) ? "remote" : "local";
|
|
754
|
+
spinner2.stop(`Source: ${chalk.cyan(parsed.value)} (${sourceType})`);
|
|
755
|
+
const serverName = options.name || parsed.inferredName;
|
|
756
|
+
p.log.info(`Server name: ${chalk.cyan(serverName)}`);
|
|
757
|
+
const transportValue = options.transport || options.type;
|
|
758
|
+
let resolvedTransport;
|
|
759
|
+
if (transportValue) {
|
|
760
|
+
const validTransports = ["http", "sse"];
|
|
761
|
+
if (!validTransports.includes(transportValue)) {
|
|
762
|
+
p.log.error(
|
|
763
|
+
`Invalid transport: ${transportValue}. Valid options: ${validTransports.join(", ")}`
|
|
764
|
+
);
|
|
765
|
+
process.exit(1);
|
|
766
|
+
}
|
|
767
|
+
resolvedTransport = transportValue;
|
|
768
|
+
if (!isRemoteSource(parsed)) {
|
|
769
|
+
p.log.warn("--transport is only used for remote URLs, ignoring");
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
const serverConfig = buildServerConfig(parsed, {
|
|
773
|
+
transport: resolvedTransport
|
|
774
|
+
});
|
|
775
|
+
let targetAgents;
|
|
776
|
+
const allAgentTypes = getAgentTypes();
|
|
777
|
+
if (options.agent && options.agent.length > 0) {
|
|
778
|
+
const resolved = [];
|
|
779
|
+
const invalid = [];
|
|
780
|
+
for (const input of options.agent) {
|
|
781
|
+
const agentType = resolveAgentType(input);
|
|
782
|
+
if (agentType) {
|
|
783
|
+
resolved.push(agentType);
|
|
784
|
+
} else {
|
|
785
|
+
invalid.push(input);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
if (invalid.length > 0) {
|
|
789
|
+
p.log.error(`Invalid agents: ${invalid.join(", ")}`);
|
|
790
|
+
p.log.info(`Valid agents: ${allAgentTypes.join(", ")}`);
|
|
791
|
+
process.exit(1);
|
|
792
|
+
}
|
|
793
|
+
targetAgents = resolved;
|
|
794
|
+
} else if (options.all) {
|
|
795
|
+
targetAgents = allAgentTypes;
|
|
796
|
+
p.log.info(`Installing to all ${targetAgents.length} agents`);
|
|
797
|
+
} else {
|
|
798
|
+
spinner2.start("Detecting installed agents...");
|
|
799
|
+
const installedAgents = await detectInstalledAgents();
|
|
800
|
+
spinner2.stop(
|
|
801
|
+
`Detected ${installedAgents.length} agent${installedAgents.length !== 1 ? "s" : ""}`
|
|
802
|
+
);
|
|
803
|
+
if (installedAgents.length === 0) {
|
|
804
|
+
if (options.yes) {
|
|
805
|
+
targetAgents = allAgentTypes;
|
|
806
|
+
p.log.info("Installing to all agents (none detected)");
|
|
807
|
+
} else {
|
|
808
|
+
p.log.warn(
|
|
809
|
+
"No coding agents detected. You can still install MCP servers."
|
|
810
|
+
);
|
|
811
|
+
const allAgentChoices = allAgentTypes.map((type) => ({
|
|
812
|
+
value: type,
|
|
813
|
+
label: agents[type].displayName
|
|
814
|
+
}));
|
|
815
|
+
const selected = await p.multiselect({
|
|
816
|
+
message: "Select agents to install to",
|
|
817
|
+
options: allAgentChoices,
|
|
818
|
+
required: true
|
|
819
|
+
});
|
|
820
|
+
if (p.isCancel(selected)) {
|
|
821
|
+
p.cancel("Installation cancelled");
|
|
822
|
+
process.exit(0);
|
|
823
|
+
}
|
|
824
|
+
targetAgents = selected;
|
|
825
|
+
}
|
|
826
|
+
} else if (installedAgents.length === 1 || options.yes) {
|
|
827
|
+
targetAgents = installedAgents;
|
|
828
|
+
const agentNames = installedAgents.map((a) => chalk.cyan(agents[a].displayName)).join(", ");
|
|
829
|
+
p.log.info(`Installing to: ${agentNames}`);
|
|
830
|
+
} else {
|
|
831
|
+
const agentChoices = installedAgents.map((a) => ({
|
|
832
|
+
value: a,
|
|
833
|
+
label: agents[a].displayName,
|
|
834
|
+
hint: shortenPath(agents[a].configPath)
|
|
835
|
+
}));
|
|
836
|
+
const selected = await p.multiselect({
|
|
837
|
+
message: "Select agents to install to",
|
|
838
|
+
options: agentChoices,
|
|
839
|
+
required: true,
|
|
840
|
+
initialValues: installedAgents
|
|
841
|
+
});
|
|
842
|
+
if (p.isCancel(selected)) {
|
|
843
|
+
p.cancel("Installation cancelled");
|
|
844
|
+
process.exit(0);
|
|
845
|
+
}
|
|
846
|
+
targetAgents = selected;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
const requiredTransport = isRemoteSource(parsed) ? resolvedTransport ?? "http" : "stdio";
|
|
850
|
+
const unsupportedAgents = targetAgents.filter(
|
|
851
|
+
(a) => !isTransportSupported(a, requiredTransport)
|
|
852
|
+
);
|
|
853
|
+
if (unsupportedAgents.length > 0) {
|
|
854
|
+
const unsupportedNames = unsupportedAgents.map((a) => agents[a].displayName).join(", ");
|
|
855
|
+
if (options.all) {
|
|
856
|
+
p.log.warn(
|
|
857
|
+
`Skipping agents that don't support ${requiredTransport} transport: ${unsupportedNames}`
|
|
858
|
+
);
|
|
859
|
+
targetAgents = targetAgents.filter(
|
|
860
|
+
(a) => isTransportSupported(a, requiredTransport)
|
|
861
|
+
);
|
|
862
|
+
if (targetAgents.length === 0) {
|
|
863
|
+
p.log.error("No agents support this transport type");
|
|
864
|
+
process.exit(1);
|
|
865
|
+
}
|
|
866
|
+
} else {
|
|
867
|
+
p.log.error(
|
|
868
|
+
`The following agents don't support ${requiredTransport} transport: ${unsupportedNames}`
|
|
869
|
+
);
|
|
870
|
+
process.exit(1);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
let installGlobally = options.global ?? false;
|
|
874
|
+
if (options.global === void 0 && !options.yes) {
|
|
875
|
+
const localSupported = getAgentsWithLocalSupport();
|
|
876
|
+
const selectedWithLocal = targetAgents.filter(
|
|
877
|
+
(a) => localSupported.includes(a)
|
|
878
|
+
);
|
|
879
|
+
if (selectedWithLocal.length > 0) {
|
|
880
|
+
const scope = await p.select({
|
|
881
|
+
message: "Installation scope",
|
|
882
|
+
options: [
|
|
883
|
+
{
|
|
884
|
+
value: false,
|
|
885
|
+
label: "Project",
|
|
886
|
+
hint: "Install in current directory (committed with your project)"
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
value: true,
|
|
890
|
+
label: "Global",
|
|
891
|
+
hint: "Install in home directory (available across all projects)"
|
|
892
|
+
}
|
|
893
|
+
]
|
|
894
|
+
});
|
|
895
|
+
if (p.isCancel(scope)) {
|
|
896
|
+
p.cancel("Installation cancelled");
|
|
897
|
+
process.exit(0);
|
|
898
|
+
}
|
|
899
|
+
installGlobally = scope;
|
|
900
|
+
} else {
|
|
901
|
+
installGlobally = true;
|
|
902
|
+
p.log.info("Selected agents only support global installation");
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
const summaryLines = [];
|
|
906
|
+
summaryLines.push(`${chalk.cyan("Server:")} ${serverName}`);
|
|
907
|
+
summaryLines.push(`${chalk.cyan("Type:")} ${sourceType}`);
|
|
908
|
+
summaryLines.push(
|
|
909
|
+
`${chalk.cyan("Scope:")} ${installGlobally ? "Global" : "Project"}`
|
|
910
|
+
);
|
|
911
|
+
summaryLines.push(
|
|
912
|
+
`${chalk.cyan("Agents:")} ${targetAgents.map((a) => agents[a].displayName).join(", ")}`
|
|
913
|
+
);
|
|
914
|
+
console.log();
|
|
915
|
+
p.note(summaryLines.join("\n"), "Installation Summary");
|
|
916
|
+
if (!options.yes) {
|
|
917
|
+
const confirmed = await p.confirm({
|
|
918
|
+
message: "Proceed with installation?"
|
|
919
|
+
});
|
|
920
|
+
if (p.isCancel(confirmed) || !confirmed) {
|
|
921
|
+
p.cancel("Installation cancelled");
|
|
922
|
+
process.exit(0);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
spinner2.start("Installing MCP server...");
|
|
926
|
+
const results = installServer(serverName, serverConfig, targetAgents, {
|
|
927
|
+
local: !installGlobally
|
|
928
|
+
});
|
|
929
|
+
spinner2.stop("Installation complete");
|
|
930
|
+
console.log();
|
|
931
|
+
const successful = [...results.entries()].filter(([_, r]) => r.success);
|
|
932
|
+
const failed = [...results.entries()].filter(([_, r]) => !r.success);
|
|
933
|
+
if (successful.length > 0) {
|
|
934
|
+
const resultLines = [];
|
|
935
|
+
for (const [agentType, result] of successful) {
|
|
936
|
+
const agent = agents[agentType];
|
|
937
|
+
const shortPath = shortenPath(result.path);
|
|
938
|
+
resultLines.push(
|
|
939
|
+
`${chalk.green("\u2713")} ${agent.displayName}: ${chalk.dim(shortPath)}`
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
p.note(
|
|
943
|
+
resultLines.join("\n"),
|
|
944
|
+
chalk.green(
|
|
945
|
+
`Installed to ${successful.length} agent${successful.length !== 1 ? "s" : ""}`
|
|
946
|
+
)
|
|
947
|
+
);
|
|
948
|
+
}
|
|
949
|
+
if (failed.length > 0) {
|
|
950
|
+
console.log();
|
|
951
|
+
p.log.error(
|
|
952
|
+
chalk.red(
|
|
953
|
+
`Failed to install to ${failed.length} agent${failed.length !== 1 ? "s" : ""}`
|
|
954
|
+
)
|
|
955
|
+
);
|
|
956
|
+
for (const [agentType, result] of failed) {
|
|
957
|
+
const agent = agents[agentType];
|
|
958
|
+
p.log.message(
|
|
959
|
+
` ${chalk.red("\u2717")} ${agent.displayName}: ${chalk.dim(result.error)}`
|
|
960
|
+
);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
console.log();
|
|
964
|
+
p.outro(chalk.green("Done!"));
|
|
965
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "add-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
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
|
-
"
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
8
15
|
"scripts": {
|
|
9
|
-
"
|
|
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
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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");
|