redfox-wechat-mcp 0.4.1
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/README.md +51 -0
- package/cli.js +42 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# redfox-wechat-mcp
|
|
2
|
+
|
|
3
|
+
RedFoxHub WeChat MCP server — installable via npm, zero Python dependencies.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g redfox-wechat-mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Set your API key
|
|
15
|
+
export REDFOX_API_KEY=ak_your_key
|
|
16
|
+
|
|
17
|
+
# Run MCP server (stdio mode, for local MCP clients)
|
|
18
|
+
redfox-wechat-mcp
|
|
19
|
+
|
|
20
|
+
# Run MCP server (HTTP mode)
|
|
21
|
+
redfox-wechat-mcp --transport http --host 0.0.0.0 --port 8000
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## MCP Client Configuration
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"redfox-wechat-mcp": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["-y", "redfox-wechat-mcp"],
|
|
32
|
+
"env": {
|
|
33
|
+
"REDFOX_API_KEY": "ak_your_key"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Platforms
|
|
41
|
+
|
|
42
|
+
macOS (Apple Silicon) and Windows (x64). The matching native binary
|
|
43
|
+
is pulled in automatically via optionalDependencies.
|
|
44
|
+
|
|
45
|
+
## API Key
|
|
46
|
+
|
|
47
|
+
Get your API key at: https://redfox.hk/settings/api-keys?source=mcp
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|
package/cli.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawn } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
|
|
8
|
+
const SERVER = "wechat";
|
|
9
|
+
// Package name suffix maps win32 -> windows (npm spam filter avoids "win32").
|
|
10
|
+
const platSeg = process.platform === "win32" ? "windows" : process.platform;
|
|
11
|
+
const binPkg = `redfox-mcp-bin-${platSeg}-${process.arch}`;
|
|
12
|
+
const binName = process.platform === "win32" ? "redfox-mcp.exe" : "redfox-mcp";
|
|
13
|
+
|
|
14
|
+
function findBin() {
|
|
15
|
+
// 1) npm-installed platform package (hoisted or nested)
|
|
16
|
+
try {
|
|
17
|
+
const pkgJson = require.resolve(`${binPkg}/package.json`);
|
|
18
|
+
return path.join(path.dirname(pkgJson), "bin", binName);
|
|
19
|
+
} catch (e) { /* not resolvable, fall through */ }
|
|
20
|
+
// 2) monorepo sibling directory (local development)
|
|
21
|
+
const sibling = path.join(__dirname, "..", binPkg, "bin", binName);
|
|
22
|
+
if (fs.existsSync(sibling)) return sibling;
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const binPath = findBin();
|
|
27
|
+
if (!binPath || !fs.existsSync(binPath)) {
|
|
28
|
+
process.stderr.write(
|
|
29
|
+
`Error: no RedFox MCP binary for ${process.platform}-${process.arch}.\n` +
|
|
30
|
+
`Supported platforms: darwin-arm64, win32-x64 (package: windows-x64)\n`
|
|
31
|
+
);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
try { fs.chmodSync(binPath, 0o755); } catch (e) { /* windows: no-op */ }
|
|
36
|
+
|
|
37
|
+
const child = spawn(binPath, [SERVER, ...process.argv.slice(2)], { stdio: "inherit" });
|
|
38
|
+
child.on("exit", (code, sig) => process.exit(code ?? (sig ? 1 : 0)));
|
|
39
|
+
child.on("error", (err) => {
|
|
40
|
+
process.stderr.write(`Failed to start redfox-mcp: ${err.message}\n`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "redfox-wechat-mcp",
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "RedFoxHub WeChat MCP server",
|
|
5
|
+
"bin": {
|
|
6
|
+
"redfox-wechat-mcp": "./cli.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"cli.js",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"mcp",
|
|
14
|
+
"redfox",
|
|
15
|
+
"ai",
|
|
16
|
+
"model-context-protocol"
|
|
17
|
+
],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/redfox-data/redfox-mcp",
|
|
22
|
+
"directory": "npm/redfox-wechat-mcp"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://redfox.hk",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=14"
|
|
27
|
+
},
|
|
28
|
+
"optionalDependencies": {
|
|
29
|
+
"redfox-mcp-bin-darwin-arm64": "0.4.1",
|
|
30
|
+
"redfox-mcp-bin-windows-x64": "0.4.1"
|
|
31
|
+
}
|
|
32
|
+
}
|