@n0zer0d4y/vulcan-file-ops 1.2.10 → 1.2.11

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/CHANGELOG.md CHANGED
@@ -9,6 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
 
11
11
 
12
+ ## [1.2.11] - 2026-02-21
13
+
14
+ ### Fixed
15
+
16
+ - **CRITICAL**: Fixed MCP server toggle failure and "no tools configured" error in Claude Desktop and Cursor.
17
+ - **Root Cause**: ES Module execution order caused `parseArguments()` to run before console suppression logic. This allowed warning messages to be emitted to the protocol stream, corrupting JSON-RPC communication.
18
+ - **Solution**: Moved console suppression to the absolute top of `server/index.ts` and deferred argument parsing to the `runServer()` function.
19
+ - Improved MCP mode detection to exclude `--help` and `--version` flags.
20
+ - See `local_docs/RCA-MCP-Toggle-Failure-Stdout-Pollution-2026-02-21.md` for full details.
21
+
12
22
  ## [1.2.10] - 2026-01-31
13
23
 
14
24
  ### Fixed
package/dist/cli.js CHANGED
@@ -1,9 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  // CRITICAL: Detect MCP mode and suppress console output BEFORE any imports
3
3
  // MCP servers use stdin/stdout for JSON-RPC via stdio transport
4
- // Detection: stdin/stdout are NOT TTY (piped/redirected) = MCP mode
5
- const isMCP = (!process.stdin.isTTY && !process.stdout.isTTY) ||
6
- process.argv.some((arg) => arg.includes("mcp") || arg.includes("stdio"));
4
+ // Detection: stdin/stdout are NOT TTY (piped/redirected) OR explicit MCP flags are present.
5
+ // Note: We exclude help/version flags to allow CLI usage even when piped.
6
+ const isMCP = ((!process.stdin.isTTY && !process.stdout.isTTY) ||
7
+ process.argv.some((arg) => arg.includes("mcp") || arg.includes("stdio") || arg.includes("inspector"))) &&
8
+ !process.argv.some((arg) => arg === "--help" || arg === "-h" || arg === "--version" || arg === "-v");
7
9
  if (isMCP) {
8
10
  // Suppress all console methods (but NOT stdout/stderr streams - MCP SDK needs those)
9
11
  const noop = () => { };
@@ -1,4 +1,19 @@
1
1
  #!/usr/bin/env node
2
+ // CRITICAL: Console suppression MUST happen BEFORE any other imports
3
+ // due to ES Module static import execution order (imports are evaluated BEFORE top-level code).
4
+ // Detection: stdin/stdout are NOT TTY (piped/redirected) OR explicit MCP flags are present.
5
+ // Note: We exclude help/version flags to allow CLI usage even when piped.
6
+ const _isMCP = ((!process.stdin.isTTY && !process.stdout.isTTY) ||
7
+ process.argv.some((arg) => arg.includes("mcp") || arg.includes("stdio") || arg.includes("inspector"))) &&
8
+ !process.argv.some((arg) => arg === "--help" || arg === "-h" || arg === "--version" || arg === "-v");
9
+ if (_isMCP) {
10
+ const noop = () => { };
11
+ console.log = noop;
12
+ console.error = noop;
13
+ console.warn = noop;
14
+ console.info = noop;
15
+ console.debug = noop;
16
+ }
2
17
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
18
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
19
  import { CallToolRequestSchema, ListToolsRequestSchema, InitializeRequestSchema, PingRequestSchema, RootsListChangedNotificationSchema, } from "@modelcontextprotocol/sdk/types.js";
@@ -183,21 +198,12 @@ function parseArguments() {
183
198
  }
184
199
  return directories;
185
200
  }
186
- const directoryArgs = parseArguments();
201
+ // Defer parsing until runServer is called
202
+ let directoryArgs = [];
187
203
  // Async initialization function to be called in runServer()
188
204
  async function initializeDirectories() {
189
205
  // Detect MCP mode: stdin/stdout are NOT TTY (piped) = MCP mode
190
- const isMCP = (!process.stdin.isTTY && !process.stdout.isTTY) ||
191
- process.argv.some((arg) => arg.includes("mcp") || arg.includes("stdio"));
192
- // During MCP operation, suppress ALL console output to prevent protocol corruption
193
- if (isMCP) {
194
- const noop = () => { };
195
- console.error = noop;
196
- console.log = noop;
197
- console.warn = noop;
198
- console.info = noop;
199
- console.debug = noop;
200
- }
206
+ const isMCP = _isMCP;
201
207
  if (!isMCP &&
202
208
  (approvedFoldersFromArgs.length > 0 ||
203
209
  directoryArgs.length > 0 ||
@@ -631,6 +637,7 @@ export async function runServer() {
631
637
  // Initialize directories before starting server
632
638
  // BUT: Don't exit on errors during MCP mode - just log and continue
633
639
  try {
640
+ directoryArgs = parseArguments();
634
641
  await initializeDirectories();
635
642
  }
636
643
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n0zer0d4y/vulcan-file-ops",
3
- "version": "1.2.10",
3
+ "version": "1.2.11",
4
4
  "mcpName": "io.github.n0zer0d4y/vulcan-file-ops",
5
5
  "description": "MCP server for AI assistants: read, write, edit, and manage files securely on local filesystem.",
6
6
  "license": "MIT",