vxtalent-hr-cli 0.2.0 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +108 -107
  2. package/lib/config.mjs +7 -3
  3. package/package.json +1 -1
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
- - The CLI package must be published to npm before `npx -y vxtalent-hr-cli` works outside this repository.
12
-
13
- ## One-command Install
14
-
15
- ```bash
16
- npx -y vxtalent-hr-cli install \
17
- --issuer https://mcp.vxhcm.com \
18
- --platform workbuddy \
19
- --write \
20
- --auth
21
- ```
22
-
23
- The command writes this connector config:
24
-
25
- ```json
26
- {
27
- "mcpServers": {
28
- "vxtalent-hr": {
29
- "type": "stdio",
30
- "command": "npx",
31
- "args": ["-y", "vxtalent-hr-cli", "mcp"],
32
- "env": {
33
- "VXTALENT_ISSUER": "https://mcp.vxhcm.com",
34
- "VXTALENT_MCP_URL": "https://mcp.vxhcm.com/mcp",
35
- "VXTALENT_CLIENT_ID": "vxtalent-hr-cli"
36
- }
37
- }
38
- }
39
- }
40
- ```
41
-
42
- ## Supported Platforms
43
-
44
- | Platform | Config path | `--platform` value |
45
- |---|---|---|
46
- | WorkBuddy | `~/.workbuddy/mcp.json` | `workbuddy` |
47
- | Qwen Work (千问办公) | `~/.qwen-work/mcp.json` | `qwen-work` |
48
- | Doubao Work (豆包工作) | `~/.doubao-work/mcp.json` | `doubao-work` |
49
- | Custom | (via `--config <path>`) | `custom` |
50
-
51
- ## Commands
52
-
53
- ```bash
54
- npx -y vxtalent-hr-cli auth --issuer https://mcp.vxhcm.com
55
- npx -y vxtalent-hr-cli status --issuer https://mcp.vxhcm.com
56
- npx -y vxtalent-hr-cli logout --issuer https://mcp.vxhcm.com
57
- npx -y vxtalent-hr-cli mcp --issuer https://mcp.vxhcm.com
58
- ```
59
-
60
- 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.
61
-
62
- ## Authorization & Logout
63
-
64
- The stdio bridge exposes two extra chat tools so end users do not need the
65
- terminal:
66
-
67
- - `auth_status` ? show whether this device is authorized and when the token expires.
68
- - `auth_logout` ? revoke the local token and delete `~/.vxtalent/auth.json`. After
69
- logout the next tool call triggers a fresh browser authorization automatically.
70
-
71
- Automatic browser authorization is **on by default**: whenever the local token
72
- is missing or expired, the bridge opens the OAuth consent page. Pass
73
- `--no-auto-auth` to disable this and fail with a clear message instead.
74
-
75
- ## Platform-Specific Quick Start
76
-
77
- ### WorkBuddy
78
-
79
- ```bash
80
- npx -y vxtalent-hr-cli install \
81
- --issuer https://mcp.vxhcm.com \
82
- --platform workbuddy \
83
- --write --auth
84
- ```
85
-
86
- ### Qwen Work (千问办公)
87
-
88
- ```bash
89
- npx -y vxtalent-hr-cli install \
90
- --issuer https://mcp.vxhcm.com \
91
- --platform qwen-work \
92
- --write --auth
93
- ```
94
-
95
- ## Doubao Work (豆包工作)
96
-
97
- Doubao's "自定义连接器" dialog supports both STDIO and HTTP transports:
98
-
99
- - STDIO: 服务器名称 `vxtalent-hr`,传输类型 STDIO,命令填 `node`(或
100
- `vxtalent-hr-cli`),参数填 `D:/.../cli/index.mjs mcp`(或 `mcp`),环境变量
101
- 填 `VXTALENT_ISSUER` / `VXTALENT_MCP_URL` / `VXTALENT_CLIENT_ID`。
102
- - HTTP: 传输类型 Streamable HTTP,地址填 `https://mcp.vxhcm.com/mcp`,
103
- 认证选 OAuth,scope 填 `hr:read`(与 WorkBuddy 同一路径,无需 CLI)。
104
-
105
- ```bash
106
- node cli/index.mjs install --issuer https://mcp.vxhcm.com --platform doubao-work --write
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 = args.issuer || process.env.VXTALENT_ISSUER || "";
15
- if (!issuer) {
16
- throw new Error("Missing issuer. Pass --issuer <url> or set VXTALENT_ISSUER.");
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.2.0",
3
+ "version": "0.3.0",
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",