evolution-api-mcp
Version:
MCP Server for Evolution API v2 - Integrate WhatsApp functionality with Claude Desktop and other MCP clients
37 lines (36 loc) • 1.53 kB
JavaScript
/**
* Evolution API MCP Server
* Entry point for the MCP server that provides Evolution API v2 integration
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ErrorType = exports.EvolutionHttpClient = exports.runCli = void 0;
exports.main = main;
// CRITICAL: MCP STDIO transport requires NOTHING on stdout except MCP messages
// Redirect all console.log to stderr to prevent interference with MCP protocol
const originalConsoleLog = console.log;
console.log = (...args) => {
console.error('[STDOUT-REDIRECT]', ...args);
};
const cli_1 = require("./cli/cli");
Object.defineProperty(exports, "runCli", { enumerable: true, get: function () { return cli_1.runCli; } });
/**
* Legacy main function for backward compatibility
* @deprecated Use runCli() instead
*/
async function main() {
console.warn('Warning: Direct import of main() is deprecated. Use runCli() from ./cli/cli instead.');
await (0, cli_1.runCli)();
}
// Run CLI if called directly
if (require.main === module) {
(0, cli_1.runCli)().catch(error => {
console.error('Failed to start Evolution API MCP Server:', error);
process.exit(1);
});
}
// Export HTTP client for external use
var clients_1 = require("./clients");
Object.defineProperty(exports, "EvolutionHttpClient", { enumerable: true, get: function () { return clients_1.EvolutionHttpClient; } });
Object.defineProperty(exports, "ErrorType", { enumerable: true, get: function () { return clients_1.ErrorType; } });
;