@meldocio/mcp-stdio-proxy 1.0.13 → 1.0.15

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 CHANGED
@@ -27,6 +27,7 @@ This command will:
27
27
  - ✅ Automatically find your Claude Desktop configuration file
28
28
  - ✅ Add Meldoc MCP configuration (preserving existing MCP servers)
29
29
  - ✅ Create the config file and directory if needed
30
+ - ✅ Check if already installed (won't duplicate if already configured)
30
31
  - ✅ Show you the next steps
31
32
 
32
33
  After running `install`, you just need to:
@@ -35,6 +36,21 @@ After running `install`, you just need to:
35
36
 
36
37
  Done! 🎉
37
38
 
39
+ ### Uninstalling
40
+
41
+ To remove Meldoc MCP from Claude Desktop:
42
+
43
+ ```bash
44
+ npx @meldocio/mcp-stdio-proxy@latest uninstall
45
+ ```
46
+
47
+ This will:
48
+ - ✅ Remove Meldoc MCP configuration from Claude Desktop
49
+ - ✅ Preserve other MCP servers
50
+ - ✅ Clean up empty `mcpServers` object if needed
51
+
52
+ After running `uninstall`, restart Claude Desktop for changes to take effect.
53
+
38
54
  ---
39
55
 
40
56
  ### Manual Installation
@@ -212,11 +228,14 @@ When you ask Claude to do something with your documentation:
212
228
 
213
229
  ## Working Commands
214
230
 
215
- ### Installation command
231
+ ### Installation commands
216
232
 
217
233
  ```bash
218
234
  # Automatically configure Claude Desktop for Meldoc MCP
219
235
  npx @meldocio/mcp-stdio-proxy@latest install
236
+
237
+ # Remove Meldoc MCP configuration from Claude Desktop
238
+ npx @meldocio/mcp-stdio-proxy@latest uninstall
220
239
  ```
221
240
 
222
241
  ### Authentication commands
@@ -252,6 +271,9 @@ npx @meldocio/mcp-stdio-proxy@latest config get-workspace
252
271
  ```bash
253
272
  # Automatically configure Claude Desktop
254
273
  npx @meldocio/mcp-stdio-proxy@latest install
274
+
275
+ # Remove configuration
276
+ npx @meldocio/mcp-stdio-proxy@latest uninstall
255
277
  ```
256
278
 
257
279
  ### Help
package/bin/cli.js CHANGED
@@ -218,6 +218,27 @@ function getClaudeDesktopConfigPath() {
218
218
  }
219
219
  }
220
220
 
221
+ /**
222
+ * Get expected Meldoc MCP configuration
223
+ */
224
+ function getExpectedMeldocConfig() {
225
+ return {
226
+ command: 'npx',
227
+ args: ['-y', '@meldocio/mcp-stdio-proxy@latest']
228
+ };
229
+ }
230
+
231
+ /**
232
+ * Check if two configurations are equal (deep comparison)
233
+ */
234
+ function configsEqual(config1, config2) {
235
+ if (!config1 || !config2) return false;
236
+ if (config1.command !== config2.command) return false;
237
+ if (!Array.isArray(config1.args) || !Array.isArray(config2.args)) return false;
238
+ if (config1.args.length !== config2.args.length) return false;
239
+ return config1.args.every((arg, i) => arg === config2.args[i]);
240
+ }
241
+
221
242
  /**
222
243
  * Handle install command - automatically configure Claude Desktop
223
244
  */
@@ -228,6 +249,7 @@ function handleInstall() {
228
249
 
229
250
  const configPath = getClaudeDesktopConfigPath();
230
251
  const configDir = path.dirname(configPath);
252
+ const expectedConfig = getExpectedMeldocConfig();
231
253
 
232
254
  logger.info(`Config file location: ${logger.highlight(configPath)}`);
233
255
  console.log();
@@ -257,29 +279,39 @@ function handleInstall() {
257
279
 
258
280
  // Check if meldoc is already configured
259
281
  if (config.mcpServers.meldoc) {
260
- logger.warn('Meldoc MCP is already configured in Claude Desktop');
261
- console.log();
262
- logger.info('Current configuration:');
263
- console.log(' ' + logger.highlight(JSON.stringify(config.mcpServers.meldoc, null, 2)));
264
- console.log();
282
+ const existingConfig = config.mcpServers.meldoc;
283
+ const isEqual = configsEqual(existingConfig, expectedConfig);
265
284
 
266
- // Ask if user wants to update
267
- logger.info('To update the configuration, you can manually edit the file or remove it first.');
268
- console.log();
269
- logger.success('Installation check complete - Meldoc MCP is already configured!');
270
- console.log();
271
- logger.info('Next steps:');
272
- console.log(' 1. Restart Claude Desktop (if you haven\'t already)');
273
- console.log(' 2. Run: ' + logger.highlight('npx @meldocio/mcp-stdio-proxy auth login'));
274
- console.log();
275
- process.exit(0);
285
+ if (isEqual) {
286
+ logger.success('Meldoc MCP is already configured correctly!');
287
+ console.log();
288
+ logger.info('Current configuration:');
289
+ console.log(' ' + logger.highlight(JSON.stringify(existingConfig, null, 2)));
290
+ console.log();
291
+ logger.info('No changes needed. Next steps:');
292
+ console.log(' 1. Restart Claude Desktop (if you haven\'t already)');
293
+ console.log(' 2. Run: ' + logger.highlight('npx @meldocio/mcp-stdio-proxy auth login'));
294
+ console.log();
295
+ process.exit(0);
296
+ } else {
297
+ logger.warn('Meldoc MCP is already configured, but with different settings');
298
+ console.log();
299
+ logger.info('Current configuration:');
300
+ console.log(' ' + logger.highlight(JSON.stringify(existingConfig, null, 2)));
301
+ console.log();
302
+ logger.info('Expected configuration:');
303
+ console.log(' ' + logger.highlight(JSON.stringify(expectedConfig, null, 2)));
304
+ console.log();
305
+ logger.info('To update the configuration, run:');
306
+ console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy uninstall'));
307
+ console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy install'));
308
+ console.log();
309
+ process.exit(0);
310
+ }
276
311
  }
277
312
 
278
313
  // Add meldoc configuration
279
- config.mcpServers.meldoc = {
280
- command: 'npx',
281
- args: ['-y', '@meldocio/mcp-stdio-proxy@latest']
282
- };
314
+ config.mcpServers.meldoc = expectedConfig;
283
315
 
284
316
  // Create directory if it doesn't exist
285
317
  if (!fs.existsSync(configDir)) {
@@ -330,10 +362,7 @@ function handleInstall() {
330
362
  console.log(' 2. Adding this configuration:');
331
363
  console.log(' ' + logger.highlight(JSON.stringify({
332
364
  mcpServers: {
333
- meldoc: {
334
- command: 'npx',
335
- args: ['-y', '@meldocio/mcp-stdio-proxy@latest']
336
- }
365
+ meldoc: getExpectedMeldocConfig()
337
366
  }
338
367
  }, null, 2)));
339
368
  console.log();
@@ -341,6 +370,95 @@ function handleInstall() {
341
370
  }
342
371
  }
343
372
 
373
+ /**
374
+ * Handle uninstall command - remove Meldoc MCP configuration from Claude Desktop
375
+ */
376
+ function handleUninstall() {
377
+ try {
378
+ logger.section('🗑️ Uninstalling Meldoc MCP from Claude Desktop');
379
+ console.log();
380
+
381
+ const configPath = getClaudeDesktopConfigPath();
382
+
383
+ logger.info(`Config file location: ${logger.highlight(configPath)}`);
384
+ console.log();
385
+
386
+ // Check if config file exists
387
+ if (!fs.existsSync(configPath)) {
388
+ logger.warn('Claude Desktop configuration file not found');
389
+ logger.info('Meldoc MCP is not configured (nothing to remove)');
390
+ console.log();
391
+ process.exit(0);
392
+ }
393
+
394
+ // Read existing config
395
+ let config = {};
396
+ try {
397
+ const content = fs.readFileSync(configPath, 'utf8');
398
+ config = JSON.parse(content);
399
+ } catch (error) {
400
+ logger.error(`Failed to read config file: ${error.message}`);
401
+ process.exit(1);
402
+ }
403
+
404
+ // Check if meldoc is configured
405
+ if (!config.mcpServers || !config.mcpServers.meldoc) {
406
+ logger.warn('Meldoc MCP is not configured in Claude Desktop');
407
+ logger.info('Nothing to remove');
408
+ console.log();
409
+ process.exit(0);
410
+ }
411
+
412
+ // Show what will be removed
413
+ logger.info('Current Meldoc configuration:');
414
+ console.log(' ' + logger.highlight(JSON.stringify(config.mcpServers.meldoc, null, 2)));
415
+ console.log();
416
+
417
+ // Remove meldoc configuration
418
+ delete config.mcpServers.meldoc;
419
+
420
+ // If mcpServers is now empty, remove it too
421
+ if (Object.keys(config.mcpServers).length === 0) {
422
+ delete config.mcpServers;
423
+ }
424
+
425
+ // Write config file back
426
+ const configContent = JSON.stringify(config, null, 2);
427
+ fs.writeFileSync(configPath, configContent, 'utf8');
428
+
429
+ logger.success('Meldoc MCP configuration removed successfully!');
430
+ console.log();
431
+
432
+ // Count remaining MCP servers
433
+ if (config.mcpServers && Object.keys(config.mcpServers).length > 0) {
434
+ const remainingServers = Object.keys(config.mcpServers);
435
+ logger.info(`Remaining MCP server(s): ${remainingServers.join(', ')}`);
436
+ console.log();
437
+ } else {
438
+ logger.info('No other MCP servers configured');
439
+ console.log();
440
+ }
441
+
442
+ // Next steps
443
+ logger.section('✅ Uninstallation Complete!');
444
+ console.log();
445
+ logger.info('Next steps:');
446
+ console.log(' 1. Restart Claude Desktop for changes to take effect');
447
+ console.log(' 2. To reinstall, run: ' + logger.highlight('npx @meldocio/mcp-stdio-proxy install'));
448
+ console.log();
449
+
450
+ process.exit(0);
451
+ } catch (error) {
452
+ logger.error(`Uninstallation failed: ${error.message}`);
453
+ console.log();
454
+ logger.info('You can manually remove Meldoc MCP by:');
455
+ console.log(' 1. Opening the config file: ' + logger.highlight(getClaudeDesktopConfigPath()));
456
+ console.log(' 2. Removing the "meldoc" entry from "mcpServers" object');
457
+ console.log();
458
+ process.exit(1);
459
+ }
460
+ }
461
+
344
462
  /**
345
463
  * Handle help command
346
464
  */
@@ -379,12 +497,17 @@ function handleHelp() {
379
497
  console.log(' Automatically configure Claude Desktop for Meldoc MCP');
380
498
  console.log();
381
499
 
500
+ console.log(' ' + logger.highlight('uninstall'));
501
+ console.log(' Remove Meldoc MCP configuration from Claude Desktop');
502
+ console.log();
503
+
382
504
  console.log(' ' + logger.highlight('help'));
383
505
  console.log(' Show this help message');
384
506
  console.log();
385
507
 
386
508
  console.log(logger.label('Examples:'));
387
509
  console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy install'));
510
+ console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy uninstall'));
388
511
  console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy auth login'));
389
512
  console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy config set-workspace my-workspace'));
390
513
  console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy config list-workspaces'));
@@ -407,6 +530,7 @@ function showUsageHints() {
407
530
  console.log(' ' + logger.highlight('config get-workspace') + ' - Get current workspace');
408
531
  console.log(' ' + logger.highlight('config list-workspaces') + ' - List workspaces');
409
532
  console.log(' ' + logger.highlight('install') + ' - Configure Claude Desktop');
533
+ console.log(' ' + logger.highlight('uninstall') + ' - Remove configuration');
410
534
  console.log(' ' + logger.highlight('help') + ' - Show detailed help');
411
535
  console.log();
412
536
  console.log(logger.label('For more information, run:'));
@@ -434,6 +558,8 @@ async function main() {
434
558
  handleHelp();
435
559
  } else if (command === 'install') {
436
560
  handleInstall();
561
+ } else if (command === 'uninstall') {
562
+ handleUninstall();
437
563
  } else if (command === 'auth') {
438
564
  if (subcommand === 'login') {
439
565
  await handleAuthLogin();
@@ -461,9 +587,18 @@ async function main() {
461
587
  process.exit(1);
462
588
  }
463
589
  } else {
464
- // Unknown command - might be for main proxy
465
- // Return control to main proxy handler
466
- return;
590
+ // Unknown command
591
+ logger.error(`Unknown command: ${command}`);
592
+ console.log('\n' + logger.label('Available commands:'));
593
+ console.log(' ' + logger.highlight('install') + ' - Configure Claude Desktop');
594
+ console.log(' ' + logger.highlight('uninstall') + ' - Remove configuration');
595
+ console.log(' ' + logger.highlight('auth') + ' <cmd> - Authentication commands');
596
+ console.log(' ' + logger.highlight('config') + ' <cmd> - Configuration commands');
597
+ console.log(' ' + logger.highlight('help') + ' - Show help');
598
+ console.log();
599
+ console.log(logger.label('Run') + ' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy help') + ' ' + logger.label('for more information'));
600
+ console.log();
601
+ process.exit(1);
467
602
  }
468
603
  }
469
604
 
@@ -481,5 +616,6 @@ module.exports = {
481
616
  handleConfigSetWorkspace,
482
617
  handleConfigGetWorkspace,
483
618
  handleConfigListWorkspaces,
484
- handleInstall
619
+ handleInstall,
620
+ handleUninstall
485
621
  };
@@ -9,11 +9,15 @@ const chalk = require('chalk');
9
9
 
10
10
  // Check for CLI commands first
11
11
  const args = process.argv.slice(2);
12
- if (args.length > 0 && (args[0] === 'auth' || args[0] === 'config')) {
12
+ if (args.length > 0) {
13
+ const command = args[0];
13
14
  // Handle CLI commands - cli.js will handle and exit
14
- require('./cli');
15
- // Don't exit here - cli.js will handle process.exit() after async operations complete
16
- return;
15
+ if (command === 'auth' || command === 'config' || command === 'install' ||
16
+ command === 'uninstall' || command === 'help' || command === '--help' || command === '-h') {
17
+ require('./cli');
18
+ // Don't exit here - cli.js will handle process.exit() after async operations complete
19
+ return;
20
+ }
17
21
  }
18
22
 
19
23
  // Get package info - try multiple paths for different installation scenarios
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meldocio/mcp-stdio-proxy",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "MCP stdio proxy for meldoc - connects Claude Desktop to meldoc MCP API",
5
5
  "bin": {
6
6
  "meldoc-mcp": "bin/meldoc-mcp-proxy.js"