redis-switchboard-mcp 0.1.0 → 0.1.2

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 CHANGED
@@ -61,8 +61,6 @@ The result is stateless from the caller's point of view: `execute` in db 2 and d
61
61
 
62
62
  ### From npm
63
63
 
64
- > The npm package is not published yet. Use the source install below for now.
65
-
66
64
  ```bash
67
65
  npm install -g redis-switchboard-mcp
68
66
  rsm --help
@@ -131,6 +129,11 @@ The same file can be selected with `REDIS_MCP_CONFIG=/path/to/config.json`.
131
129
 
132
130
  > **Note:** diagnostics are written to stderr. Never print to stdout from this process — the MCP transport owns it.
133
131
 
132
+ > **Running from this repository:** version 0.1.2+ includes a `redis-switchboard-mcp` bin alias,
133
+ > so `npx -y redis-switchboard-mcp` works even when the MCP client's `cwd` is the repository root.
134
+ > For 0.1.1 and earlier, add `--prefix` pointing outside the repository or use
135
+ > `node /absolute/path/to/redis-switchboard-mcp/dist/index.js` (run `npm run build` first).
136
+
134
137
  ---
135
138
 
136
139
  <h2 align="center">⚙️ Configuration</h2>
@@ -549,6 +552,70 @@ test/ unit, integration and MCP handshake tests
549
552
 
550
553
  ---
551
554
 
555
+ ## Publishing
556
+
557
+ Publishing is automated by [`.github/workflows/publish.yml`](.github/workflows/publish.yml):
558
+
559
+ - Triggered when a **GitHub Release is published**, or manually via `workflow_dispatch` with an existing tag.
560
+ - Uses **npm Trusted Publishing (GitHub OIDC)** — no long-lived npm token.
561
+ - Checks out the tag, installs dependencies, then runs `npm publish --access public`.
562
+ - `prepublishOnly` runs typecheck, test typecheck, build and the full test suite before uploading.
563
+
564
+ ### One-time setup (Trusted Publishing)
565
+
566
+ 1. Open the npm package settings → **Trusted Publisher** → **GitHub Actions**.
567
+ 2. Fill in:
568
+ - **Organization or user:** `hexiaowu`
569
+ - **Repository:** `redis-switchboard-mcp`
570
+ - **Workflow filename:** `publish.yml` (filename only, include `.yml`; do not include `.github/workflows/`)
571
+ - **Environment name:** leave blank
572
+ 3. Click **Add trusted publisher** — the button is not labeled “Save”.
573
+ 4. The first publish after configuring must succeed within 2 days to validate the setup.
574
+
575
+ If the website does not show the add control, use the npm CLI (npm 11.15+):
576
+
577
+ ```bash
578
+ npm install -g npm@11
579
+ npm trust github redis-switchboard-mcp \
580
+ --file publish.yml \
581
+ --repo hexiaowu/redis-switchboard-mcp \
582
+ --allow-publish \
583
+ --yes
584
+ npm trust list redis-switchboard-mcp
585
+ ```
586
+
587
+ If `npm trust` reports that you must be logged in, run `npm login --auth-type=web` first and complete 2FA.
588
+
589
+ The workflow already has `permissions: id-token: write`; npm generates provenance automatically, so `--provenance` is not required.
590
+
591
+ If you prefer a token instead, add an `NPM_TOKEN` repository secret and put
592
+ `env: { NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} }` on the publish step. Use a granular token with Read and write access and **Bypass 2FA** enabled.
593
+
594
+ ### Release flow
595
+
596
+ ```bash
597
+ # 1. Bump the version and update CHANGELOG.md
598
+ npm version patch --no-git-tag-version
599
+ # edit CHANGELOG.md
600
+
601
+ # 2. Commit and tag
602
+ git add package.json package-lock.json CHANGELOG.md
603
+ git commit -m "chore: release v0.1.2"
604
+ git tag -a v0.1.2 -m "v0.1.2"
605
+ git push origin main --tags
606
+
607
+ # 3. Create a GitHub Release (this triggers the publish workflow)
608
+ gh release create v0.1.2 --title "v0.1.2" --notes "..."
609
+ ```
610
+
611
+ After the workflow succeeds:
612
+
613
+ ```bash
614
+ npm view redis-switchboard-mcp version dist-tags
615
+ ```
616
+
617
+ Do not commit npm tokens or `.npmrc` files to the repository.
618
+
552
619
  ## License
553
620
 
554
621
  MIT
package/README.zh-CN.md CHANGED
@@ -61,8 +61,6 @@ Redis 的 `SELECT` 改变的是**连接**的数据库,而不是某一条命令
61
61
 
62
62
  ### 从 npm 安装
63
63
 
64
- > 目前尚未发布到 npm。请先使用下面的源码安装方式。
65
-
66
64
  ```bash
67
65
  npm install -g redis-switchboard-mcp
68
66
  rsm --help
@@ -133,6 +131,11 @@ node dist/index.js
133
131
 
134
132
  > **注意:** 本进程的诊断日志全部写到 stderr。不要向 stdout 输出任何内容——stdout 属于 MCP 传输。
135
133
 
134
+ > **在本仓库内运行:** 0.1.2+ 增加了 `redis-switchboard-mcp` 这个 bin 别名,
135
+ > 因此即使 MCP 客户端的 `cwd` 是仓库根目录,`npx -y redis-switchboard-mcp` 也能正常启动。
136
+ > 0.1.1 及更早版本需要在 npx 上加 `--prefix` 指向仓库外目录,或使用
137
+ > `node /absolute/path/to/redis-switchboard-mcp/dist/index.js`(先 `npm run build`)。
138
+
136
139
  ---
137
140
 
138
141
  <h2 align="center">⚙️ 配置</h2>
@@ -550,6 +553,70 @@ test/ 单元、集成和 MCP 握手测试
550
553
 
551
554
  ---
552
555
 
556
+ ## 发布
557
+
558
+ 发布由 [`.github/workflows/publish.yml`](.github/workflows/publish.yml) 自动化:
559
+
560
+ - **发布 GitHub Release** 时触发,或通过 `workflow_dispatch` 手动指定已有 tag。
561
+ - 使用 **npm Trusted Publishing(GitHub OIDC)**,不需要长期 npm token。
562
+ - 检出对应 tag、安装依赖,然后执行 `npm publish --access public`。
563
+ - 上传前 `prepublishOnly` 会跑类型检查、测试类型检查、构建和完整测试。
564
+
565
+ ### 一次性配置(Trusted Publishing)
566
+
567
+ 1. 打开 npm 包设置 → **Trusted Publisher** → **GitHub Actions**。
568
+ 2. 填写:
569
+ - **Organization or user:** `hexiaowu`
570
+ - **Repository:** `redis-switchboard-mcp`
571
+ - **Workflow filename:** `publish.yml`(只写文件名,带 `.yml`,不要写 `.github/workflows/`)
572
+ - **Environment name:** 留空
573
+ 3. 点击 **Add trusted publisher** —— 这个按钮不叫 “Save”。
574
+ 4. 配置后的第一次发布要在 **2 天**内成功,否则该 trusted publisher 配置会失效。
575
+
576
+ 如果网页没有显示添加按钮,可以用 npm CLI(npm 11.15+):
577
+
578
+ ```bash
579
+ npm install -g npm@11
580
+ npm trust github redis-switchboard-mcp \
581
+ --file publish.yml \
582
+ --repo hexiaowu/redis-switchboard-mcp \
583
+ --allow-publish \
584
+ --yes
585
+ npm trust list redis-switchboard-mcp
586
+ ```
587
+
588
+ 如果 `npm trust` 提示必须先登录,先执行 `npm login --auth-type=web` 完成 2FA。
589
+
590
+ workflow 已经包含 `permissions: id-token: write`;npm 会自动生成 provenance,不需要额外传 `--provenance`。
591
+
592
+ 如果你更想用 token,可以添加 `NPM_TOKEN` repository secret,并在 publish step 上设置
593
+ `env: { NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} }`。token 需要 Read and write 权限,并开启 **Bypass 2FA**。
594
+
595
+ ### 发布流程
596
+
597
+ ```bash
598
+ # 1. 升版本并更新 CHANGELOG.md
599
+ npm version patch --no-git-tag-version
600
+ # 编辑 CHANGELOG.md
601
+
602
+ # 2. 提交并打 tag
603
+ git add package.json package-lock.json CHANGELOG.md
604
+ git commit -m "chore: release v0.1.2"
605
+ git tag -a v0.1.2 -m "v0.1.2"
606
+ git push origin main --tags
607
+
608
+ # 3. 创建 GitHub Release(会触发发布 workflow)
609
+ gh release create v0.1.2 --title "v0.1.2" --notes "..."
610
+ ```
611
+
612
+ workflow 成功后验证:
613
+
614
+ ```bash
615
+ npm view redis-switchboard-mcp version dist-tags
616
+ ```
617
+
618
+ 不要把 npm token 或 `.npmrc` 提交到仓库。
619
+
553
620
  ## 许可证
554
621
 
555
622
  MIT
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redis-switchboard-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A Redis MCP server that switches logical databases per request instead of relying on the connection-level SELECT command.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -22,7 +22,8 @@
22
22
  }
23
23
  },
24
24
  "bin": {
25
- "rsm": "dist/index.js"
25
+ "rsm": "dist/index.js",
26
+ "redis-switchboard-mcp": "dist/index.js"
26
27
  },
27
28
  "files": [
28
29
  "dist",