mcpcm 1.0.3
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 +21 -0
- package/README.md +356 -0
- package/dist/cli.js +1383 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 asteriskzuo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
# mcpcm
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
███╗ ███╗ ██████╗██████╗ ██████╗███╗ ███╗
|
|
5
|
+
████╗ ████║██╔════╝██╔══██╗██╔════╝████╗ ████║
|
|
6
|
+
██╔████╔██║██║ ██████╔╝██║ ██╔████╔██║
|
|
7
|
+
██║╚██╔╝██║██║ ██╔═══╝ ██║ ██║╚██╔╝██║
|
|
8
|
+
██║ ╚═╝ ██║╚██████╗██║ ╚██████╗██║ ╚═╝ ██║
|
|
9
|
+
╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═════╝╚═╝ ╚═╝
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
MCP Configuration Manager - Manage MCP server configurations across AI Agents.
|
|
13
|
+
|
|
14
|
+
<!-- agent-list:start -->
|
|
15
|
+
|
|
16
|
+
Supports **Cursor**, **Claude Code**, **Antigravity**, **Windsurf**, **VS Code**, and [6 more](#supported-agents).
|
|
17
|
+
|
|
18
|
+
<!-- agent-list:end -->
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Use directly with npx (no install required)
|
|
24
|
+
npx mcpcm --help
|
|
25
|
+
|
|
26
|
+
# Or install globally
|
|
27
|
+
npm install -g mcpcm
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Add MCP server to specific agent
|
|
34
|
+
npx mcpcm add '{"mcpServers":{"my-server":{"command":"node","args":["/path/to/server"]}}}' --agent cursor
|
|
35
|
+
|
|
36
|
+
# Add from file to all installed agents
|
|
37
|
+
npx mcpcm add --file mcp.json --global
|
|
38
|
+
|
|
39
|
+
# List all configured MCP servers
|
|
40
|
+
npx mcpcm list
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Commands
|
|
44
|
+
|
|
45
|
+
| Command | Description |
|
|
46
|
+
| -------------- | ---------------------------------------------------- |
|
|
47
|
+
| `mcpcm add` | Add **new** MCP servers (skips existing) |
|
|
48
|
+
| `mcpcm update` | Update **existing** MCP servers (skips non-existing) |
|
|
49
|
+
| `mcpcm del` | Delete MCP servers (skips non-existing) |
|
|
50
|
+
| `mcpcm list` | List all MCP configurations |
|
|
51
|
+
| `mcpcm find` | Find where an MCP server is configured |
|
|
52
|
+
| `mcpcm sync` | Full sync from one agent to others (overwrites) |
|
|
53
|
+
|
|
54
|
+
## Common Options
|
|
55
|
+
|
|
56
|
+
These options are shared across multiple commands:
|
|
57
|
+
|
|
58
|
+
| Option | Applies to | Description |
|
|
59
|
+
| ------------------------- | ---------------------- | ----------------------------------------------- |
|
|
60
|
+
| `-a, --agent <agents...>` | add, update, del, list | Target specific agent(s) |
|
|
61
|
+
| `-g, --global` | add, update, del, list | Apply to global configs of all installed agents |
|
|
62
|
+
| `-w, --workspace` | add, update, del, list | Apply to project-level configs |
|
|
63
|
+
| `-f, --file <path>` | add, update | Read config from file instead of JSON string |
|
|
64
|
+
| `-v, --verbose` | all | Show detailed output |
|
|
65
|
+
|
|
66
|
+
> [!TIP]
|
|
67
|
+
> You must specify one of `--agent`, `--global`, or `--workspace` to indicate where to apply the operation.
|
|
68
|
+
|
|
69
|
+
## Add Command
|
|
70
|
+
|
|
71
|
+
Add **new** MCP servers to agent configurations.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# From JSON string
|
|
75
|
+
npx mcpcm add '{"mcpServers":{"easeim":{"command":"node","args":["/path/to/index.js"]}}}' --agent cursor
|
|
76
|
+
|
|
77
|
+
# From file to all installed agents
|
|
78
|
+
npx mcpcm add --file mcp.json --global
|
|
79
|
+
|
|
80
|
+
# To current project
|
|
81
|
+
npx mcpcm add --file mcp.json --workspace
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> [!NOTE]
|
|
85
|
+
> If a server already exists, it will be **skipped** (not overwritten).
|
|
86
|
+
> Use `mcpcm update` to modify existing servers.
|
|
87
|
+
|
|
88
|
+
## Update Command
|
|
89
|
+
|
|
90
|
+
Update existing MCP server configurations.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Update specific server in an agent
|
|
94
|
+
npx mcpcm update '{"mcpServers":{"my-server":{"args":["/new/path"]}}}' --agent cursor
|
|
95
|
+
|
|
96
|
+
# Update from file
|
|
97
|
+
npx mcpcm update --file mcp.json --global
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
> [!NOTE]
|
|
101
|
+
> Only **existing** servers will be updated. Non-existing servers are skipped.
|
|
102
|
+
> Use `mcpcm add` to add new servers.
|
|
103
|
+
|
|
104
|
+
## Delete Command
|
|
105
|
+
|
|
106
|
+
Delete MCP servers from configurations.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# From specific agent
|
|
110
|
+
npx mcpcm del my-server --agent cursor
|
|
111
|
+
|
|
112
|
+
# From all agents
|
|
113
|
+
npx mcpcm del my-server --global
|
|
114
|
+
|
|
115
|
+
# From project configs
|
|
116
|
+
npx mcpcm del my-server --workspace
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
> [!NOTE]
|
|
120
|
+
> Only **existing** servers will be deleted. Non-existing servers are skipped with a warning.
|
|
121
|
+
|
|
122
|
+
## List Command
|
|
123
|
+
|
|
124
|
+
List all configured MCP servers.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# All configs
|
|
128
|
+
npx mcpcm list
|
|
129
|
+
|
|
130
|
+
# Specific agent
|
|
131
|
+
npx mcpcm list --agent cursor
|
|
132
|
+
|
|
133
|
+
# Global configs only
|
|
134
|
+
npx mcpcm list --global
|
|
135
|
+
|
|
136
|
+
# Project configs only
|
|
137
|
+
npx mcpcm list --workspace
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Find Command
|
|
141
|
+
|
|
142
|
+
Search for an MCP server across all configurations.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npx mcpcm find easeim
|
|
146
|
+
|
|
147
|
+
# Output:
|
|
148
|
+
# ✓ easeim found in:
|
|
149
|
+
# Cursor (global): ~/.cursor/mcp.json
|
|
150
|
+
# Claude Code (project): .mcp.json
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Sync Command
|
|
154
|
+
|
|
155
|
+
Synchronize MCP configurations from one agent to others.
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Sync to specific agents
|
|
159
|
+
npx mcpcm sync --from cursor --to antigravity claude-code
|
|
160
|
+
|
|
161
|
+
# Sync to all installed agents
|
|
162
|
+
npx mcpcm sync --from cursor --to-all
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
> [!IMPORTANT]
|
|
166
|
+
> Sync performs a **full synchronization**: existing servers are **overwritten**, and new servers are added.
|
|
167
|
+
> This is different from `add` which skips existing servers.
|
|
168
|
+
|
|
169
|
+
## Supported Agents
|
|
170
|
+
|
|
171
|
+
<!-- available-agents:start -->
|
|
172
|
+
|
|
173
|
+
| Agent | `--agent` | Project Config | Global Config |
|
|
174
|
+
| ------------------------ | ------------- | --------------------------- | -------------------------------------------------- |
|
|
175
|
+
| Cursor | `cursor` | `.cursor/mcp.json` | `~/.cursor/mcp.json` |
|
|
176
|
+
| Claude Code | `claude-code` | `.mcp.json` | `~/.claude.json` |
|
|
177
|
+
| Antigravity | `antigravity` | `.gemini/mcp_config.json` | `~/.gemini/antigravity/mcp_config.json` |
|
|
178
|
+
| Windsurf | `windsurf` | `.windsurf/mcp_config.json` | `~/.codeium/windsurf/mcp_config.json` |
|
|
179
|
+
| VS Code / GitHub Copilot | `vscode` | `.vscode/mcp.json` | `~/Library/Application Support/Code/User/mcp.json` |
|
|
180
|
+
| Codex | `codex` | `.codex/config.toml` | `~/.codex/config.toml` |
|
|
181
|
+
| OpenCode | `opencode` | - | `~/.config/opencode/opencode.json` |
|
|
182
|
+
| Gemini CLI | `gemini-cli` | `.gemini/settings.json` | `~/.gemini/settings.json` |
|
|
183
|
+
| Qoder | `qoder` | - | (managed via `qodercli`) |
|
|
184
|
+
| Qwen Code | `qwen-code` | `.qwen/settings.json` | `~/.qwen/settings.json` |
|
|
185
|
+
| Trae | `trae` | `.trae/mcp.json` | - |
|
|
186
|
+
|
|
187
|
+
<!-- available-agents:end -->
|
|
188
|
+
|
|
189
|
+
> [!NOTE]
|
|
190
|
+
>
|
|
191
|
+
> - Claude Code uses `~/.claude.json` (not `~/.claude/` directory) for global config
|
|
192
|
+
> - VS Code path varies by OS (shown above is macOS)
|
|
193
|
+
> - Some agents don't support project-level or global configs (marked with `-`)
|
|
194
|
+
|
|
195
|
+
## MCP Configuration Format
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"mcpServers": {
|
|
200
|
+
"server-name": {
|
|
201
|
+
"command": "node",
|
|
202
|
+
"args": ["/path/to/server/index.js"],
|
|
203
|
+
"env": {
|
|
204
|
+
"API_KEY": "your-api-key"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Examples
|
|
212
|
+
|
|
213
|
+
### Add multiple servers from file
|
|
214
|
+
|
|
215
|
+
Create `mcp.json`:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"mcpServers": {
|
|
220
|
+
"filesystem": {
|
|
221
|
+
"command": "npx",
|
|
222
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
|
|
223
|
+
},
|
|
224
|
+
"github": {
|
|
225
|
+
"command": "npx",
|
|
226
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
227
|
+
"env": {
|
|
228
|
+
"GITHUB_TOKEN": "your-token"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Then:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Add to all installed agents
|
|
239
|
+
npx mcpcm add --file mcp.json --global
|
|
240
|
+
|
|
241
|
+
# Or add to current project for team sharing
|
|
242
|
+
npx mcpcm add --file mcp.json --workspace
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Sync development environment
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Set up Cursor with all your MCP servers
|
|
249
|
+
# Then sync to other agents
|
|
250
|
+
npx mcpcm sync --from cursor --to-all
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Configuration Priority
|
|
254
|
+
|
|
255
|
+
When agents have multiple config sources:
|
|
256
|
+
|
|
257
|
+
**Project > Editor > Global**
|
|
258
|
+
|
|
259
|
+
Project configs take precedence over global configs.
|
|
260
|
+
|
|
261
|
+
## Recommended .gitignore
|
|
262
|
+
|
|
263
|
+
If you're using `mcpcm` in a project, add the following to your `.gitignore` to exclude agent config directories created during testing:
|
|
264
|
+
|
|
265
|
+
```gitignore
|
|
266
|
+
# MCP Configuration files (created during testing)
|
|
267
|
+
.cursor/
|
|
268
|
+
.mcp.json
|
|
269
|
+
.gemini/
|
|
270
|
+
.windsurf/
|
|
271
|
+
.vscode/
|
|
272
|
+
.codex/
|
|
273
|
+
.qwen/
|
|
274
|
+
.trae/
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Troubleshooting
|
|
278
|
+
|
|
279
|
+
### "No installed agents detected"
|
|
280
|
+
|
|
281
|
+
The CLI auto-detects installed agents by checking for config directories. If none are found:
|
|
282
|
+
|
|
283
|
+
- Ensure at least one supported agent is installed
|
|
284
|
+
- Use `--agent` to explicitly specify target agents
|
|
285
|
+
|
|
286
|
+
### Config not taking effect
|
|
287
|
+
|
|
288
|
+
- Restart the AI agent after modifying configs
|
|
289
|
+
- Check the config file format (JSON vs TOML for Codex)
|
|
290
|
+
- Verify the `command` path is correct and executable
|
|
291
|
+
|
|
292
|
+
### Permission errors
|
|
293
|
+
|
|
294
|
+
Ensure you have write access to the config directory.
|
|
295
|
+
|
|
296
|
+
## Custom Agent Configuration
|
|
297
|
+
|
|
298
|
+
You can add or modify AI Agent configurations by editing the `agents` object in the installed CLI file.
|
|
299
|
+
|
|
300
|
+
### Locate the CLI File
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
# Find the global installation path
|
|
304
|
+
npm root -g
|
|
305
|
+
# Then edit: <npm_root>/mcpcm/dist/cli.js
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Modify the `agents` Object
|
|
309
|
+
|
|
310
|
+
Open `dist/cli.js` and locate the `agents` object (around line 27). Add or modify agent entries:
|
|
311
|
+
|
|
312
|
+
```javascript
|
|
313
|
+
var agents = {
|
|
314
|
+
// ... existing agents ...
|
|
315
|
+
|
|
316
|
+
// Add your custom agent:
|
|
317
|
+
'my-agent': {
|
|
318
|
+
name: 'my-agent',
|
|
319
|
+
displayName: 'My Custom Agent',
|
|
320
|
+
projectConfigPath: '.my-agent/mcp.json', // or null if not supported
|
|
321
|
+
globalConfigPath: join(home, '.my-agent/mcp.json'),
|
|
322
|
+
configFormat: 'json', // 'json' or 'toml'
|
|
323
|
+
mcpConfigKey: 'mcpServers', // key in config file
|
|
324
|
+
detectInstalled: async () => existsSync(join(home, '.my-agent')),
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Configuration Fields
|
|
330
|
+
|
|
331
|
+
| Field | Description |
|
|
332
|
+
| ------------------- | ----------------------------------------------------- |
|
|
333
|
+
| `name` | Agent identifier (used in `--agent` option) |
|
|
334
|
+
| `displayName` | Human-readable name shown in output |
|
|
335
|
+
| `projectConfigPath` | Relative path for project config (or `null`) |
|
|
336
|
+
| `globalConfigPath` | Absolute path for global config (or `null`) |
|
|
337
|
+
| `configFormat` | Config file format: `'json'` or `'toml'` |
|
|
338
|
+
| `mcpConfigKey` | Key for MCP servers in config (e.g., `'mcpServers'`) |
|
|
339
|
+
| `detectInstalled` | Async function returning `true` if agent is installed |
|
|
340
|
+
|
|
341
|
+
> [!NOTE]
|
|
342
|
+
> Changes take effect immediately. No rebuild required.
|
|
343
|
+
|
|
344
|
+
> [!WARNING]
|
|
345
|
+
> Reinstalling or updating the package will overwrite your changes.
|
|
346
|
+
|
|
347
|
+
> [!TIP]
|
|
348
|
+
> If you find this method cumbersome, consider [submitting a PR](https://github.com/AsteriskZuo/mcpcm/pulls) to add official support for your agent!
|
|
349
|
+
|
|
350
|
+
## License
|
|
351
|
+
|
|
352
|
+
MIT
|
|
353
|
+
|
|
354
|
+
## References
|
|
355
|
+
|
|
356
|
+
[skills](https://www.npmjs.com/package/skills)
|