
rekey
io.github.Ezra-Black由 GitHub 账号 Ezra-Black 发布v0.1.0更新于 Nov 1, 2026
Rotate API keys across AWS, GitLab, Cloudflare, OpenAI & more. Secrets never reach the model.
概览
本地 CLI 兼 MCP 服务器,用于在多个服务商之间轮换 API 密钥与令牌,并把新密钥投递到预设目标,密钥不会进入模型。
- 可以做什么
- 列出服务商、检查凭据与密钥管理权限、列出密钥(默认启用的只读工具)
- 轮换密钥,新密钥只投递到配置文件中定义的消费者(需 --allow-rotate)
- 停用或删除旧密钥,并拒绝操作服务器自身登录所用的密钥(需 --allow-retire)
- 密钥值不会返回给客户端,凭据来自环境变量或已保存的登录
- 适用场景
- 适合让助手协助完成日常凭据轮换,覆盖 AWS、GitLab、Cloudflare、Datadog、npm、Docker Hub、OpenAI、Twilio、SendGrid 等服务商,并把新密钥写入 .env 文件、GitHub Actions secret、AWS SSM、文件或系统钥匙串。
- 运行要求
- 以本地进程运行(cargo install rekey 或预编译二进制),支持 macOS、Linux、Windows。服务商凭据来自环境变量(如 GITLAB_TOKEN、CLOUDFLARE_API_TOKEN、OPENAI_ADMIN_KEY)或系统钥匙串中保存的登录。部分服务商需要外部 CLI:aws、npm,以及用于 GitHub Actions secret 的 gh。轮换类工具需以 --allow-rotate 和 --allow-retire 启用。
安装
在 SourceWeft 中
- 打开 控制台中的 rekey,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
rekey
Rotate API keys and tokens across providers from one CLI: mint the new key, push it to everything that uses it, verify it, retire the old one. Includes an MCP server.
Only touches accounts you administer — every provider acts with your own credential.
CLI — rotate a GitLab token straight into a .env file:
[rekey rotating a GitLab token from the CLI]
MCP — Claude rotating the same token through rekey mcp; the secret
never reaches the model:
[Claude rotating a GitLab token via the rekey MCP server]
Install
Prebuilt binaries for macOS, Linux and Windows: Releases.
Or with Rust (stable):
OS keychain support (macOS Keychain, Windows Credential Manager, Linux Secret Service) is built in.
Quick start
Practice on a throwaway GitLab token first. Every command below is safe to
copy; replace 28550311 with your own ids from step 3.
1. Make a throwaway token to rotate. In GitLab → Access tokens, create a
token named kr-test (any scope).
2. Log in. Opens GitLab's token page with the name and api scope
pre-filled. Click Create token, paste it back (input is hidden).
3. Find the key id.
4. Rotate it into a .env file. rekey shows the plan and waits for you.
5. Check and clean up.
Then delete kr-test in GitLab.
For real keys: run rekey rotate gitlab with no arguments — it lets
you pick the key and destination and can save that to rekey.toml, so
the next rotation is one command. In scripts/CI:
Commands
Global: --config <path>, --no-input (fail instead of prompting).
--yes skips confirmation. Omitted args are prompted for in a TTY. Flags go in
any order. stdout carries only list output and --print-secret values;
everything else is stderr.
Destinations
rotate refuses to start unless the new secret has at least one destination.
Repeatable flags: --dotenv, --gh-secret, --ssm.
--delete-old-now deletes the old key right after the new one is delivered.
Config
./rekey.toml, then ~/.config/rekey/config.toml. Contains no
secrets. Interactive rotate can write entries for you.
Consumer types: dot_env_file, github_actions_secret, aws_ssm_parameter,
file, keychain. Match on name/principal for providers that issue a new
id per rotation. Relative paths resolve against the config file. Full example:
rekey.toml.example.
Credentials
Lookup order: environment variable → saved login (rekey login) → prompt
(TTY only, offers to save). Never taken as flags. Rotating the token rekey
signs in with (GitLab, Cloudflare) updates the saved login.
REKEY_DISABLE_KEYCHAIN=1 disables keychain reads/writes.
Providers
AWS needs the aws CLI, npm needs npm, --gh-secret needs gh.
Want another provider? Request it.
Rotation semantics
Without --delete-old-now, an old key with no disabled state stays active;
the output gives the retire command. Exit code is non-zero whenever
something needs attention.
MCP
Secret values are never returned to the client. Credentials come from the environment or saved logins. On macOS, allow Keychain access once after installing a new build.
Security
- Secrets go to subprocesses via stdin, never argv.
- Files rekey creates are 0600; existing
.envpermissions are kept; writes are atomic. - Secret values are printed only with
--print-secret. - Report vulnerabilities privately via the repo's Security tab.
Contributing
- New provider or feature: open an issue.
- Code: see CONTRIBUTING.md. A provider is one file
implementing the
Connectortrait.
Links
- crates.io: rekey
- MCP Registry name — mcp-name: io.github.Ezra-Black/rekey
Credits
Built by Ezra Black — ezrablack.dev.
License
来源:README.md,提交 fe1ab58
工具
0版本历史
1- v0.1.0最新Oct 18, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分