vxtalent-hr-cli 0.2.0 → 0.3.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 +108 -107
- package/lib/config.mjs +7 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,107 +1,108 @@
|
|
|
1
|
-
# vxTalent HR CLI
|
|
2
|
-
|
|
3
|
-
Zero-dependency Node.js CLI that turns the remote `hr-tools` MCP into a local stdio MCP server for WorkBuddy, Qwen Work, and other MCP agents.
|
|
4
|
-
|
|
5
|
-
## Requirements
|
|
6
|
-
|
|
7
|
-
- Node.js 18.17+
|
|
8
|
-
- Public OAuth client: `vxtalent-hr-cli`
|
|
9
|
-
- Registered loopback redirect URI: `http://127.0.0.1/callback`
|
|
10
|
-
- Remote MCP transport: Streamable HTTP (`MCP_TRANSPORT=streamable-http`)
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
--
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
npx -y vxtalent-hr-cli
|
|
56
|
-
npx -y vxtalent-hr-cli
|
|
57
|
-
npx -y vxtalent-hr-cli
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
--
|
|
83
|
-
--
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
--
|
|
92
|
-
--
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
# vxTalent HR CLI
|
|
2
|
+
|
|
3
|
+
Zero-dependency Node.js CLI that turns the remote `hr-tools` MCP into a local stdio MCP server for WorkBuddy, Qwen Work, and other MCP agents.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js 18.17+
|
|
8
|
+
- Public OAuth client: `vxtalent-hr-cli`
|
|
9
|
+
- Registered loopback redirect URI: `http://127.0.0.1/callback`
|
|
10
|
+
- Remote MCP transport: Streamable HTTP (`MCP_TRANSPORT=streamable-http`)
|
|
11
|
+
- Default issuer: `https://mcp.vxhcm.com` ? `--issuer` / `VXTALENT_ISSUER` takes priority; if neither is set, the CLI uses this production default.
|
|
12
|
+
- The CLI package must be published to npm before `npx -y vxtalent-hr-cli` works outside this repository.
|
|
13
|
+
|
|
14
|
+
## One-command Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx -y vxtalent-hr-cli install \
|
|
18
|
+
--issuer https://mcp.vxhcm.com \
|
|
19
|
+
--platform workbuddy \
|
|
20
|
+
--write \
|
|
21
|
+
--auth
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The command writes this connector config:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"vxtalent-hr": {
|
|
30
|
+
"type": "stdio",
|
|
31
|
+
"command": "npx",
|
|
32
|
+
"args": ["-y", "vxtalent-hr-cli", "mcp"],
|
|
33
|
+
"env": {
|
|
34
|
+
"VXTALENT_ISSUER": "https://mcp.vxhcm.com",
|
|
35
|
+
"VXTALENT_MCP_URL": "https://mcp.vxhcm.com/mcp",
|
|
36
|
+
"VXTALENT_CLIENT_ID": "vxtalent-hr-cli"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Supported Platforms
|
|
44
|
+
|
|
45
|
+
| Platform | Config path | `--platform` value |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| WorkBuddy | `~/.workbuddy/mcp.json` | `workbuddy` |
|
|
48
|
+
| Qwen Work (千问办公) | `~/.qwen-work/mcp.json` | `qwen-work` |
|
|
49
|
+
| Doubao Work (豆包工作) | `~/.doubao-work/mcp.json` | `doubao-work` |
|
|
50
|
+
| Custom | (via `--config <path>`) | `custom` |
|
|
51
|
+
|
|
52
|
+
## Commands
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx -y vxtalent-hr-cli auth --issuer https://mcp.vxhcm.com
|
|
56
|
+
npx -y vxtalent-hr-cli status --issuer https://mcp.vxhcm.com
|
|
57
|
+
npx -y vxtalent-hr-cli logout --issuer https://mcp.vxhcm.com
|
|
58
|
+
npx -y vxtalent-hr-cli mcp --issuer https://mcp.vxhcm.com
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The CLI uses Authorization Code + PKCE S256. Tokens are stored in `~/.vxtalent/auth.json`, and the access token is refreshed automatically five minutes before expiry.
|
|
62
|
+
|
|
63
|
+
## Authorization & Logout
|
|
64
|
+
|
|
65
|
+
The stdio bridge exposes two extra chat tools so end users do not need the
|
|
66
|
+
terminal:
|
|
67
|
+
|
|
68
|
+
- uth_status — show whether this device is authorized and when the token expires.
|
|
69
|
+
- uth_logout — revoke the local token and delete ~/.vxtalent/auth.json. After
|
|
70
|
+
logout the next tool call triggers a fresh browser authorization automatically.
|
|
71
|
+
|
|
72
|
+
Automatic browser authorization is **on by default**: whenever the local token
|
|
73
|
+
is missing or expired, the bridge opens the OAuth consent page. Pass
|
|
74
|
+
--no-auto-auth to disable this and fail with a clear message instead.
|
|
75
|
+
|
|
76
|
+
## Platform-Specific Quick Start
|
|
77
|
+
|
|
78
|
+
### WorkBuddy
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npx -y vxtalent-hr-cli install \
|
|
82
|
+
--issuer https://mcp.vxhcm.com \
|
|
83
|
+
--platform workbuddy \
|
|
84
|
+
--write --auth
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Qwen Work (千问办公)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx -y vxtalent-hr-cli install \
|
|
91
|
+
--issuer https://mcp.vxhcm.com \
|
|
92
|
+
--platform qwen-work \
|
|
93
|
+
--write --auth
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Doubao Work (豆包工作)
|
|
97
|
+
|
|
98
|
+
Doubao's "自定义连接器" dialog supports both STDIO and HTTP transports:
|
|
99
|
+
|
|
100
|
+
- STDIO: 服务器名称 `vxtalent-hr`,传输类型 STDIO,命令填 `node`(或
|
|
101
|
+
`vxtalent-hr-cli`),参数填 `D:/.../cli/index.mjs mcp`(或 `mcp`),环境变量
|
|
102
|
+
填 `VXTALENT_ISSUER` / `VXTALENT_MCP_URL` / `VXTALENT_CLIENT_ID`。
|
|
103
|
+
- HTTP: 传输类型 Streamable HTTP,地址填 `https://mcp.vxhcm.com/mcp`,
|
|
104
|
+
认证选 OAuth,scope 填 `hr:read`(与 WorkBuddy 同一路径,无需 CLI)。
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
node cli/index.mjs install --issuer https://mcp.vxhcm.com --platform doubao-work --write
|
|
108
|
+
```
|
package/lib/config.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
|
|
3
3
|
export const DEFAULT_CLIENT_ID = "vxtalent-hr-cli";
|
|
4
4
|
export const DEFAULT_SCOPE = "hr:read";
|
|
5
|
+
export const DEFAULT_ISSUER = "https://mcp.vxhcm.com";
|
|
5
6
|
|
|
6
7
|
function normalizeBase(value) {
|
|
7
8
|
const url = new URL(value);
|
|
@@ -11,9 +12,12 @@ function normalizeBase(value) {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export function resolveOptions(args = {}) {
|
|
14
|
-
const issuer =
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const issuer =
|
|
16
|
+
args.issuer || process.env.VXTALENT_ISSUER || DEFAULT_ISSUER;
|
|
17
|
+
if (!args.issuer && !process.env.VXTALENT_ISSUER) {
|
|
18
|
+
console.error(
|
|
19
|
+
`[vxtalent-hr-cli] Using default issuer ${DEFAULT_ISSUER}. Override with --issuer <url> or VXTALENT_ISSUER.`
|
|
20
|
+
);
|
|
17
21
|
}
|
|
18
22
|
const normalizedIssuer = normalizeBase(issuer);
|
|
19
23
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxtalent-hr-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "vxTalent HR MCP CLI for WorkBuddy, Qwen Work, Doubao Work and other MCP agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "
|
|
29
|
+
"url": ""
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|