knuckles-mcp 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Garrett Sooter
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.
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: knuckles-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server that lets coding agents set up Knuckles sign-in
5
+ Author-email: Garrett Sooter <garrett.sooter@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/gsooter/knuckles
8
+ Project-URL: Documentation, https://gsooter.github.io/knuckles/mcp
9
+ Project-URL: Source, https://github.com/gsooter/knuckles/tree/main/packages/knuckles-mcp
10
+ Project-URL: Issues, https://github.com/gsooter/knuckles/issues
11
+ Keywords: authentication,identity,mcp,knuckles,oauth,passkey
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Security
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: knuckles-cli<0.3,>=0.2
26
+ Requires-Dist: mcp<3,>=2.3
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest<9,>=8.0; extra == "dev"
29
+ Requires-Dist: pytest-cov<6,>=5.0; extra == "dev"
30
+ Requires-Dist: responses<1,>=0.25; extra == "dev"
31
+ Requires-Dist: cryptography<46,>=42.0; extra == "dev"
32
+ Requires-Dist: mypy<2,>=1.9; extra == "dev"
33
+ Requires-Dist: ruff==0.15.11; extra == "dev"
34
+ Requires-Dist: black<25,>=24.0; extra == "dev"
35
+ Requires-Dist: types-requests<3,>=2.31; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # knuckles-mcp
39
+
40
+ An [MCP](https://modelcontextprotocol.io) server that lets a coding
41
+ agent (Claude Code, Cursor, any MCP client) set up sign-in with your
42
+ [Knuckles](https://github.com/gsooter/knuckles) server: create a tenant
43
+ for an app, turn on Google, Apple, email magic links and passkeys, and
44
+ check the result, all from a conversation.
45
+
46
+ It ships with a Claude Code skill, `knuckles-setup`, that walks the
47
+ agent through the whole job, including wiring the SDK into the app.
48
+
49
+ ```bash
50
+ uvx --from knuckles-cli knuckles login --url https://auth.example.com # once; prompts for the admin token
51
+ claude mcp add knuckles -- uvx knuckles-mcp
52
+ uvx knuckles-mcp install-skill # optional: the setup skill
53
+ ```
54
+
55
+ Then ask your agent: *"Add Knuckles sign-in with Google and passkeys to
56
+ this app."*
57
+
58
+ No uv? `pip install knuckles-mcp` gives you both commands; drop the
59
+ `uvx` prefixes.
60
+
61
+ Your Knuckles server needs `KNUCKLES_ADMIN_TOKEN` set (Decision #021).
62
+
63
+ ## How it finds your server
64
+
65
+ The same way the `knuckles` CLI does (it's installed alongside):
66
+
67
+ 1. `KNUCKLES_URL` and `KNUCKLES_ADMIN_TOKEN` in the server's
68
+ environment, e.g. `claude mcp add knuckles -e KNUCKLES_URL=... -- uvx knuckles-mcp`.
69
+ 2. Otherwise the profile saved by `knuckles login`
70
+ (`KNUCKLES_PROFILE` picks one; default `default`).
71
+
72
+ ## Secrets stay out of the conversation
73
+
74
+ No tool takes a secret as an argument or returns one, so nothing
75
+ sensitive ends up in the agent's transcript or tool logs:
76
+
77
+ - `knuckles_create_app` and `knuckles_rotate_secret` write the client
78
+ secret straight into the `.env` file you name. They won't run
79
+ without one.
80
+ - Provider secrets are read from files on your machine: Google's
81
+ `client_secret_*.json`, Apple's `AuthKey_<KEYID>.p8`, or a file
82
+ holding your Resend API key. You can also set
83
+ `KNUCKLES_RESEND_API_KEY` / `KNUCKLES_GOOGLE_CLIENT_SECRET` in the
84
+ server's environment.
85
+ - Tenant rows come back redacted: secrets show as `*_configured`
86
+ booleans.
87
+
88
+ ## Tools
89
+
90
+ | Tool | What it does |
91
+ |---|---|
92
+ | `knuckles_doctor` | Checks the server (health, issuer, JWKS, HTTPS) and each tenant's config. Read-only. |
93
+ | `knuckles_list_apps` / `knuckles_show_app` | List tenants or show one. Read-only. |
94
+ | `knuckles_create_app` | Creates a tenant and writes `KNUCKLES_URL` / `KNUCKLES_CLIENT_ID` / `KNUCKLES_CLIENT_SECRET` into an `.env`. |
95
+ | `knuckles_set_origins` | Replaces a tenant's allowed origins. |
96
+ | `knuckles_rotate_secret` | Mints a new client secret into the `.env`; the old one stops working. |
97
+ | `knuckles_configure_email` | Resend magic-link email. Checks that the domain is verified first. |
98
+ | `knuckles_configure_google` | Google sign-in from the console's downloaded JSON. Warns about redirect URIs on disallowed origins. |
99
+ | `knuckles_configure_apple` | Sign in with Apple from the `.p8` key. Reads the key id from the filename. |
100
+ | `knuckles_configure_passkey` | WebAuthn relying party. Refuses to change an rp_id in use unless forced. |
101
+ | `knuckles_clear_provider` | Removes one sign-in method's config from a tenant. |
102
+
103
+ Errors carry the same codes as the CLI and the API
104
+ (`NOT_LOGGED_IN`, `ADMIN_API_DISABLED`, `APP_CLIENT_NOT_FOUND`,
105
+ `ENV_FILE_CONFLICT`, `EMAIL_DOMAIN_UNVERIFIED`, ...).
106
+
107
+ ## Other clients
108
+
109
+ Any MCP client that launches stdio servers works. For example, in a
110
+ JSON config:
111
+
112
+ ```json
113
+ {
114
+ "mcpServers": {
115
+ "knuckles": { "command": "uvx", "args": ["knuckles-mcp"] }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ## Development
121
+
122
+ ```bash
123
+ pip install -e ../knuckles-cli -e ".[dev]"
124
+ pytest --cov=knuckles_mcp
125
+ ```
126
+
127
+ See Decision #027 in the repo's `DECISIONS.md` for the design.
128
+
129
+ ## Releasing
130
+
131
+ Bump the version in `pyproject.toml` and `__init__.py`, add a
132
+ CHANGELOG entry, merge, then push a tag:
133
+
134
+ ```bash
135
+ git tag knuckles-mcp-vX.Y.Z && git push origin knuckles-mcp-vX.Y.Z
136
+ ```
137
+
138
+ `.github/workflows/release-mcp.yml` tests, builds and publishes to PyPI
139
+ via Trusted Publishing.
140
+
141
+ knuckles-mcp depends on knuckles-cli, so tag the matching knuckles-cli release first.
@@ -0,0 +1,104 @@
1
+ # knuckles-mcp
2
+
3
+ An [MCP](https://modelcontextprotocol.io) server that lets a coding
4
+ agent (Claude Code, Cursor, any MCP client) set up sign-in with your
5
+ [Knuckles](https://github.com/gsooter/knuckles) server: create a tenant
6
+ for an app, turn on Google, Apple, email magic links and passkeys, and
7
+ check the result, all from a conversation.
8
+
9
+ It ships with a Claude Code skill, `knuckles-setup`, that walks the
10
+ agent through the whole job, including wiring the SDK into the app.
11
+
12
+ ```bash
13
+ uvx --from knuckles-cli knuckles login --url https://auth.example.com # once; prompts for the admin token
14
+ claude mcp add knuckles -- uvx knuckles-mcp
15
+ uvx knuckles-mcp install-skill # optional: the setup skill
16
+ ```
17
+
18
+ Then ask your agent: *"Add Knuckles sign-in with Google and passkeys to
19
+ this app."*
20
+
21
+ No uv? `pip install knuckles-mcp` gives you both commands; drop the
22
+ `uvx` prefixes.
23
+
24
+ Your Knuckles server needs `KNUCKLES_ADMIN_TOKEN` set (Decision #021).
25
+
26
+ ## How it finds your server
27
+
28
+ The same way the `knuckles` CLI does (it's installed alongside):
29
+
30
+ 1. `KNUCKLES_URL` and `KNUCKLES_ADMIN_TOKEN` in the server's
31
+ environment, e.g. `claude mcp add knuckles -e KNUCKLES_URL=... -- uvx knuckles-mcp`.
32
+ 2. Otherwise the profile saved by `knuckles login`
33
+ (`KNUCKLES_PROFILE` picks one; default `default`).
34
+
35
+ ## Secrets stay out of the conversation
36
+
37
+ No tool takes a secret as an argument or returns one, so nothing
38
+ sensitive ends up in the agent's transcript or tool logs:
39
+
40
+ - `knuckles_create_app` and `knuckles_rotate_secret` write the client
41
+ secret straight into the `.env` file you name. They won't run
42
+ without one.
43
+ - Provider secrets are read from files on your machine: Google's
44
+ `client_secret_*.json`, Apple's `AuthKey_<KEYID>.p8`, or a file
45
+ holding your Resend API key. You can also set
46
+ `KNUCKLES_RESEND_API_KEY` / `KNUCKLES_GOOGLE_CLIENT_SECRET` in the
47
+ server's environment.
48
+ - Tenant rows come back redacted: secrets show as `*_configured`
49
+ booleans.
50
+
51
+ ## Tools
52
+
53
+ | Tool | What it does |
54
+ |---|---|
55
+ | `knuckles_doctor` | Checks the server (health, issuer, JWKS, HTTPS) and each tenant's config. Read-only. |
56
+ | `knuckles_list_apps` / `knuckles_show_app` | List tenants or show one. Read-only. |
57
+ | `knuckles_create_app` | Creates a tenant and writes `KNUCKLES_URL` / `KNUCKLES_CLIENT_ID` / `KNUCKLES_CLIENT_SECRET` into an `.env`. |
58
+ | `knuckles_set_origins` | Replaces a tenant's allowed origins. |
59
+ | `knuckles_rotate_secret` | Mints a new client secret into the `.env`; the old one stops working. |
60
+ | `knuckles_configure_email` | Resend magic-link email. Checks that the domain is verified first. |
61
+ | `knuckles_configure_google` | Google sign-in from the console's downloaded JSON. Warns about redirect URIs on disallowed origins. |
62
+ | `knuckles_configure_apple` | Sign in with Apple from the `.p8` key. Reads the key id from the filename. |
63
+ | `knuckles_configure_passkey` | WebAuthn relying party. Refuses to change an rp_id in use unless forced. |
64
+ | `knuckles_clear_provider` | Removes one sign-in method's config from a tenant. |
65
+
66
+ Errors carry the same codes as the CLI and the API
67
+ (`NOT_LOGGED_IN`, `ADMIN_API_DISABLED`, `APP_CLIENT_NOT_FOUND`,
68
+ `ENV_FILE_CONFLICT`, `EMAIL_DOMAIN_UNVERIFIED`, ...).
69
+
70
+ ## Other clients
71
+
72
+ Any MCP client that launches stdio servers works. For example, in a
73
+ JSON config:
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "knuckles": { "command": "uvx", "args": ["knuckles-mcp"] }
79
+ }
80
+ }
81
+ ```
82
+
83
+ ## Development
84
+
85
+ ```bash
86
+ pip install -e ../knuckles-cli -e ".[dev]"
87
+ pytest --cov=knuckles_mcp
88
+ ```
89
+
90
+ See Decision #027 in the repo's `DECISIONS.md` for the design.
91
+
92
+ ## Releasing
93
+
94
+ Bump the version in `pyproject.toml` and `__init__.py`, add a
95
+ CHANGELOG entry, merge, then push a tag:
96
+
97
+ ```bash
98
+ git tag knuckles-mcp-vX.Y.Z && git push origin knuckles-mcp-vX.Y.Z
99
+ ```
100
+
101
+ `.github/workflows/release-mcp.yml` tests, builds and publishes to PyPI
102
+ via Trusted Publishing.
103
+
104
+ knuckles-mcp depends on knuckles-cli, so tag the matching knuckles-cli release first.
@@ -0,0 +1,89 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "knuckles-mcp"
7
+ version = "0.1.0"
8
+ description = "MCP server that lets coding agents set up Knuckles sign-in"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = { text = "MIT" }
12
+ authors = [
13
+ { name = "Garrett Sooter", email = "garrett.sooter@gmail.com" },
14
+ ]
15
+ keywords = ["authentication", "identity", "mcp", "knuckles", "oauth", "passkey"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3 :: Only",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: Security",
26
+ "Typing :: Typed",
27
+ ]
28
+ dependencies = [
29
+ "knuckles-cli>=0.2,<0.3",
30
+ "mcp>=2.3,<3",
31
+ ]
32
+
33
+ [project.scripts]
34
+ knuckles-mcp = "knuckles_mcp.server:main"
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/gsooter/knuckles"
38
+ Documentation = "https://gsooter.github.io/knuckles/mcp"
39
+ Source = "https://github.com/gsooter/knuckles/tree/main/packages/knuckles-mcp"
40
+ Issues = "https://github.com/gsooter/knuckles/issues"
41
+
42
+ [project.optional-dependencies]
43
+ dev = [
44
+ "pytest>=8.0,<9",
45
+ "pytest-cov>=5.0,<6",
46
+ "responses>=0.25,<1",
47
+ "cryptography>=42.0,<46",
48
+ "mypy>=1.9,<2",
49
+ "ruff==0.15.11",
50
+ "black>=24.0,<25",
51
+ "types-requests>=2.31,<3",
52
+ ]
53
+
54
+ [tool.setuptools.packages.find]
55
+ where = ["src"]
56
+
57
+ [tool.setuptools.package-data]
58
+ knuckles_mcp = ["py.typed", "skill/SKILL.md"]
59
+
60
+ [tool.black]
61
+ line-length = 88
62
+ target-version = ["py311"]
63
+
64
+ [tool.ruff]
65
+ line-length = 88
66
+ target-version = "py311"
67
+
68
+ [tool.ruff.lint]
69
+ select = ["E", "W", "F", "I", "N", "UP", "B", "SIM", "TCH", "RUF"]
70
+
71
+ [tool.ruff.lint.per-file-ignores]
72
+ "tests/**/*.py" = ["TC001", "TC002", "TC003"]
73
+
74
+ [tool.mypy]
75
+ python_version = "3.11"
76
+ strict = true
77
+ warn_return_any = true
78
+ disallow_untyped_defs = true
79
+
80
+ [tool.pytest.ini_options]
81
+ testpaths = ["tests"]
82
+ addopts = "-v"
83
+
84
+ [tool.coverage.run]
85
+ source = ["knuckles_mcp"]
86
+
87
+ [tool.coverage.report]
88
+ fail_under = 80
89
+ show_missing = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """MCP server exposing Knuckles tenant setup to coding agents."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,7 @@
1
+ """Allow ``python -m knuckles_mcp``."""
2
+
3
+ import sys
4
+
5
+ from knuckles_mcp.server import main
6
+
7
+ sys.exit(main())
File without changes