keyexec 0.1.0__tar.gz
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.
- keyexec-0.1.0/LICENSE +21 -0
- keyexec-0.1.0/PKG-INFO +146 -0
- keyexec-0.1.0/README.md +123 -0
- keyexec-0.1.0/pyproject.toml +86 -0
- keyexec-0.1.0/pyproject.toml.orig +63 -0
- keyexec-0.1.0/src/keyexec/__init__.py +0 -0
- keyexec-0.1.0/src/keyexec/cli.py +241 -0
- keyexec-0.1.0/src/keyexec/config.py +88 -0
- keyexec-0.1.0/src/keyexec/doctor.py +117 -0
- keyexec-0.1.0/src/keyexec/errors.py +71 -0
- keyexec-0.1.0/src/keyexec/inject.py +118 -0
- keyexec-0.1.0/src/keyexec/keychain.py +153 -0
- keyexec-0.1.0/src/keyexec/migrate.py +366 -0
- keyexec-0.1.0/src/keyexec/store.py +86 -0
- keyexec-0.1.0/src/keyexec/wincred.py +112 -0
- keyexec-0.1.0/src/keyexec/winjob.py +71 -0
keyexec-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Volkan Çiçek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
keyexec-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: keyexec
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Keep MCP server tokens in the OS credential store and inject them only at launch.
|
|
5
|
+
Keywords: mcp,claude-code,secrets,credential-manager,keychain,tokens
|
|
6
|
+
Author: Volkan Çiçek
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Topic :: Security
|
|
17
|
+
Classifier: Topic :: Utilities
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Project-URL: Repository, https://github.com/volkanncicek/keyexec
|
|
20
|
+
Project-URL: Issues, https://github.com/volkanncicek/keyexec/issues
|
|
21
|
+
Project-URL: Changelog, https://github.com/volkanncicek/keyexec/blob/main/CHANGELOG.md
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# keyexec
|
|
25
|
+
|
|
26
|
+
[](https://pypi.org/project/keyexec/)
|
|
27
|
+
[](https://pypi.org/project/keyexec/)
|
|
28
|
+
[](https://github.com/volkanncicek/keyexec/actions/workflows/ci.yml)
|
|
29
|
+
[](https://github.com/volkanncicek/keyexec/blob/main/LICENSE)
|
|
30
|
+
|
|
31
|
+
Claude Code keeps the tokens of your MCP servers in plaintext in `~/.claude.json`. keyexec moves them into the operating system's credential store (Windows Credential Manager or the macOS Keychain) and leaves a command in their place, so the config file no longer holds any secret and a token is handed to its server only when the server starts.
|
|
32
|
+
|
|
33
|
+
It is a launcher, not a password manager: no vault, no sync, no daemon, no runtime dependencies. It protects the file, not your account: any program running as you can still read the credential store ([Security model](#security-model)).
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
**Status:** in daily use on Windows, and checked end to end on macOS, where a Claude Code session connected one stdio and one http server through keyexec.
|
|
38
|
+
|
|
39
|
+
## How it works
|
|
40
|
+
|
|
41
|
+
Each token becomes an **entry**: a named item in the credential store, such as `github-token`. `keyexec migrate --apply` stores the token as that entry and rewrites the server to start through keyexec:
|
|
42
|
+
|
|
43
|
+
```diff
|
|
44
|
+
"github": {
|
|
45
|
+
- "command": "npx",
|
|
46
|
+
- "args": ["-y", "gh-mcp"],
|
|
47
|
+
- "env": { "GITHUB_TOKEN": "ghp_..." }
|
|
48
|
+
+ "command": "C:\\Users\\me\\.local\\bin\\keyexec.exe",
|
|
49
|
+
+ "args": ["run", "--env", "GITHUB_TOKEN=github-token", "--", "npx", "-y", "gh-mcp"]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
When Claude Code starts the server, `keyexec run` reads `github-token` from the store, starts `npx -y gh-mcp` with `GITHUB_TOKEN` set, and stays out of the way: it writes nothing to the server's stdio stream, ends the server when it is itself stopped, and returns the server's exit code. An http server gets a `headersHelper` instead, a command whose output Claude Code sends as request headers: `"<keyexec>" headers --header "Authorization=Bearer {acme-authorization}"`.
|
|
54
|
+
|
|
55
|
+
keyexec reads the user and local scopes in `~/.claude.json`. A repo's `.mcp.json` is not touched; keep its tokens out of the repo by hand.
|
|
56
|
+
|
|
57
|
+
`run` is not tied to MCP: `keyexec run --env GH_TOKEN=github-token -- gh pr status` gives any command a token without it sitting in your shell profile.
|
|
58
|
+
|
|
59
|
+
## Quickstart
|
|
60
|
+
|
|
61
|
+
You need [uv](https://docs.astral.sh/uv/) (it fetches a suitable Python) and Claude Code on Windows or macOS.
|
|
62
|
+
|
|
63
|
+
```shell
|
|
64
|
+
uv tool install keyexec
|
|
65
|
+
keyexec migrate # the plan: which plaintext tokens would move, to which entries; changes nothing
|
|
66
|
+
keyexec migrate --apply # store them, back up the config, rewrite it; asks first
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Then restart your Claude Code sessions, or reconnect each server from `/mcp`, and check that the servers connect. `keyexec doctor` confirms every entry the config refers to exists:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
Config: C:\Users\me\.claude.json
|
|
73
|
+
github [stdio]
|
|
74
|
+
ok github-token
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Once the servers work, delete the backup `migrate` named (`~/.claude.json.keyexec-backup-<timestamp>`): it still holds the plaintext tokens, and `doctor` warns until it is gone.
|
|
78
|
+
|
|
79
|
+
If the plan is empty, no token was found in plaintext. If `--apply` stops because the config changed, Claude Code wrote the file meanwhile; run it again.
|
|
80
|
+
|
|
81
|
+
To add a server by hand, store the token first, then point the server at keyexec:
|
|
82
|
+
|
|
83
|
+
```shell
|
|
84
|
+
keyexec set github-token # prompts for the value; never read from argv or a pipe
|
|
85
|
+
claude mcp add github -- keyexec run --env GITHUB_TOKEN=github-token -- <server command> [args...]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
A rotated token is replaced with `keyexec set <entry> --force`; the config does not change.
|
|
89
|
+
|
|
90
|
+
## Install and upgrade
|
|
91
|
+
|
|
92
|
+
Install it as a tool rather than running it through `uvx`: `migrate --apply` writes the absolute path of the installed `keyexec` into the config, and a `uvx` cache path can disappear.
|
|
93
|
+
|
|
94
|
+
Upgrade with `uv tool upgrade keyexec`. It updates the tool in place and works while Claude Code runs. On Windows, never `uv tool install --force keyexec` while it runs: that deletes and recreates the tool environment, whose `python.exe` every running server holds open, and leaves the tool without its packages.
|
|
95
|
+
|
|
96
|
+
Releases are built by GitHub Actions and published to PyPI through trusted publishing, with attestations, so no long-lived upload token exists.
|
|
97
|
+
|
|
98
|
+
## Commands
|
|
99
|
+
|
|
100
|
+
Besides `migrate` and `doctor`, `set`, `list` and `delete` manage entries by hand, and `run` and `headers` are what a rewritten config calls. The commands that report something print JSON when their output is piped. [docs/cli.md](https://github.com/volkanncicek/keyexec/blob/main/docs/cli.md) lists every command with its flags, and has the JSON formats, the exit codes, and exactly what `migrate` treats as a secret, how it names entries and what it skips.
|
|
101
|
+
|
|
102
|
+
## Security model
|
|
103
|
+
|
|
104
|
+
What it protects against: tokens sitting in plaintext in `~/.claude.json`, and leaking from there through backups, dotfile syncs, screenshares, pasted configs, or tools and agents that read the file.
|
|
105
|
+
|
|
106
|
+
What it does **not** protect against:
|
|
107
|
+
|
|
108
|
+
- **Any process running as you can read the credential store.** On Windows, Credential Manager entries are readable by every process of the logged-in user without a prompt; on macOS the Keychain may prompt per application, but "Always Allow" removes that barrier. An agent with shell access can read an entry with a few lines of code.
|
|
109
|
+
- A running server holds its token in its environment, visible to same-user tools that inspect process environments.
|
|
110
|
+
- The migrate backup holds the plaintext tokens until you delete it.
|
|
111
|
+
- A secret passed in a server's command-line arguments rather than `env` or `headers` is not moved; `migrate` warns when it sees one.
|
|
112
|
+
|
|
113
|
+
keyexec makes no network requests and writes no log or file of its own besides the migrate backup. Report a vulnerability privately as described in [SECURITY.md](https://github.com/volkanncicek/keyexec/blob/main/SECURITY.md).
|
|
114
|
+
|
|
115
|
+
## Troubleshooting
|
|
116
|
+
|
|
117
|
+
- **A server does not connect after the migration.** Run `keyexec doctor`: a `MISSING` entry is one the store does not hold; store it with `keyexec set <entry>`. To see why a server will not start, run its `command` and `args` from the config in a terminal: keyexec says what is wrong before it starts anything.
|
|
118
|
+
- **`keyexec` exits 4.** The credential store refused or is locked; on macOS, unlock the login Keychain. Over SSH the login Keychain usually stays locked: `doctor` and `list`, which read no value, still work, but a server started there cannot get its token. On Linux keyexec refuses to run rather than fall back to a plaintext store.
|
|
119
|
+
- **macOS asks for your password.** Entries keyexec wrote are read without a prompt, because the Keychain lets the program that created an item read it. Deleting an entry asks for your login password, and a different Python executable, for instance after a `uv tool upgrade` that replaces it, may be asked to confirm access.
|
|
120
|
+
- **A value is refused as too long.** Credential Manager limits the size of one entry; [Platform notes](#platform-notes) has the number.
|
|
121
|
+
|
|
122
|
+
## Undoing it
|
|
123
|
+
|
|
124
|
+
For one server: set its `command` back to the first word after `--` in `args`, set `args` to the rest, and put the token back under `env` (for an http server, remove `headersHelper` and put the header back under `headers`). Then `keyexec delete <entry>`. Restoring the backup instead would undo whatever Claude Code wrote since.
|
|
125
|
+
|
|
126
|
+
For everything: undo each server, delete each entry `keyexec list` shows, then `uv tool uninstall keyexec`.
|
|
127
|
+
|
|
128
|
+
## Platform notes
|
|
129
|
+
|
|
130
|
+
**Windows.** Each entry is a generic credential with the target `keyexec:<entry>`, kept on this machine only rather than roaming with a domain profile, and holding at most 2560 bytes; `cmdkey /list` shows the names without the values. When Claude Code exits, or keyexec is killed outright, the server and everything it started end with it.
|
|
131
|
+
|
|
132
|
+
**macOS.** Each entry is a generic password in the login Keychain with the service `keyexec` and the entry name as account. An update changes the item in place, so an "Always Allow" survives a rotated token. `run` forwards SIGINT, SIGTERM and SIGHUP to the server.
|
|
133
|
+
|
|
134
|
+
**Linux.** Not supported: keyexec talks to Windows Credential Manager and the macOS Keychain only. [envchain](https://github.com/sorah/envchain) does the same job well on Linux and macOS.
|
|
135
|
+
|
|
136
|
+
## Development
|
|
137
|
+
|
|
138
|
+
See [CONTRIBUTING.md](https://github.com/volkanncicek/keyexec/blob/main/CONTRIBUTING.md) for setup and the checks CI runs, and [docs/design.md](https://github.com/volkanncicek/keyexec/blob/main/docs/design.md) for why the code is shaped the way it is.
|
|
139
|
+
|
|
140
|
+
## Not affiliated with Anthropic
|
|
141
|
+
|
|
142
|
+
keyexec is an independent tool for Claude Code users. It is not made, endorsed or supported by Anthropic.
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
[MIT](https://github.com/volkanncicek/keyexec/blob/main/LICENSE)
|
keyexec-0.1.0/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# keyexec
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/keyexec/)
|
|
4
|
+
[](https://pypi.org/project/keyexec/)
|
|
5
|
+
[](https://github.com/volkanncicek/keyexec/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/volkanncicek/keyexec/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
Claude Code keeps the tokens of your MCP servers in plaintext in `~/.claude.json`. keyexec moves them into the operating system's credential store (Windows Credential Manager or the macOS Keychain) and leaves a command in their place, so the config file no longer holds any secret and a token is handed to its server only when the server starts.
|
|
9
|
+
|
|
10
|
+
It is a launcher, not a password manager: no vault, no sync, no daemon, no runtime dependencies. It protects the file, not your account: any program running as you can still read the credential store ([Security model](#security-model)).
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
**Status:** in daily use on Windows, and checked end to end on macOS, where a Claude Code session connected one stdio and one http server through keyexec.
|
|
15
|
+
|
|
16
|
+
## How it works
|
|
17
|
+
|
|
18
|
+
Each token becomes an **entry**: a named item in the credential store, such as `github-token`. `keyexec migrate --apply` stores the token as that entry and rewrites the server to start through keyexec:
|
|
19
|
+
|
|
20
|
+
```diff
|
|
21
|
+
"github": {
|
|
22
|
+
- "command": "npx",
|
|
23
|
+
- "args": ["-y", "gh-mcp"],
|
|
24
|
+
- "env": { "GITHUB_TOKEN": "ghp_..." }
|
|
25
|
+
+ "command": "C:\\Users\\me\\.local\\bin\\keyexec.exe",
|
|
26
|
+
+ "args": ["run", "--env", "GITHUB_TOKEN=github-token", "--", "npx", "-y", "gh-mcp"]
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
When Claude Code starts the server, `keyexec run` reads `github-token` from the store, starts `npx -y gh-mcp` with `GITHUB_TOKEN` set, and stays out of the way: it writes nothing to the server's stdio stream, ends the server when it is itself stopped, and returns the server's exit code. An http server gets a `headersHelper` instead, a command whose output Claude Code sends as request headers: `"<keyexec>" headers --header "Authorization=Bearer {acme-authorization}"`.
|
|
31
|
+
|
|
32
|
+
keyexec reads the user and local scopes in `~/.claude.json`. A repo's `.mcp.json` is not touched; keep its tokens out of the repo by hand.
|
|
33
|
+
|
|
34
|
+
`run` is not tied to MCP: `keyexec run --env GH_TOKEN=github-token -- gh pr status` gives any command a token without it sitting in your shell profile.
|
|
35
|
+
|
|
36
|
+
## Quickstart
|
|
37
|
+
|
|
38
|
+
You need [uv](https://docs.astral.sh/uv/) (it fetches a suitable Python) and Claude Code on Windows or macOS.
|
|
39
|
+
|
|
40
|
+
```shell
|
|
41
|
+
uv tool install keyexec
|
|
42
|
+
keyexec migrate # the plan: which plaintext tokens would move, to which entries; changes nothing
|
|
43
|
+
keyexec migrate --apply # store them, back up the config, rewrite it; asks first
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then restart your Claude Code sessions, or reconnect each server from `/mcp`, and check that the servers connect. `keyexec doctor` confirms every entry the config refers to exists:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
Config: C:\Users\me\.claude.json
|
|
50
|
+
github [stdio]
|
|
51
|
+
ok github-token
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Once the servers work, delete the backup `migrate` named (`~/.claude.json.keyexec-backup-<timestamp>`): it still holds the plaintext tokens, and `doctor` warns until it is gone.
|
|
55
|
+
|
|
56
|
+
If the plan is empty, no token was found in plaintext. If `--apply` stops because the config changed, Claude Code wrote the file meanwhile; run it again.
|
|
57
|
+
|
|
58
|
+
To add a server by hand, store the token first, then point the server at keyexec:
|
|
59
|
+
|
|
60
|
+
```shell
|
|
61
|
+
keyexec set github-token # prompts for the value; never read from argv or a pipe
|
|
62
|
+
claude mcp add github -- keyexec run --env GITHUB_TOKEN=github-token -- <server command> [args...]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
A rotated token is replaced with `keyexec set <entry> --force`; the config does not change.
|
|
66
|
+
|
|
67
|
+
## Install and upgrade
|
|
68
|
+
|
|
69
|
+
Install it as a tool rather than running it through `uvx`: `migrate --apply` writes the absolute path of the installed `keyexec` into the config, and a `uvx` cache path can disappear.
|
|
70
|
+
|
|
71
|
+
Upgrade with `uv tool upgrade keyexec`. It updates the tool in place and works while Claude Code runs. On Windows, never `uv tool install --force keyexec` while it runs: that deletes and recreates the tool environment, whose `python.exe` every running server holds open, and leaves the tool without its packages.
|
|
72
|
+
|
|
73
|
+
Releases are built by GitHub Actions and published to PyPI through trusted publishing, with attestations, so no long-lived upload token exists.
|
|
74
|
+
|
|
75
|
+
## Commands
|
|
76
|
+
|
|
77
|
+
Besides `migrate` and `doctor`, `set`, `list` and `delete` manage entries by hand, and `run` and `headers` are what a rewritten config calls. The commands that report something print JSON when their output is piped. [docs/cli.md](https://github.com/volkanncicek/keyexec/blob/main/docs/cli.md) lists every command with its flags, and has the JSON formats, the exit codes, and exactly what `migrate` treats as a secret, how it names entries and what it skips.
|
|
78
|
+
|
|
79
|
+
## Security model
|
|
80
|
+
|
|
81
|
+
What it protects against: tokens sitting in plaintext in `~/.claude.json`, and leaking from there through backups, dotfile syncs, screenshares, pasted configs, or tools and agents that read the file.
|
|
82
|
+
|
|
83
|
+
What it does **not** protect against:
|
|
84
|
+
|
|
85
|
+
- **Any process running as you can read the credential store.** On Windows, Credential Manager entries are readable by every process of the logged-in user without a prompt; on macOS the Keychain may prompt per application, but "Always Allow" removes that barrier. An agent with shell access can read an entry with a few lines of code.
|
|
86
|
+
- A running server holds its token in its environment, visible to same-user tools that inspect process environments.
|
|
87
|
+
- The migrate backup holds the plaintext tokens until you delete it.
|
|
88
|
+
- A secret passed in a server's command-line arguments rather than `env` or `headers` is not moved; `migrate` warns when it sees one.
|
|
89
|
+
|
|
90
|
+
keyexec makes no network requests and writes no log or file of its own besides the migrate backup. Report a vulnerability privately as described in [SECURITY.md](https://github.com/volkanncicek/keyexec/blob/main/SECURITY.md).
|
|
91
|
+
|
|
92
|
+
## Troubleshooting
|
|
93
|
+
|
|
94
|
+
- **A server does not connect after the migration.** Run `keyexec doctor`: a `MISSING` entry is one the store does not hold; store it with `keyexec set <entry>`. To see why a server will not start, run its `command` and `args` from the config in a terminal: keyexec says what is wrong before it starts anything.
|
|
95
|
+
- **`keyexec` exits 4.** The credential store refused or is locked; on macOS, unlock the login Keychain. Over SSH the login Keychain usually stays locked: `doctor` and `list`, which read no value, still work, but a server started there cannot get its token. On Linux keyexec refuses to run rather than fall back to a plaintext store.
|
|
96
|
+
- **macOS asks for your password.** Entries keyexec wrote are read without a prompt, because the Keychain lets the program that created an item read it. Deleting an entry asks for your login password, and a different Python executable, for instance after a `uv tool upgrade` that replaces it, may be asked to confirm access.
|
|
97
|
+
- **A value is refused as too long.** Credential Manager limits the size of one entry; [Platform notes](#platform-notes) has the number.
|
|
98
|
+
|
|
99
|
+
## Undoing it
|
|
100
|
+
|
|
101
|
+
For one server: set its `command` back to the first word after `--` in `args`, set `args` to the rest, and put the token back under `env` (for an http server, remove `headersHelper` and put the header back under `headers`). Then `keyexec delete <entry>`. Restoring the backup instead would undo whatever Claude Code wrote since.
|
|
102
|
+
|
|
103
|
+
For everything: undo each server, delete each entry `keyexec list` shows, then `uv tool uninstall keyexec`.
|
|
104
|
+
|
|
105
|
+
## Platform notes
|
|
106
|
+
|
|
107
|
+
**Windows.** Each entry is a generic credential with the target `keyexec:<entry>`, kept on this machine only rather than roaming with a domain profile, and holding at most 2560 bytes; `cmdkey /list` shows the names without the values. When Claude Code exits, or keyexec is killed outright, the server and everything it started end with it.
|
|
108
|
+
|
|
109
|
+
**macOS.** Each entry is a generic password in the login Keychain with the service `keyexec` and the entry name as account. An update changes the item in place, so an "Always Allow" survives a rotated token. `run` forwards SIGINT, SIGTERM and SIGHUP to the server.
|
|
110
|
+
|
|
111
|
+
**Linux.** Not supported: keyexec talks to Windows Credential Manager and the macOS Keychain only. [envchain](https://github.com/sorah/envchain) does the same job well on Linux and macOS.
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
See [CONTRIBUTING.md](https://github.com/volkanncicek/keyexec/blob/main/CONTRIBUTING.md) for setup and the checks CI runs, and [docs/design.md](https://github.com/volkanncicek/keyexec/blob/main/docs/design.md) for why the code is shaped the way it is.
|
|
116
|
+
|
|
117
|
+
## Not affiliated with Anthropic
|
|
118
|
+
|
|
119
|
+
keyexec is an independent tool for Claude Code users. It is not made, endorsed or supported by Anthropic.
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
[MIT](https://github.com/volkanncicek/keyexec/blob/main/LICENSE)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "keyexec"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Keep MCP server tokens in the OS credential store and inject them only at launch."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
keywords = [
|
|
10
|
+
"mcp",
|
|
11
|
+
"claude-code",
|
|
12
|
+
"secrets",
|
|
13
|
+
"credential-manager",
|
|
14
|
+
"keychain",
|
|
15
|
+
"tokens",
|
|
16
|
+
]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 3 - Alpha",
|
|
19
|
+
"Environment :: Console",
|
|
20
|
+
"Intended Audience :: Developers",
|
|
21
|
+
"Operating System :: Microsoft :: Windows",
|
|
22
|
+
"Operating System :: MacOS",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
25
|
+
"Topic :: Security",
|
|
26
|
+
"Topic :: Utilities",
|
|
27
|
+
]
|
|
28
|
+
dependencies = []
|
|
29
|
+
|
|
30
|
+
[[project.authors]]
|
|
31
|
+
name = "Volkan Çiçek"
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Repository = "https://github.com/volkanncicek/keyexec"
|
|
35
|
+
Issues = "https://github.com/volkanncicek/keyexec/issues"
|
|
36
|
+
Changelog = "https://github.com/volkanncicek/keyexec/blob/main/CHANGELOG.md"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
keyexec = "keyexec.cli:main"
|
|
40
|
+
|
|
41
|
+
[build-system]
|
|
42
|
+
requires = ["uv_build>=0.13.9,<0.14.0"]
|
|
43
|
+
build-backend = "uv_build"
|
|
44
|
+
|
|
45
|
+
[dependency-groups]
|
|
46
|
+
dev = [
|
|
47
|
+
"prek>=0.5.7",
|
|
48
|
+
"pyright[nodejs]>=1.1.414",
|
|
49
|
+
"pytest>=9.2.0",
|
|
50
|
+
"ruff>=0.17.6",
|
|
51
|
+
"ty==0.0.112",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[tool.ruff]
|
|
55
|
+
line-length = 160
|
|
56
|
+
|
|
57
|
+
[tool.ruff.lint]
|
|
58
|
+
select = [
|
|
59
|
+
"E",
|
|
60
|
+
"F",
|
|
61
|
+
"W",
|
|
62
|
+
"I",
|
|
63
|
+
"UP",
|
|
64
|
+
"B",
|
|
65
|
+
"SIM",
|
|
66
|
+
"PTH",
|
|
67
|
+
"FURB",
|
|
68
|
+
"RUF",
|
|
69
|
+
"C4",
|
|
70
|
+
"TID",
|
|
71
|
+
"DTZ",
|
|
72
|
+
]
|
|
73
|
+
ignore = ["E501"]
|
|
74
|
+
|
|
75
|
+
[tool.pyright]
|
|
76
|
+
include = [
|
|
77
|
+
"src",
|
|
78
|
+
"tests",
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
[tool.pytest]
|
|
82
|
+
testpaths = ["tests"]
|
|
83
|
+
addopts = [
|
|
84
|
+
"--strict-markers",
|
|
85
|
+
"--strict-config",
|
|
86
|
+
]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "keyexec"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Keep MCP server tokens in the OS credential store and inject them only at launch."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [{ name = "Volkan Çiçek" }]
|
|
10
|
+
keywords = ["mcp", "claude-code", "secrets", "credential-manager", "keychain", "tokens"]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 3 - Alpha",
|
|
13
|
+
"Environment :: Console",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
# No `License :: OSI Approved` classifier: PyPI rejects an upload that pairs one with the `license` expression above.
|
|
16
|
+
"Operating System :: Microsoft :: Windows",
|
|
17
|
+
"Operating System :: MacOS",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Topic :: Security",
|
|
21
|
+
"Topic :: Utilities",
|
|
22
|
+
]
|
|
23
|
+
dependencies = []
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Repository = "https://github.com/volkanncicek/keyexec"
|
|
27
|
+
Issues = "https://github.com/volkanncicek/keyexec/issues"
|
|
28
|
+
Changelog = "https://github.com/volkanncicek/keyexec/blob/main/CHANGELOG.md"
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
keyexec = "keyexec.cli:main"
|
|
32
|
+
|
|
33
|
+
[build-system]
|
|
34
|
+
requires = ["uv_build>=0.13.9,<0.14.0"]
|
|
35
|
+
build-backend = "uv_build"
|
|
36
|
+
|
|
37
|
+
[dependency-groups]
|
|
38
|
+
dev = [
|
|
39
|
+
"prek>=0.5.7",
|
|
40
|
+
"pyright[nodejs]>=1.1.414",
|
|
41
|
+
"pytest>=9.2.0",
|
|
42
|
+
"ruff>=0.17.6",
|
|
43
|
+
# ty is 0.0.x and states its diagnostics may change in any release, so it is pinned exactly and runs beside pyright rather than instead of it.
|
|
44
|
+
"ty==0.0.112",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
line-length = 160
|
|
49
|
+
|
|
50
|
+
[tool.ruff.lint]
|
|
51
|
+
select = ["E", "F", "W", "I", "UP", "B", "SIM", "PTH", "FURB", "RUF", "C4", "TID", "DTZ"]
|
|
52
|
+
ignore = [
|
|
53
|
+
# The formatter owns line width; a docstring or message is one line however long, never hard-wrapped.
|
|
54
|
+
"E501",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[tool.pyright]
|
|
58
|
+
include = ["src", "tests"]
|
|
59
|
+
|
|
60
|
+
[tool.pytest]
|
|
61
|
+
testpaths = ["tests"]
|
|
62
|
+
# --strict-config turns a typo in this table into an error instead of a silently ignored setting.
|
|
63
|
+
addopts = ["--strict-markers", "--strict-config"]
|
|
File without changes
|