@1mcp/agent 0.22.0 → 0.22.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/README.md +123 -149
- package/build/commands/app/backups.d.ts +11 -0
- package/build/commands/app/backups.d.ts.map +1 -1
- package/build/commands/app/backups.js +25 -0
- package/build/commands/app/backups.js.map +1 -1
- package/build/commands/app/consolidate.d.ts +19 -0
- package/build/commands/app/consolidate.d.ts.map +1 -1
- package/build/commands/app/consolidate.js +63 -0
- package/build/commands/app/consolidate.js.map +1 -1
- package/build/commands/app/discover.d.ts +9 -0
- package/build/commands/app/discover.d.ts.map +1 -1
- package/build/commands/app/discover.js +21 -0
- package/build/commands/app/discover.js.map +1 -1
- package/build/commands/app/index.d.ts.map +1 -1
- package/build/commands/app/index.js +12 -192
- package/build/commands/app/index.js.map +1 -1
- package/build/commands/app/list.d.ts +9 -0
- package/build/commands/app/list.d.ts.map +1 -1
- package/build/commands/app/list.js +21 -0
- package/build/commands/app/list.js.map +1 -1
- package/build/commands/app/restore.d.ts +19 -0
- package/build/commands/app/restore.d.ts.map +1 -1
- package/build/commands/app/restore.js +59 -0
- package/build/commands/app/restore.js.map +1 -1
- package/build/commands/app/status.d.ts +9 -0
- package/build/commands/app/status.d.ts.map +1 -1
- package/build/commands/app/status.js +21 -0
- package/build/commands/app/status.js.map +1 -1
- package/build/commands/mcp/add.d.ts +33 -0
- package/build/commands/mcp/add.d.ts.map +1 -1
- package/build/commands/mcp/add.js +86 -0
- package/build/commands/mcp/add.js.map +1 -1
- package/build/commands/mcp/enable.d.ts +13 -0
- package/build/commands/mcp/enable.d.ts.map +1 -1
- package/build/commands/mcp/enable.js +24 -0
- package/build/commands/mcp/enable.js.map +1 -1
- package/build/commands/mcp/index.d.ts.map +1 -1
- package/build/commands/mcp/index.js +16 -262
- package/build/commands/mcp/index.js.map +1 -1
- package/build/commands/mcp/list.d.ts +13 -0
- package/build/commands/mcp/list.d.ts.map +1 -1
- package/build/commands/mcp/list.js +35 -1
- package/build/commands/mcp/list.js.map +1 -1
- package/build/commands/mcp/remove.d.ts +9 -0
- package/build/commands/mcp/remove.d.ts.map +1 -1
- package/build/commands/mcp/remove.js +21 -0
- package/build/commands/mcp/remove.js.map +1 -1
- package/build/commands/mcp/status.d.ts +9 -0
- package/build/commands/mcp/status.d.ts.map +1 -1
- package/build/commands/mcp/status.js +23 -1
- package/build/commands/mcp/status.js.map +1 -1
- package/build/commands/mcp/tokens.d.ts +11 -1
- package/build/commands/mcp/tokens.d.ts.map +1 -1
- package/build/commands/mcp/tokens.js +31 -0
- package/build/commands/mcp/tokens.js.map +1 -1
- package/build/commands/mcp/update.d.ts +31 -0
- package/build/commands/mcp/update.d.ts.map +1 -1
- package/build/commands/mcp/update.js +72 -0
- package/build/commands/mcp/update.js.map +1 -1
- package/build/commands/preset/create.d.ts +12 -2
- package/build/commands/preset/create.d.ts.map +1 -1
- package/build/commands/preset/create.js +21 -0
- package/build/commands/preset/create.js.map +1 -1
- package/build/commands/preset/delete.d.ts +8 -2
- package/build/commands/preset/delete.d.ts.map +1 -1
- package/build/commands/preset/delete.js +10 -0
- package/build/commands/preset/delete.js.map +1 -1
- package/build/commands/preset/edit.d.ts +10 -2
- package/build/commands/preset/edit.d.ts.map +1 -1
- package/build/commands/preset/edit.js +15 -1
- package/build/commands/preset/edit.js.map +1 -1
- package/build/commands/preset/index.d.ts.map +1 -1
- package/build/commands/preset/index.js +16 -67
- package/build/commands/preset/index.js.map +1 -1
- package/build/commands/preset/interactive.d.ts +1 -2
- package/build/commands/preset/interactive.d.ts.map +1 -1
- package/build/commands/preset/list.d.ts +6 -2
- package/build/commands/preset/list.d.ts.map +1 -1
- package/build/commands/preset/list.js +6 -0
- package/build/commands/preset/list.js.map +1 -1
- package/build/commands/preset/show.d.ts +8 -2
- package/build/commands/preset/show.d.ts.map +1 -1
- package/build/commands/preset/show.js +10 -0
- package/build/commands/preset/show.js.map +1 -1
- package/build/commands/preset/test.d.ts +8 -2
- package/build/commands/preset/test.d.ts.map +1 -1
- package/build/commands/preset/test.js +10 -0
- package/build/commands/preset/test.js.map +1 -1
- package/build/commands/preset/url.d.ts +8 -2
- package/build/commands/preset/url.d.ts.map +1 -1
- package/build/commands/preset/url.js +10 -0
- package/build/commands/preset/url.js.map +1 -1
- package/build/commands/serve/index.d.ts +106 -0
- package/build/commands/serve/index.d.ts.map +1 -0
- package/build/commands/serve/index.js +143 -0
- package/build/commands/serve/index.js.map +1 -0
- package/build/commands/serve/serve.d.ts +28 -0
- package/build/commands/serve/serve.d.ts.map +1 -0
- package/build/commands/serve/serve.js +213 -0
- package/build/commands/serve/serve.js.map +1 -0
- package/build/constants.d.ts +1 -1
- package/build/constants.js +1 -1
- package/build/core/server/serverManager.d.ts.map +1 -1
- package/build/core/server/serverManager.js +3 -0
- package/build/core/server/serverManager.js.map +1 -1
- package/build/core/types/transport.d.ts +16 -77
- package/build/core/types/transport.d.ts.map +1 -1
- package/build/core/types/transport.js +2 -2
- package/build/core/types/transport.js.map +1 -1
- package/build/index.js +13 -347
- package/build/index.js.map +1 -1
- package/build/logger/logger.d.ts.map +1 -1
- package/build/logger/logger.js +4 -2
- package/build/logger/logger.js.map +1 -1
- package/build/logger/mcpLoggingEnhancer.d.ts.map +1 -1
- package/build/logger/mcpLoggingEnhancer.js +10 -6
- package/build/logger/mcpLoggingEnhancer.js.map +1 -1
- package/build/transport/transportFactory.js +1 -1
- package/build/transport/transportFactory.js.map +1 -1
- package/build/utils/configureGlobalLogger.d.ts +12 -0
- package/build/utils/configureGlobalLogger.d.ts.map +1 -0
- package/build/utils/configureGlobalLogger.js +18 -0
- package/build/utils/configureGlobalLogger.js.map +1 -0
- package/package.json +17 -18
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { globalOptions } from '../../globalOptions.js';
|
|
2
|
+
// Import builder functions from command implementations
|
|
3
|
+
import { buildAddCommand } from './add.js';
|
|
4
|
+
import { buildUpdateCommand } from './update.js';
|
|
5
|
+
import { buildTokensCommand } from './tokens.js';
|
|
6
|
+
import { buildRemoveCommand } from './remove.js';
|
|
7
|
+
import { buildEnableCommand, buildDisableCommand } from './enable.js';
|
|
8
|
+
import { buildListCommand } from './list.js';
|
|
9
|
+
import { buildStatusCommand } from './status.js';
|
|
2
10
|
/**
|
|
3
11
|
* MCP command group entry point.
|
|
4
12
|
*
|
|
@@ -15,89 +23,7 @@ export function setupMcpCommands(yargs) {
|
|
|
15
23
|
.command({
|
|
16
24
|
command: 'add <name>',
|
|
17
25
|
describe: 'Add a new MCP server to the configuration',
|
|
18
|
-
builder:
|
|
19
|
-
return yargs
|
|
20
|
-
.positional('name', {
|
|
21
|
-
describe: 'Name of the MCP server',
|
|
22
|
-
type: 'string',
|
|
23
|
-
demandOption: true,
|
|
24
|
-
})
|
|
25
|
-
.option('type', {
|
|
26
|
-
describe: 'Transport type for the server (auto-detected when using " -- " pattern)',
|
|
27
|
-
type: 'string',
|
|
28
|
-
choices: ['stdio', 'http', 'sse'],
|
|
29
|
-
demandOption: false,
|
|
30
|
-
})
|
|
31
|
-
.option('command', {
|
|
32
|
-
describe: 'Command to execute (required for stdio)',
|
|
33
|
-
type: 'string',
|
|
34
|
-
})
|
|
35
|
-
.option('args', {
|
|
36
|
-
describe: 'Arguments for the command (stdio only)',
|
|
37
|
-
type: 'array',
|
|
38
|
-
string: true,
|
|
39
|
-
})
|
|
40
|
-
.option('url', {
|
|
41
|
-
describe: 'URL for HTTP/SSE servers',
|
|
42
|
-
type: 'string',
|
|
43
|
-
alias: 'u',
|
|
44
|
-
})
|
|
45
|
-
.option('env', {
|
|
46
|
-
describe: 'Environment variables in key=value format',
|
|
47
|
-
type: 'array',
|
|
48
|
-
string: true,
|
|
49
|
-
alias: 'e',
|
|
50
|
-
})
|
|
51
|
-
.option('tags', {
|
|
52
|
-
describe: 'Tags for categorization (comma-separated)',
|
|
53
|
-
type: 'string',
|
|
54
|
-
alias: 'g',
|
|
55
|
-
})
|
|
56
|
-
.option('timeout', {
|
|
57
|
-
describe: 'Connection timeout in milliseconds',
|
|
58
|
-
type: 'number',
|
|
59
|
-
})
|
|
60
|
-
.option('disabled', {
|
|
61
|
-
describe: 'Add server in disabled state',
|
|
62
|
-
type: 'boolean',
|
|
63
|
-
default: false,
|
|
64
|
-
})
|
|
65
|
-
.option('cwd', {
|
|
66
|
-
describe: 'Working directory for stdio servers',
|
|
67
|
-
type: 'string',
|
|
68
|
-
})
|
|
69
|
-
.option('headers', {
|
|
70
|
-
describe: 'HTTP headers in key=value format (HTTP/SSE only)',
|
|
71
|
-
type: 'array',
|
|
72
|
-
string: true,
|
|
73
|
-
})
|
|
74
|
-
.option('restart-on-exit', {
|
|
75
|
-
describe: 'Enable automatic restart when process exits (stdio only)',
|
|
76
|
-
type: 'boolean',
|
|
77
|
-
})
|
|
78
|
-
.option('max-restarts', {
|
|
79
|
-
describe: 'Maximum number of restart attempts (stdio only, unlimited if not specified)',
|
|
80
|
-
type: 'number',
|
|
81
|
-
})
|
|
82
|
-
.option('restart-delay', {
|
|
83
|
-
describe: 'Delay in milliseconds between restart attempts (stdio only, default: 1000)',
|
|
84
|
-
type: 'number',
|
|
85
|
-
})
|
|
86
|
-
.example([
|
|
87
|
-
['$0 mcp add myserver --type=stdio --command=node --args=server.js', 'Add stdio server (explicit)'],
|
|
88
|
-
['$0 mcp add webserver --type=http --url=http://localhost:3000/mcp', 'Add HTTP server'],
|
|
89
|
-
[
|
|
90
|
-
'$0 mcp add airtable --env AIRTABLE_API_KEY=key -- npx -y airtable-mcp-server',
|
|
91
|
-
'Add server using " -- " pattern',
|
|
92
|
-
],
|
|
93
|
-
['$0 mcp add myserver -- cmd /c npx -y @some/package', 'Add server with Windows command'],
|
|
94
|
-
['$0 mcp add tagged --type=stdio --command=echo --tags=dev,test', 'Add server with tags'],
|
|
95
|
-
[
|
|
96
|
-
'$0 mcp add custom --type=stdio --command=python --env=PATH=/custom/path --disabled',
|
|
97
|
-
'Add disabled server with custom env',
|
|
98
|
-
],
|
|
99
|
-
]);
|
|
100
|
-
},
|
|
26
|
+
builder: buildAddCommand,
|
|
101
27
|
handler: async (argv) => {
|
|
102
28
|
const { addCommand } = await import('./add.js');
|
|
103
29
|
const { parseDoubleHyphenArgs, hasDoubleHyphen, mergeDoubleHyphenArgs } = await import('./utils/doubleHyphenParser.js');
|
|
@@ -115,24 +41,7 @@ export function setupMcpCommands(yargs) {
|
|
|
115
41
|
.command({
|
|
116
42
|
command: 'remove <name>',
|
|
117
43
|
describe: 'Remove an MCP server from the configuration',
|
|
118
|
-
builder:
|
|
119
|
-
return yargs
|
|
120
|
-
.positional('name', {
|
|
121
|
-
describe: 'Name of the MCP server to remove',
|
|
122
|
-
type: 'string',
|
|
123
|
-
demandOption: true,
|
|
124
|
-
})
|
|
125
|
-
.option('yes', {
|
|
126
|
-
describe: 'Skip confirmation prompt',
|
|
127
|
-
type: 'boolean',
|
|
128
|
-
default: false,
|
|
129
|
-
alias: 'y',
|
|
130
|
-
})
|
|
131
|
-
.example([
|
|
132
|
-
['$0 mcp remove myserver', 'Remove server with confirmation'],
|
|
133
|
-
['$0 mcp remove myserver --yes', 'Remove server without confirmation'],
|
|
134
|
-
]);
|
|
135
|
-
},
|
|
44
|
+
builder: buildRemoveCommand,
|
|
136
45
|
handler: async (argv) => {
|
|
137
46
|
const { removeCommand } = await import('./remove.js');
|
|
138
47
|
await removeCommand(argv);
|
|
@@ -141,75 +50,7 @@ export function setupMcpCommands(yargs) {
|
|
|
141
50
|
.command({
|
|
142
51
|
command: 'update <name>',
|
|
143
52
|
describe: 'Update an existing MCP server configuration',
|
|
144
|
-
builder:
|
|
145
|
-
return yargs
|
|
146
|
-
.positional('name', {
|
|
147
|
-
describe: 'Name of the MCP server to update',
|
|
148
|
-
type: 'string',
|
|
149
|
-
demandOption: true,
|
|
150
|
-
})
|
|
151
|
-
.option('type', {
|
|
152
|
-
describe: 'Transport type for the server (auto-detected when using " -- " pattern)',
|
|
153
|
-
type: 'string',
|
|
154
|
-
choices: ['stdio', 'http', 'sse'],
|
|
155
|
-
})
|
|
156
|
-
.option('command', {
|
|
157
|
-
describe: 'Command to execute (stdio only)',
|
|
158
|
-
type: 'string',
|
|
159
|
-
})
|
|
160
|
-
.option('args', {
|
|
161
|
-
describe: 'Arguments for the command (stdio only)',
|
|
162
|
-
type: 'array',
|
|
163
|
-
string: true,
|
|
164
|
-
})
|
|
165
|
-
.option('url', {
|
|
166
|
-
describe: 'URL for HTTP/SSE servers',
|
|
167
|
-
type: 'string',
|
|
168
|
-
alias: 'u',
|
|
169
|
-
})
|
|
170
|
-
.option('env', {
|
|
171
|
-
describe: 'Environment variables in key=value format',
|
|
172
|
-
type: 'array',
|
|
173
|
-
string: true,
|
|
174
|
-
alias: 'e',
|
|
175
|
-
})
|
|
176
|
-
.option('tags', {
|
|
177
|
-
describe: 'Tags for categorization (comma-separated)',
|
|
178
|
-
type: 'string',
|
|
179
|
-
alias: 'g',
|
|
180
|
-
})
|
|
181
|
-
.option('timeout', {
|
|
182
|
-
describe: 'Connection timeout in milliseconds',
|
|
183
|
-
type: 'number',
|
|
184
|
-
})
|
|
185
|
-
.option('cwd', {
|
|
186
|
-
describe: 'Working directory for stdio servers',
|
|
187
|
-
type: 'string',
|
|
188
|
-
})
|
|
189
|
-
.option('headers', {
|
|
190
|
-
describe: 'HTTP headers in key=value format (HTTP/SSE only)',
|
|
191
|
-
type: 'array',
|
|
192
|
-
string: true,
|
|
193
|
-
})
|
|
194
|
-
.option('restart-on-exit', {
|
|
195
|
-
describe: 'Enable automatic restart when process exits (stdio only)',
|
|
196
|
-
type: 'boolean',
|
|
197
|
-
})
|
|
198
|
-
.option('max-restarts', {
|
|
199
|
-
describe: 'Maximum number of restart attempts (stdio only, unlimited if not specified)',
|
|
200
|
-
type: 'number',
|
|
201
|
-
})
|
|
202
|
-
.option('restart-delay', {
|
|
203
|
-
describe: 'Delay in milliseconds between restart attempts (stdio only, default: 1000)',
|
|
204
|
-
type: 'number',
|
|
205
|
-
})
|
|
206
|
-
.example([
|
|
207
|
-
['$0 mcp update myserver --tags=prod,api', 'Update server tags'],
|
|
208
|
-
['$0 mcp update myserver --env=NODE_ENV=production', 'Update environment'],
|
|
209
|
-
['$0 mcp update myserver -- npx -y updated-package', 'Update using " -- " pattern'],
|
|
210
|
-
['$0 mcp update myserver --timeout=10000', 'Update timeout'],
|
|
211
|
-
]);
|
|
212
|
-
},
|
|
53
|
+
builder: buildUpdateCommand,
|
|
213
54
|
handler: async (argv) => {
|
|
214
55
|
const { updateCommand } = await import('./update.js');
|
|
215
56
|
const { parseDoubleHyphenArgs, hasDoubleHyphen, mergeDoubleHyphenArgs } = await import('./utils/doubleHyphenParser.js');
|
|
@@ -227,15 +68,7 @@ export function setupMcpCommands(yargs) {
|
|
|
227
68
|
.command({
|
|
228
69
|
command: 'enable <name>',
|
|
229
70
|
describe: 'Enable a disabled MCP server',
|
|
230
|
-
builder:
|
|
231
|
-
return yargs
|
|
232
|
-
.positional('name', {
|
|
233
|
-
describe: 'Name of the MCP server to enable',
|
|
234
|
-
type: 'string',
|
|
235
|
-
demandOption: true,
|
|
236
|
-
})
|
|
237
|
-
.example([['$0 mcp enable myserver', 'Enable a disabled server']]);
|
|
238
|
-
},
|
|
71
|
+
builder: buildEnableCommand,
|
|
239
72
|
handler: async (argv) => {
|
|
240
73
|
const { enableCommand } = await import('./enable.js');
|
|
241
74
|
await enableCommand(argv);
|
|
@@ -244,15 +77,7 @@ export function setupMcpCommands(yargs) {
|
|
|
244
77
|
.command({
|
|
245
78
|
command: 'disable <name>',
|
|
246
79
|
describe: 'Disable an MCP server without removing it',
|
|
247
|
-
builder:
|
|
248
|
-
return yargs
|
|
249
|
-
.positional('name', {
|
|
250
|
-
describe: 'Name of the MCP server to disable',
|
|
251
|
-
type: 'string',
|
|
252
|
-
demandOption: true,
|
|
253
|
-
})
|
|
254
|
-
.example([['$0 mcp disable myserver', 'Disable a server temporarily']]);
|
|
255
|
-
},
|
|
80
|
+
builder: buildDisableCommand,
|
|
256
81
|
handler: async (argv) => {
|
|
257
82
|
const { disableCommand } = await import('./enable.js');
|
|
258
83
|
await disableCommand(argv);
|
|
@@ -261,31 +86,7 @@ export function setupMcpCommands(yargs) {
|
|
|
261
86
|
.command({
|
|
262
87
|
command: 'list',
|
|
263
88
|
describe: 'List all configured MCP servers',
|
|
264
|
-
builder:
|
|
265
|
-
return yargs
|
|
266
|
-
.option('show-disabled', {
|
|
267
|
-
describe: 'Include disabled servers in the list',
|
|
268
|
-
type: 'boolean',
|
|
269
|
-
default: false,
|
|
270
|
-
})
|
|
271
|
-
.option('tags', {
|
|
272
|
-
describe: 'Filter servers by tags (comma-separated)',
|
|
273
|
-
type: 'string',
|
|
274
|
-
alias: 'g',
|
|
275
|
-
})
|
|
276
|
-
.option('verbose', {
|
|
277
|
-
describe: 'Show detailed server configuration',
|
|
278
|
-
type: 'boolean',
|
|
279
|
-
default: false,
|
|
280
|
-
alias: 'v',
|
|
281
|
-
})
|
|
282
|
-
.example([
|
|
283
|
-
['$0 mcp list', 'List all enabled servers'],
|
|
284
|
-
['$0 mcp list --show-disabled', 'List all servers including disabled'],
|
|
285
|
-
['$0 mcp list --tags=prod,api', 'List servers with specific tags'],
|
|
286
|
-
['$0 mcp list --verbose', 'List servers with detailed config'],
|
|
287
|
-
]);
|
|
288
|
-
},
|
|
89
|
+
builder: buildListCommand,
|
|
289
90
|
handler: async (argv) => {
|
|
290
91
|
const { listCommand } = await import('./list.js');
|
|
291
92
|
await listCommand(argv);
|
|
@@ -294,24 +95,7 @@ export function setupMcpCommands(yargs) {
|
|
|
294
95
|
.command({
|
|
295
96
|
command: 'status [name]',
|
|
296
97
|
describe: 'Show status and details of MCP servers',
|
|
297
|
-
builder:
|
|
298
|
-
return yargs
|
|
299
|
-
.positional('name', {
|
|
300
|
-
describe: 'Name of specific server to check (optional)',
|
|
301
|
-
type: 'string',
|
|
302
|
-
})
|
|
303
|
-
.option('verbose', {
|
|
304
|
-
describe: 'Show detailed status information',
|
|
305
|
-
type: 'boolean',
|
|
306
|
-
default: false,
|
|
307
|
-
alias: 'v',
|
|
308
|
-
})
|
|
309
|
-
.example([
|
|
310
|
-
['$0 mcp status', 'Show status of all servers'],
|
|
311
|
-
['$0 mcp status myserver', 'Show status of specific server'],
|
|
312
|
-
['$0 mcp status --verbose', 'Show detailed status information'],
|
|
313
|
-
]);
|
|
314
|
-
},
|
|
98
|
+
builder: buildStatusCommand,
|
|
315
99
|
handler: async (argv) => {
|
|
316
100
|
const { statusCommand } = await import('./status.js');
|
|
317
101
|
await statusCommand(argv);
|
|
@@ -320,37 +104,7 @@ export function setupMcpCommands(yargs) {
|
|
|
320
104
|
.command({
|
|
321
105
|
command: 'tokens',
|
|
322
106
|
describe: 'Estimate MCP token usage for server capabilities',
|
|
323
|
-
builder:
|
|
324
|
-
return yargs
|
|
325
|
-
.option('tag-filter', {
|
|
326
|
-
describe: 'Filter servers by advanced tag expression (and/or/not logic)',
|
|
327
|
-
type: 'string',
|
|
328
|
-
alias: 'f',
|
|
329
|
-
})
|
|
330
|
-
.option('format', {
|
|
331
|
-
describe: 'Output format',
|
|
332
|
-
type: 'string',
|
|
333
|
-
choices: ['table', 'json', 'summary'],
|
|
334
|
-
default: 'table',
|
|
335
|
-
})
|
|
336
|
-
.option('model', {
|
|
337
|
-
describe: 'Model to use for token estimation',
|
|
338
|
-
type: 'string',
|
|
339
|
-
alias: 'm',
|
|
340
|
-
default: 'gpt-4o',
|
|
341
|
-
})
|
|
342
|
-
.example([
|
|
343
|
-
['$0 mcp tokens', 'Estimate tokens for all MCP servers by connecting to them'],
|
|
344
|
-
[
|
|
345
|
-
'$0 mcp tokens --tag-filter="context7 or playwright"',
|
|
346
|
-
'Estimate tokens for servers with specific tags',
|
|
347
|
-
],
|
|
348
|
-
['$0 mcp tokens --format=json', 'Output in JSON format for programmatic use'],
|
|
349
|
-
['$0 mcp tokens --format=summary', 'Show concise summary'],
|
|
350
|
-
['$0 mcp tokens --model=gpt-3.5-turbo', 'Use gpt-3.5-turbo for token estimation'],
|
|
351
|
-
['$0 mcp tokens --tag-filter="ai and not experimental" --format=table', 'Filter and format output'],
|
|
352
|
-
]);
|
|
353
|
-
},
|
|
107
|
+
builder: buildTokensCommand,
|
|
354
108
|
handler: async (argv) => {
|
|
355
109
|
const { tokensCommand } = await import('./tokens.js');
|
|
356
110
|
await tokensCommand(argv);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/mcp/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/mcp/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,wDAAwD;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAW;IAC1C,OAAO,KAAK,CAAC,OAAO,CAClB,KAAK,EACL,kCAAkC,EAClC,CAAC,KAAK,EAAE,EAAE;QACR,OAAO,KAAK;aACT,OAAO,CAAC,aAAa,IAAI,EAAE,CAAC;aAC5B,OAAO,CAAC;YACP,OAAO,EAAE,YAAY;YACrB,QAAQ,EAAE,2CAA2C;YACrD,OAAO,EAAE,eAAe;YACxB,OAAO,EAAE,KAAK,EAAE,IAAI,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AAO,EAAE,kBAAkB;YAC3B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBACtB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;gBACtD,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;aACD,OAAO,CAAC;YACP,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,kDAAkD;YAC5D,OAAO,EAAE,kBAAkB;YAC3B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBACtB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;gBACtD,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;aACD,aAAa,CAAC,CAAC,EAAE,+BAA+B,CAAC;aACjD,IAAI,EAAE,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;SAehB,CAAC,CAAC;IACP,CAAC,EACD,GAAG,EAAE;QACH,8DAA8D;QAC9D,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;QAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Argv } from 'yargs';
|
|
1
2
|
import { GlobalOptions } from '../../globalOptions.js';
|
|
2
3
|
export interface ListCommandArgs extends GlobalOptions {
|
|
3
4
|
'show-disabled'?: boolean;
|
|
@@ -5,6 +6,18 @@ export interface ListCommandArgs extends GlobalOptions {
|
|
|
5
6
|
tags?: string;
|
|
6
7
|
verbose?: boolean;
|
|
7
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Build the list command configuration
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildListCommand(yargs: Argv): Argv<{
|
|
13
|
+
"show-disabled": boolean;
|
|
14
|
+
} & {
|
|
15
|
+
"show-secrets": boolean;
|
|
16
|
+
} & {
|
|
17
|
+
tags: string | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
verbose: boolean;
|
|
20
|
+
}>;
|
|
8
21
|
/**
|
|
9
22
|
* List all configured MCP servers
|
|
10
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/mcp/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/mcp/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAMvD,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI;;;;;;;;GA8B3C;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsFtE"}
|
|
@@ -2,6 +2,40 @@ import { getAllServers, validateConfigPath, parseTags } from './utils/configUtil
|
|
|
2
2
|
import { validateTags } from './utils/validation.js';
|
|
3
3
|
import { inferTransportType } from '../../transport/transportFactory.js';
|
|
4
4
|
import { redactCommandArgs, redactUrl, redactSensitiveValue, sanitizeHeaders } from '../../utils/sanitization.js';
|
|
5
|
+
/**
|
|
6
|
+
* Build the list command configuration
|
|
7
|
+
*/
|
|
8
|
+
export function buildListCommand(yargs) {
|
|
9
|
+
return yargs
|
|
10
|
+
.option('show-disabled', {
|
|
11
|
+
describe: 'Include disabled servers in the list',
|
|
12
|
+
type: 'boolean',
|
|
13
|
+
default: false,
|
|
14
|
+
})
|
|
15
|
+
.option('show-secrets', {
|
|
16
|
+
describe: 'Show sensitive values in verbose output',
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
default: false,
|
|
19
|
+
})
|
|
20
|
+
.option('tags', {
|
|
21
|
+
describe: 'Filter servers by tags (comma-separated)',
|
|
22
|
+
type: 'string',
|
|
23
|
+
alias: 'g',
|
|
24
|
+
})
|
|
25
|
+
.option('verbose', {
|
|
26
|
+
describe: 'Show detailed server configuration',
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
default: false,
|
|
29
|
+
alias: 'v',
|
|
30
|
+
})
|
|
31
|
+
.example([
|
|
32
|
+
['$0 mcp list', 'List all enabled servers'],
|
|
33
|
+
['$0 mcp list --show-disabled', 'List all servers including disabled'],
|
|
34
|
+
['$0 mcp list --show-secrets', 'Show sensitive values in verbose output'],
|
|
35
|
+
['$0 mcp list --tags=prod,api', 'List servers with specific tags'],
|
|
36
|
+
['$0 mcp list --verbose', 'List servers with detailed config'],
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
5
39
|
/**
|
|
6
40
|
* List all configured MCP servers
|
|
7
41
|
*/
|
|
@@ -153,7 +187,7 @@ function displayServer(name, config, verbose, showSecrets = false) {
|
|
|
153
187
|
console.log(` Environment: ${envCount} variable${envCount === 1 ? '' : 's'}`);
|
|
154
188
|
if (verbose) {
|
|
155
189
|
for (const [key, value] of Object.entries(inferredConfig.env)) {
|
|
156
|
-
const displayValue = showSecrets ? value : redactSensitiveValue(value);
|
|
190
|
+
const displayValue = showSecrets ? value : redactSensitiveValue(String(value));
|
|
157
191
|
console.log(` ${key}=${displayValue}`);
|
|
158
192
|
}
|
|
159
193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/mcp/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/mcp/list.ts"],"names":[],"mappings":"AAGA,OAAO,EA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EAAE,CAAC;gBAC9D,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC/E,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import type { Argv } from 'yargs';
|
|
1
2
|
import { GlobalOptions } from '../../globalOptions.js';
|
|
2
3
|
export interface RemoveCommandArgs extends GlobalOptions {
|
|
3
4
|
name: string;
|
|
4
5
|
yes?: boolean;
|
|
5
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Build the remove command configuration
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildRemoveCommand(yargs: Argv): Argv<{
|
|
11
|
+
name: string;
|
|
12
|
+
} & {
|
|
13
|
+
yes: boolean;
|
|
14
|
+
}>;
|
|
6
15
|
/**
|
|
7
16
|
* Remove an MCP server from the configuration
|
|
8
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/commands/mcp/remove.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/commands/mcp/remove.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAUlC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,IAAI;;;;GAiB7C;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8E1E"}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import readline from 'readline';
|
|
2
2
|
import { serverExists, getServer, removeServer, validateConfigPath, backupConfig, reloadMcpConfig, } from './utils/configUtils.js';
|
|
3
3
|
import { validateServerName } from './utils/validation.js';
|
|
4
|
+
/**
|
|
5
|
+
* Build the remove command configuration
|
|
6
|
+
*/
|
|
7
|
+
export function buildRemoveCommand(yargs) {
|
|
8
|
+
return yargs
|
|
9
|
+
.positional('name', {
|
|
10
|
+
describe: 'Name of the MCP server to remove',
|
|
11
|
+
type: 'string',
|
|
12
|
+
demandOption: true,
|
|
13
|
+
})
|
|
14
|
+
.option('yes', {
|
|
15
|
+
describe: 'Skip confirmation prompt',
|
|
16
|
+
type: 'boolean',
|
|
17
|
+
default: false,
|
|
18
|
+
alias: 'y',
|
|
19
|
+
})
|
|
20
|
+
.example([
|
|
21
|
+
['$0 mcp remove myserver', 'Remove server with confirmation'],
|
|
22
|
+
['$0 mcp remove myserver --yes', 'Remove server without confirmation'],
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
4
25
|
/**
|
|
5
26
|
* Remove an MCP server from the configuration
|
|
6
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/commands/mcp/remove.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/commands/mcp/remove.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQ3D;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAW;IA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args';
|
|
1
2
|
import { GlobalOptions } from '../../globalOptions.js';
|
|
2
3
|
export interface StatusCommandArgs extends GlobalOptions {
|
|
3
4
|
name?: string;
|
|
4
5
|
verbose?: boolean;
|
|
5
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Build the status command configuration
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildStatusCommand(yargs: Argv): Argv<{
|
|
11
|
+
name: string | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
verbose: boolean;
|
|
14
|
+
}>;
|
|
6
15
|
/**
|
|
7
16
|
* Show status and details of MCP servers
|
|
8
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/mcp/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/mcp/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKvD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,IAAI;;;;GAiB7C;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB1E"}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { getAllServers, getServer, validateConfigPath } from './utils/configUtils.js';
|
|
2
2
|
import { validateServerName } from './utils/validation.js';
|
|
3
3
|
import { inferTransportType } from '../../transport/transportFactory.js';
|
|
4
|
+
/**
|
|
5
|
+
* Build the status command configuration
|
|
6
|
+
*/
|
|
7
|
+
export function buildStatusCommand(yargs) {
|
|
8
|
+
return yargs
|
|
9
|
+
.positional('name', {
|
|
10
|
+
describe: 'Name of specific server to check (optional)',
|
|
11
|
+
type: 'string',
|
|
12
|
+
})
|
|
13
|
+
.option('verbose', {
|
|
14
|
+
describe: 'Show detailed status information',
|
|
15
|
+
type: 'boolean',
|
|
16
|
+
default: false,
|
|
17
|
+
alias: 'v',
|
|
18
|
+
})
|
|
19
|
+
.example([
|
|
20
|
+
['$0 mcp status', 'Show status of all servers'],
|
|
21
|
+
['$0 mcp status myserver', 'Show status of specific server'],
|
|
22
|
+
['$0 mcp status --verbose', 'Show detailed status information'],
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
4
25
|
/**
|
|
5
26
|
* Show status and details of MCP servers
|
|
6
27
|
*/
|
|
@@ -171,7 +192,8 @@ function displayDetailedServerStatus(name, config, verbose) {
|
|
|
171
192
|
console.log(` ${key}=${value}`);
|
|
172
193
|
}
|
|
173
194
|
else {
|
|
174
|
-
const
|
|
195
|
+
const strValue = String(value);
|
|
196
|
+
const displayValue = strValue.length > 20 ? `${strValue.substring(0, 20)}...` : strValue;
|
|
175
197
|
console.log(` ${key}=${displayValue}`);
|
|
176
198
|
}
|
|
177
199
|
}
|