@@ -15,84 +15,82 @@ configuration files.
15
15
16
16
## Secrets providers
17
17
18
- ToolHive supports multiple secret providers:
18
+ ToolHive supports multiple secret providers to fit different security and
19
+ workflow requirements:
19
20
20
- - ` encrypted ` (default) - ToolHive encrypts secrets using a password that it
21
- stores in your operating system's keyring.
22
- - ` 1password ` - ToolHive retrieves secrets from a 1Password vault.
21
+ - ` encrypted ` - ToolHive encrypts secrets using a password stored in your
22
+ operating system's keyring
23
+ - ` 1password ` - ToolHive retrieves secrets from a 1Password vault
23
24
24
- <Tabs groupId = ' secrets-provider' queryString = ' secrets-provider' >
25
- <TabItem value = ' encrypted' label = ' Encrypted (default)' default >
25
+ You can use only one provider at a time. To select your preferred provider, run:
26
26
27
- The ` encrypted ` provider is the default secrets provider. When you use a
28
- [ ` thv secret ` ] ( ../reference/cli/thv_secret.md ) command for the first time,
29
- ToolHive prompts you for a password to encrypt and decrypt your secrets.
27
+ ``` bash
28
+ thv secret setup
29
+ ```
30
30
31
- ToolHive stores the encryption password in your operating system's keyring
32
- (Keychain Access on macOS, dbus/Gnome Keyring on Linux). This means you don't
33
- need to enter it every time you use a
34
- [ ` thv secret ` ] ( ../reference/cli/thv_secret.md ) command.
31
+ If you plan to use 1Password, first set up a 1Password service account and
32
+ obtain an API token. See the 1Password tab below for details.
35
33
36
- To explicitly use the ` encrypted ` provider (or switch back to it from another
37
- provider), run:
34
+ < Tabs groupId = ' secrets- provider' >
35
+ < TabItem value = ' encrypted ' label = ' Encrypted ' default >
38
36
39
- ``` bash
40
- thv config secrets-provider encrypted
41
- ```
37
+ When you select the ` encrypted ` provider, ToolHive prompts you to create an
38
+ encryption password that protects your secrets.
39
+
40
+ ToolHive stores this encryption password in your operating system's keyring
41
+ (Keychain Access on macOS, Credential Manager on Windows, and dbus/Gnome Keyring
42
+ on Linux). This means you don't need to enter the password every time you use a
43
+ [ ` thv secret ` ] ( ../reference/cli/thv_secret.md ) command.
42
44
43
45
</TabItem >
44
46
<TabItem value = ' 1password' label = ' 1Password' >
45
47
46
48
:::note
47
49
48
- The ` list ` , ` set ` , and ` delete ` operations aren't currently supported with
49
- 1Password.
50
-
51
- You can retrieve secrets using the
52
- [ ` thv secret get ` ] ( ../reference/cli/thv_secret_get.md ) command and the
53
- ` --secret ` parameter for [ ` thv run ` ] ( ../reference/cli/thv_run.md ) , but the
54
- secret must already exist in 1Password.
50
+ The 1Password provider is read-only. You can list and view secrets, but you
51
+ can't create or delete them through ToolHive. Secrets must already exist in your
52
+ 1Password vault.
55
53
56
- If you'd like to see more functionality , please
54
+ If you'd like to see write operations added , please
57
55
[ open an issue] ( https://github.com/stacklok/toolhive/issues ) or join the
58
56
` #toolhive-developers ` channel in [ Discord] ( https://discord.gg/stacklok ) .
59
- Contributions are also welcome!
57
+ Contributions are welcome!
60
58
61
59
:::
62
60
63
61
To use 1Password as your secrets provider, set up a 1Password service account.
64
62
For detailed instructions, see the
65
63
[ 1Password documentation] ( https://developer.1password.com/docs/service-accounts/get-started#create-a-service-account ) .
66
64
67
- Next, set the ` OP_SERVICE_ACCOUNT_TOKEN ` environment variable to the 1Password
68
- service account's API token, which is displayed during the service account
69
- creation process. This token is required for all
70
- [ ` thv secret ` ] ( ../reference/cli/thv_secret.md ) commands.
65
+ Next, set the ` OP_SERVICE_ACCOUNT_TOKEN ` environment variable to your service
66
+ account's API token ( displayed during the service account creation process).
67
+ This token is required for all [ ` thv secret ` ] ( ../reference/cli/thv_secret.md )
68
+ commands:
71
69
72
70
``` bash
73
71
export OP_SERVICE_ACCOUNT_TOKEN=< your-service-account-token>
74
72
```
75
73
76
- Then, set 1Password as your ToolHive secrets provider:
74
+ Then, run ` thv secret setup ` and select ` 1password ` when prompted.
77
75
78
- ``` bash
79
- thv config secrets-provider 1password
80
- ```
81
-
82
- To reference a secret, use the
76
+ To reference a secret from 1Password, use the
83
77
[ 1Password secret reference] ( https://developer.1password.com/docs/cli/secret-reference-syntax )
84
78
URI format:
85
79
86
80
``` text
87
81
op://<vault-name>/<item-name>/[section-name/]<field-name>
88
82
```
89
83
90
- For example, to retrieve a secret named ` github ` from the ` MCPVault ` vault:
84
+ For example, to retrieve the ` password ` field from the ` github ` item in the
85
+ ` MCPVault ` vault:
91
86
92
87
``` bash
93
88
thv secret get op://MCPVault/github/password
94
89
```
95
90
91
+ Run [ ` thv secret list ` ] ( ../reference/cli/thv_secret_list.md ) to see all secrets
92
+ accessible to your service account, along with their URIs.
93
+
96
94
</TabItem >
97
95
</Tabs >
98
96
@@ -172,17 +170,32 @@ thv secret reset-keyring
172
170
173
171
Then, delete the encrypted secrets file:
174
172
175
- On macOS:
173
+ <Tabs groupId = ' os' >
174
+ <TabItem value = ' macos' label = ' macOS' default >
175
+
176
+ ``` bash
177
+ rm ~ /Library/Application\ Support/toolhive/secrets_encrypted
178
+ ```
176
179
177
- ``` bash
178
- rm ~ /Library/Application\ Support/toolhive/secrets_encrypted
179
- ```
180
+ </TabItem >
181
+ <TabItem value = ' linux' label = ' Linux' >
180
182
181
- On Linux:
183
+ ``` bash
184
+ rm ~ /.config/toolhive/secrets_encrypted
185
+ ```
182
186
183
- ``` bash
184
- rm ~ /.config/toolhive/secrets_encrypted
185
- ```
187
+ </TabItem >
188
+ <TabItem value = ' windows' label = ' Windows' >
189
+
190
+ ``` powershell
191
+ Remove-Item "$env:LOCALAPPDATA\toolhive\secrets_encrypted"
192
+ ```
193
+
194
+ </TabItem >
195
+ </Tabs >
196
+
197
+ The next time you run a ` thv secret ` command, ToolHive prompts you to create a
198
+ new encryption password and starts with a fresh secret store.
186
199
187
200
## Use secrets with MCP servers
188
201
@@ -328,7 +341,15 @@ If you can't access 1Password secrets:
328
341
```
329
342
330
343
2 . Check that the token is valid and has the necessary permissions to access the
331
- vault and item.
344
+ vault and item:
345
+
346
+ ``` bash
347
+ thv secret list
348
+ ```
332
349
333
350
3 . Make sure the secret reference URI is correct and matches the vault, item,
334
- and field names in 1Password.
351
+ and field names in 1Password:
352
+
353
+ ``` bash
354
+ thv secret get op://< vault-name> /< item-name> /[section-name/]< field-name>
355
+ ```
0 commit comments