@meldocio/mcp-stdio-proxy 1.0.12 → 1.0.13

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.
Files changed (3) hide show
  1. package/README.md +40 -0
  2. package/bin/cli.js +156 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -15,6 +15,32 @@ This is a bridge between Claude Desktop and Meldoc. After setup, Claude will be
15
15
 
16
16
  ## Quick Setup
17
17
 
18
+ ### Automatic Installation (Recommended) ✨
19
+
20
+ The easiest way to set up Meldoc MCP is using the automatic installer:
21
+
22
+ ```bash
23
+ npx @meldocio/mcp-stdio-proxy@latest install
24
+ ```
25
+
26
+ This command will:
27
+ - ✅ Automatically find your Claude Desktop configuration file
28
+ - ✅ Add Meldoc MCP configuration (preserving existing MCP servers)
29
+ - ✅ Create the config file and directory if needed
30
+ - ✅ Show you the next steps
31
+
32
+ After running `install`, you just need to:
33
+ 1. Restart Claude Desktop
34
+ 2. Run `npx @meldocio/mcp-stdio-proxy@latest auth login`
35
+
36
+ Done! 🎉
37
+
38
+ ---
39
+
40
+ ### Manual Installation
41
+
42
+ If you prefer to configure manually, follow these steps:
43
+
18
44
  ### Step 1: Find Claude Desktop configuration file
19
45
 
20
46
  Open the configuration file depending on your operating system:
@@ -186,6 +212,13 @@ When you ask Claude to do something with your documentation:
186
212
 
187
213
  ## Working Commands
188
214
 
215
+ ### Installation command
216
+
217
+ ```bash
218
+ # Automatically configure Claude Desktop for Meldoc MCP
219
+ npx @meldocio/mcp-stdio-proxy@latest install
220
+ ```
221
+
189
222
  ### Authentication commands
190
223
 
191
224
  ```bash
@@ -214,6 +247,13 @@ npx @meldocio/mcp-stdio-proxy@latest config set-workspace workspace-name
214
247
  npx @meldocio/mcp-stdio-proxy@latest config get-workspace
215
248
  ```
216
249
 
250
+ ### Installation
251
+
252
+ ```bash
253
+ # Automatically configure Claude Desktop
254
+ npx @meldocio/mcp-stdio-proxy@latest install
255
+ ```
256
+
217
257
  ### Help
218
258
 
219
259
  ```bash
package/bin/cli.js CHANGED
@@ -10,6 +10,9 @@ const axios = require('axios');
10
10
  const https = require('https');
11
11
  const chalk = require('chalk');
12
12
  const logger = require('../lib/logger');
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+ const os = require('os');
13
16
 
14
17
  const API_URL = getApiUrl();
15
18
  const APP_URL = getAppUrl();
@@ -195,6 +198,149 @@ async function handleConfigListWorkspaces() {
195
198
  }
196
199
  }
197
200
 
201
+ /**
202
+ * Get Claude Desktop config file path based on OS
203
+ */
204
+ function getClaudeDesktopConfigPath() {
205
+ const platform = os.platform();
206
+ const homeDir = os.homedir();
207
+
208
+ if (platform === 'darwin') {
209
+ // macOS
210
+ return path.join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
211
+ } else if (platform === 'win32') {
212
+ // Windows
213
+ const appData = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming');
214
+ return path.join(appData, 'Claude', 'claude_desktop_config.json');
215
+ } else {
216
+ // Linux and others
217
+ return path.join(homeDir, '.config', 'Claude', 'claude_desktop_config.json');
218
+ }
219
+ }
220
+
221
+ /**
222
+ * Handle install command - automatically configure Claude Desktop
223
+ */
224
+ function handleInstall() {
225
+ try {
226
+ logger.section('🚀 Installing Meldoc MCP for Claude Desktop');
227
+ console.log();
228
+
229
+ const configPath = getClaudeDesktopConfigPath();
230
+ const configDir = path.dirname(configPath);
231
+
232
+ logger.info(`Config file location: ${logger.highlight(configPath)}`);
233
+ console.log();
234
+
235
+ // Read existing config or create new one
236
+ let config = {};
237
+ let configExists = false;
238
+
239
+ if (fs.existsSync(configPath)) {
240
+ try {
241
+ const content = fs.readFileSync(configPath, 'utf8');
242
+ config = JSON.parse(content);
243
+ configExists = true;
244
+ logger.info('Found existing Claude Desktop configuration');
245
+ } catch (error) {
246
+ logger.warn(`Failed to parse existing config: ${error.message}`);
247
+ logger.info('Will create a new configuration file');
248
+ }
249
+ } else {
250
+ logger.info('Configuration file does not exist, will create it');
251
+ }
252
+
253
+ // Ensure mcpServers object exists
254
+ if (!config.mcpServers) {
255
+ config.mcpServers = {};
256
+ }
257
+
258
+ // Check if meldoc is already configured
259
+ 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();
265
+
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);
276
+ }
277
+
278
+ // Add meldoc configuration
279
+ config.mcpServers.meldoc = {
280
+ command: 'npx',
281
+ args: ['-y', '@meldocio/mcp-stdio-proxy@latest']
282
+ };
283
+
284
+ // Create directory if it doesn't exist
285
+ if (!fs.existsSync(configDir)) {
286
+ logger.info(`Creating directory: ${configDir}`);
287
+ fs.mkdirSync(configDir, { recursive: true });
288
+ }
289
+
290
+ // Write config file
291
+ const configContent = JSON.stringify(config, null, 2);
292
+ fs.writeFileSync(configPath, configContent, 'utf8');
293
+
294
+ logger.success('Configuration added successfully!');
295
+ console.log();
296
+
297
+ // Show what was added
298
+ logger.info('Added MCP server configuration:');
299
+ console.log(' ' + logger.highlight(JSON.stringify(config.mcpServers.meldoc, null, 2)));
300
+ console.log();
301
+
302
+ // Count other MCP servers
303
+ const otherServers = Object.keys(config.mcpServers).filter(key => key !== 'meldoc');
304
+ if (otherServers.length > 0) {
305
+ logger.info(`Found ${otherServers.length} other MCP server(s): ${otherServers.join(', ')}`);
306
+ console.log();
307
+ }
308
+
309
+ // Next steps
310
+ logger.section('✅ Installation Complete!');
311
+ console.log();
312
+ logger.info('Next steps:');
313
+ console.log();
314
+ console.log(' 1. ' + logger.label('Restart Claude Desktop'));
315
+ console.log(' Completely close and reopen Claude Desktop for changes to take effect.');
316
+ console.log();
317
+ console.log(' 2. ' + logger.label('Authenticate with Meldoc'));
318
+ console.log(' Run: ' + logger.highlight('npx @meldocio/mcp-stdio-proxy auth login'));
319
+ console.log();
320
+ console.log(' 3. ' + logger.label('Start using Claude with Meldoc!'));
321
+ console.log(' Ask Claude to read, search, or update your documentation.');
322
+ console.log();
323
+
324
+ process.exit(0);
325
+ } catch (error) {
326
+ logger.error(`Installation failed: ${error.message}`);
327
+ console.log();
328
+ logger.info('You can manually configure Claude Desktop by:');
329
+ console.log(' 1. Opening the config file: ' + logger.highlight(getClaudeDesktopConfigPath()));
330
+ console.log(' 2. Adding this configuration:');
331
+ console.log(' ' + logger.highlight(JSON.stringify({
332
+ mcpServers: {
333
+ meldoc: {
334
+ command: 'npx',
335
+ args: ['-y', '@meldocio/mcp-stdio-proxy@latest']
336
+ }
337
+ }
338
+ }, null, 2)));
339
+ console.log();
340
+ process.exit(1);
341
+ }
342
+ }
343
+
198
344
  /**
199
345
  * Handle help command
200
346
  */
@@ -229,11 +375,16 @@ function handleHelp() {
229
375
  console.log(' List all available workspaces');
230
376
  console.log();
231
377
 
378
+ console.log(' ' + logger.highlight('install'));
379
+ console.log(' Automatically configure Claude Desktop for Meldoc MCP');
380
+ console.log();
381
+
232
382
  console.log(' ' + logger.highlight('help'));
233
383
  console.log(' Show this help message');
234
384
  console.log();
235
385
 
236
386
  console.log(logger.label('Examples:'));
387
+ console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy install'));
237
388
  console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy auth login'));
238
389
  console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy config set-workspace my-workspace'));
239
390
  console.log(' ' + logger.highlight('npx @meldocio/mcp-stdio-proxy config list-workspaces'));
@@ -255,6 +406,7 @@ function showUsageHints() {
255
406
  console.log(' ' + logger.highlight('config set-workspace') + ' - Set workspace alias');
256
407
  console.log(' ' + logger.highlight('config get-workspace') + ' - Get current workspace');
257
408
  console.log(' ' + logger.highlight('config list-workspaces') + ' - List workspaces');
409
+ console.log(' ' + logger.highlight('install') + ' - Configure Claude Desktop');
258
410
  console.log(' ' + logger.highlight('help') + ' - Show detailed help');
259
411
  console.log();
260
412
  console.log(logger.label('For more information, run:'));
@@ -280,6 +432,8 @@ async function main() {
280
432
 
281
433
  if (command === 'help' || command === '--help' || command === '-h') {
282
434
  handleHelp();
435
+ } else if (command === 'install') {
436
+ handleInstall();
283
437
  } else if (command === 'auth') {
284
438
  if (subcommand === 'login') {
285
439
  await handleAuthLogin();
@@ -326,5 +480,6 @@ module.exports = {
326
480
  handleAuthLogout,
327
481
  handleConfigSetWorkspace,
328
482
  handleConfigGetWorkspace,
329
- handleConfigListWorkspaces
483
+ handleConfigListWorkspaces,
484
+ handleInstall
330
485
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meldocio/mcp-stdio-proxy",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
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"