
rekey
io.github.Ezra-BlackPublished by GitHub account Ezra-Blackv0.1.0Updated Nov 1, 2026
Rotate API keys across AWS, GitLab, Cloudflare, OpenAI & more. Secrets never reach the model.
Overview
Local CLI and MCP server that rotates API keys and tokens across providers, delivering new secrets to configured destinations without exposing them to the…
- What you can do
- List providers, check credentials and key-management access, and list keys (read-only, enabled by default)
- Rotate a key, delivering the new secret only to consumers defined in the config file (requires --allow-rotate)
- Retire or deactivate an old key, refusing the server's own login key (requires --allow-retire)
- Secrets are never returned to the client; credentials come from the environment or saved logins
- When to use it
- Useful when you want an assistant to help with routine credential rotation across providers such as AWS, GitLab, Cloudflare, Datadog, npm, Docker Hub, OpenAI, Twilio or SendGrid, with new keys pushed into .env files, GitHub Actions secrets, AWS SSM, files or the OS keychain.
- Requirements
- Runs as a local process (cargo install rekey or prebuilt binaries) on macOS, Linux or Windows. Provider credentials come from environment variables (for example GITLAB_TOKEN, CLOUDFLARE_API_TOKEN, OPENAI_ADMIN_KEY) or saved logins in the OS keychain. Some providers need external CLIs: aws, npm, and gh for GitHub Actions secrets. Rotation tools must be enabled with --allow-rotate and --allow-retire.
Installation
In SourceWeft
- Open rekey in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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
Source: README.md at commit fe1ab58
Tools
0Version history
1- v0.1.0LatestOct 18, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts