promptgraph-mcp 1.5.11 → 1.5.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 (2) hide show
  1. package/index.js +13 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -48,12 +48,23 @@ function showHelp() {
48
48
  console.log(chalk.gray('\n github.com/NeiP4n/promptgraph · npmjs.com/package/promptgraph-mcp\n'));
49
49
  }
50
50
 
51
- if (!args[0] || args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
51
+ // Explicit help request always shows help.
52
+ if (args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
52
53
  showHelp();
53
54
  process.exit(0);
54
55
  }
55
56
 
56
- if (!KNOWN_COMMANDS.has(args[0])) {
57
+ // No args: if launched from an interactive terminal, show help.
58
+ // If stdin is a pipe (i.e. an MCP client like Claude), fall through and
59
+ // start the server — NEVER print to stdout here, it corrupts JSON-RPC.
60
+ if (!args[0] && process.stdin.isTTY) {
61
+ showHelp();
62
+ process.exit(0);
63
+ }
64
+
65
+ // Only reject an EXPLICIT unknown command. With no args (args[0] undefined),
66
+ // fall through to start the MCP server — never print to stdout here.
67
+ if (args[0] && !KNOWN_COMMANDS.has(args[0])) {
57
68
  console.log(chalk.red('✗') + ' Unknown command: ' + chalk.white(args[0]));
58
69
  console.log(chalk.gray(' Run `' + bin + ' help` to see available commands.\n'));
59
70
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptgraph-mcp",
3
- "version": "1.5.11",
3
+ "version": "1.5.13",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "bin": {