#!/usr/bin/env node
// CRITICAL: Detect MCP mode and suppress console output BEFORE any imports
// MCP servers use stdin/stdout for JSON-RPC via stdio transport
// Detection: stdin/stdout are NOT TTY (piped/redirected) = MCP mode
const isMCP =
(!process.stdin.isTTY && !process.stdout.isTTY) ||
process.argv.some((arg) => arg.includes("mcp") || arg.includes("stdio"));
if (isMCP) {
// Suppress all console methods (but NOT stdout/stderr streams - MCP SDK needs those)
const noop = () => {};
console.log = noop;
console.error = noop;
console.warn = noop;
console.info = noop;
console.debug = noop;
// NOTE: Do NOT redirect process.stdout.write or process.stderr.write
// as the MCP SDK uses those for JSON-RPC protocol communication
}
import { runServer } from "./server/index.js";
// Run the server and handle any fatal errors
runServer().catch((error) => {
// Only show errors when not running under MCP (to avoid protocol corruption)
if (!isMCP) {
// Restore console.error temporarily for fatal errors
const originalError = console.error;
if (originalError.toString() !== "() => {}") {
originalError("Fatal error running server:", error);
}
}
process.exit(1);
});
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/n0zer0d4y/vulcan-file-ops'
If you have feedback or need assistance with the MCP directory API, please join our Discord server