@hqyjswy/qq-email-mcp 1.0.0
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/bin/run.js +30 -0
- package/package.json +12 -0
package/bin/run.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
|
|
5
|
+
// 从环境变量读取邮箱配置(用户通过 env 传入)
|
|
6
|
+
const env = {
|
|
7
|
+
DEFAULT_EMAIL: process.env.DEFAULT_EMAIL,
|
|
8
|
+
EMAIL_PASSWORD: process.env.EMAIL_PASSWORD,
|
|
9
|
+
...process.env
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
console.error('🚀 正在启动 QQ 邮箱 MCP 服务...');
|
|
13
|
+
|
|
14
|
+
// 优先使用 uvx(推荐),如果没有则提示安装 uv
|
|
15
|
+
const command = 'uvx';
|
|
16
|
+
const args = ['qq-email-mcp']; // 这里需要你的 PyPI 包名
|
|
17
|
+
|
|
18
|
+
const child = spawn(command, args, {
|
|
19
|
+
env,
|
|
20
|
+
stdio: 'pipe',
|
|
21
|
+
shell: true
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
child.stdout.pipe(process.stdout);
|
|
25
|
+
child.stderr.pipe(process.stderr);
|
|
26
|
+
process.stdin.pipe(child.stdin);
|
|
27
|
+
|
|
28
|
+
child.on('exit', (code) => {
|
|
29
|
+
process.exit(code);
|
|
30
|
+
});
|