feishu-user-token-mcp-v2
Version:
A Model Context Protocol (MCP) server for Feishu user token management and authentication
30 lines (29 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stopFeishuMcp = stopFeishuMcp;
exports.startFeishuMcp = startFeishuMcp;
const child_process_1 = require("child_process");
function stopFeishuMcp() {
return new Promise((resolve) => {
(0, child_process_1.exec)('pkill -f "feishu-mcp"', (error, stdout, stderr) => {
if (error) {
console.warn(`Warning stopping feishu-mcp: ${stderr}`);
}
else {
console.log('feishu-mcp stopped successfully');
}
resolve();
});
});
}
function startFeishuMcp(appId, appSecret, userToken) {
const command = `npx -p @mcp/feishu-mcp feishu-mcp -a "${appId}" -s "${appSecret}" -u "${userToken}"`;
console.log(`Starting feishu-mcp with command: ${command}`);
(0, child_process_1.exec)(command, (error, stdout, stderr) => {
if (error) {
console.warn(`Warning starting feishu-mcp: ${stderr}`);
return;
}
console.log(`feishu-mcp started: ${stdout}`);
});
}