@rui.branco/1password-mcp 0.1.7 → 0.1.8

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.
Files changed (4) hide show
  1. package/README.md +122 -122
  2. package/index.js +1301 -1296
  3. package/package.json +1 -1
  4. package/setup.js +213 -210
package/README.md CHANGED
@@ -1,122 +1,122 @@
1
- # 1Password MCP Server
2
-
3
- A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [1Password](https://1password.com/) that runs **entirely locally** — no external services, no telemetry, no leaks. Uses the official [`@1password/sdk`](https://www.npmjs.com/package/@1password/sdk) with a 1Password Service Account token.
4
-
5
- Works with any MCP-compatible AI client — Claude Code, Codex CLI, Google's Antigravity (Gemini), Cursor, Windsurf, Zed, and others. Built to mirror the multi-instance pattern of [jira-mcp](https://github.com/rui-branco/jira-mcp) so you can point the same session at multiple 1Password accounts (e.g. `work` and `personal`).
6
-
7
- ## Features
8
-
9
- - **Multi-instance** — add several service accounts, switch per tool call via `instance` parameter
10
- - **Local only** — all calls go directly from your machine to 1Password over TLS; the config file is stored `0600` in `~/.config/1password-mcp/config.json`
11
- - **Redaction by default** — concealed fields (passwords, TOTP) are redacted unless you explicitly pass `includeConcealed: true`
12
- - **Read + write** — list vaults/items, fetch full items, resolve `op://` references, generate passwords, create/delete items, create/delete vaults
13
-
14
- ## Installation
15
-
16
- ### Prerequisites
17
-
18
- - Node.js 18+
19
- - An MCP-compatible AI client (see [Step 1](#step-1-register-with-your-mcp-client) below)
20
- - Either:
21
- - **The 1Password 8 desktop app** (recommended — no admin permissions needed, and you get access to all vaults you can already see), or
22
- - A 1Password **service account** token (needs admin to provision, scoped to shared vaults only — good for CI/headless use)
23
-
24
- ### Step 1: Register with your MCP client
25
-
26
- Pick the snippet for your client. All of them launch the server over stdio.
27
-
28
- **Claude Code:**
29
-
30
- ```bash
31
- claude mcp add --scope user --transport stdio 1password -- npx -y @rui.branco/1password-mcp
32
- ```
33
-
34
- **Codex CLI:** add to `~/.codex/config.toml`:
35
-
36
- ```toml
37
- [mcp_servers.1password]
38
- command = "npx"
39
- args = ["-y", "@rui.branco/1password-mcp"]
40
- ```
41
-
42
- **Google Antigravity / Gemini CLI:** add to `~/.gemini/settings.json`:
43
-
44
- ```json
45
- {
46
- "mcpServers": {
47
- "1password": { "command": "npx", "args": ["-y", "@rui.branco/1password-mcp"] }
48
- }
49
- }
50
- ```
51
-
52
- **Cursor, Windsurf, Zed, Cline, Continue, etc.:** add the same `command`/`args` pair to whatever JSON config that client uses for MCP servers (the exact path varies, but the shape is standard across clients).
53
-
54
- ### Step 2: Run setup
55
-
56
- ```bash
57
- npx @rui.branco/1password-mcp setup
58
- ```
59
-
60
- The setup wizard walks you through picking an auth mode and validates the connection before saving.
61
-
62
- ### Step 3 (desktop auth only): One-time 1Password 8 toggles
63
-
64
- Desktop auth delegates unlock to the 1Password 8 desktop app, so you need to enable the SDK integration **once** per machine:
65
-
66
- 1. Open the **1Password 8 desktop app** (not `my.1password.com` in the browser).
67
- 2. Open **Settings** (cmd+, on Mac / ctrl+, on Windows).
68
- 3. Click the **Developer** tab.
69
- 4. Under *Command-Line Interface (CLI)*, tick **"Integrate with 1Password CLI"**.
70
- 5. Under *Integrate with the 1Password SDKs*, tick **"Integrate with other apps"**. ← **This is the critical one.** Without it, the SDK cannot unlock and every call will fail with `DesktopSessionExpiredError`.
71
- 6. Optional: **Settings → Security → Unlock using Touch ID** so the OS prompt can be cleared with your fingerprint.
72
-
73
- The first time the MCP actually calls 1Password, your OS will pop an authorization prompt asking whether `1password-mcp-setup` (during the wizard) and `1password-mcp` (at runtime) can talk to 1Password. Click Approve.
74
-
75
- ### Finding your account name
76
-
77
- When the wizard asks for "Account name", open the 1Password 8 desktop app and click the **account switcher** in the top-left. The signin address shown next to your name is what you want — it looks like `my.1password.com`, `my-team.1password.com`, or similar.
78
-
79
- ### Step 4: Reconnect
80
-
81
- Restart your AI client and check its MCP status (e.g. `/mcp` in Claude Code, `mcp` in Codex CLI, or the equivalent panel in your client) to reconnect the 1password server and pick up the new config.
82
-
83
- ## Tools
84
-
85
- | Tool | Description |
86
- |---|---|
87
- | `op_list_instances` | List configured service accounts (tokens never returned) |
88
- | `op_add_instance` | Add/update an instance. Validates the token against the API. |
89
- | `op_remove_instance` | Remove an instance by name |
90
- | `op_list_vaults` | List vaults visible to the service account |
91
- | `op_list_items` | List items in a vault (by vault id or title) |
92
- | `op_search_items` | Title-substring search across one or all vaults |
93
- | `op_get_item` | Fetch a full item. Concealed fields redacted unless `includeConcealed=true`. |
94
- | `op_get_secret` | Resolve a `op://Vault/Item/field` secret reference |
95
- | `op_generate_password` | Generate Random / Memorable / Pin passwords via the 1Password generator |
96
- | `op_create_item` | Create a new item with fields, tags, and websites |
97
- | `op_delete_item` | Delete an item |
98
- | `op_create_vault` | Create a new vault |
99
- | `op_delete_vault` | Delete a vault |
100
-
101
- All tools that talk to 1Password accept an optional `instance` parameter. Omit it to use the default instance.
102
-
103
- ## Security notes
104
-
105
- - Tokens live only in `~/.config/1password-mcp/config.json` (chmod 0600) and in the SDK client process. They are never logged or transmitted anywhere except to `*.1password.com`.
106
- - Service accounts only see vaults that have been explicitly shared with them — personal vaults are inaccessible by design.
107
- - Concealed fields are redacted by default in tool output so the model cannot accidentally quote a password back. Pass `includeConcealed: true` only when you actually need the cleartext.
108
-
109
- ## Config shape
110
-
111
- ```json
112
- {
113
- "instances": [
114
- { "name": "work", "token": "ops_...", "description": "ITO service account" }
115
- ],
116
- "defaultInstance": "work"
117
- }
118
- ```
119
-
120
- ## License
121
-
122
- MIT
1
+ # 1Password MCP Server
2
+
3
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [1Password](https://1password.com/) that runs **entirely locally** — no external services, no telemetry, no leaks. Uses the official [`@1password/sdk`](https://www.npmjs.com/package/@1password/sdk) with a 1Password Service Account token.
4
+
5
+ Works with any MCP-compatible AI client — Claude Code, Codex CLI, Google's Antigravity (Gemini), Cursor, Windsurf, Zed, and others. Built to mirror the multi-instance pattern of [jira-mcp](https://github.com/rui-branco/jira-mcp) so you can point the same session at multiple 1Password accounts (e.g. `work` and `personal`).
6
+
7
+ ## Features
8
+
9
+ - **Multi-instance** — add several service accounts, switch per tool call via `instance` parameter
10
+ - **Local only** — all calls go directly from your machine to 1Password over TLS; the config file is stored `0600` in `~/.config/1password-mcp/config.json`
11
+ - **Redaction by default** — concealed fields (passwords, TOTP) are redacted unless you explicitly pass `includeConcealed: true`
12
+ - **Read + write** — list vaults/items, fetch full items, resolve `op://` references, generate passwords, create/delete items, create/delete vaults
13
+
14
+ ## Installation
15
+
16
+ ### Prerequisites
17
+
18
+ - Node.js 18+
19
+ - An MCP-compatible AI client (see [Step 1](#step-1-register-with-your-mcp-client) below)
20
+ - Either:
21
+ - **The 1Password 8 desktop app** (recommended — no admin permissions needed, and you get access to all vaults you can already see), or
22
+ - A 1Password **service account** token (needs admin to provision, scoped to shared vaults only — good for CI/headless use)
23
+
24
+ ### Step 1: Register with your MCP client
25
+
26
+ Pick the snippet for your client. All of them launch the server over stdio.
27
+
28
+ **Claude Code:**
29
+
30
+ ```bash
31
+ claude mcp add --scope user --transport stdio 1password -- npx -y @rui.branco/1password-mcp
32
+ ```
33
+
34
+ **Codex CLI:** add to `~/.codex/config.toml`:
35
+
36
+ ```toml
37
+ [mcp_servers.1password]
38
+ command = "npx"
39
+ args = ["-y", "@rui.branco/1password-mcp"]
40
+ ```
41
+
42
+ **Google Antigravity / Gemini CLI:** add to `~/.gemini/settings.json`:
43
+
44
+ ```json
45
+ {
46
+ "mcpServers": {
47
+ "1password": { "command": "npx", "args": ["-y", "@rui.branco/1password-mcp"] }
48
+ }
49
+ }
50
+ ```
51
+
52
+ **Cursor, Windsurf, Zed, Cline, Continue, etc.:** add the same `command`/`args` pair to whatever JSON config that client uses for MCP servers (the exact path varies, but the shape is standard across clients).
53
+
54
+ ### Step 2: Run setup
55
+
56
+ ```bash
57
+ npx @rui.branco/1password-mcp setup
58
+ ```
59
+
60
+ The setup wizard walks you through picking an auth mode and validates the connection before saving.
61
+
62
+ ### Step 3 (desktop auth only): One-time 1Password 8 toggles
63
+
64
+ Desktop auth delegates unlock to the 1Password 8 desktop app, so you need to enable the SDK integration **once** per machine:
65
+
66
+ 1. Open the **1Password 8 desktop app** (not `my.1password.com` in the browser).
67
+ 2. Open **Settings** (cmd+, on Mac / ctrl+, on Windows).
68
+ 3. Click the **Developer** tab.
69
+ 4. Under *Command-Line Interface (CLI)*, tick **"Integrate with 1Password CLI"**.
70
+ 5. Under *Integrate with the 1Password SDKs*, tick **"Integrate with other apps"**. ← **This is the critical one.** Without it, the SDK cannot unlock and every call will fail with `DesktopSessionExpiredError`.
71
+ 6. Optional: **Settings → Security → Unlock using Touch ID** so the OS prompt can be cleared with your fingerprint.
72
+
73
+ The first time the MCP actually calls 1Password, your OS will pop an authorization prompt asking whether `1password-mcp-setup` (during the wizard) and `1password-mcp` (at runtime) can talk to 1Password. Click Approve.
74
+
75
+ ### Finding your account name
76
+
77
+ When the wizard asks for "Account name", open the 1Password 8 desktop app and click the **account switcher** in the top-left. The signin address shown next to your name is what you want — it looks like `my.1password.com`, `my-team.1password.com`, or similar.
78
+
79
+ ### Step 4: Reconnect
80
+
81
+ Restart your AI client and check its MCP status (e.g. `/mcp` in Claude Code, `mcp` in Codex CLI, or the equivalent panel in your client) to reconnect the 1password server and pick up the new config.
82
+
83
+ ## Tools
84
+
85
+ | Tool | Description |
86
+ |---|---|
87
+ | `op_list_instances` | List configured service accounts (tokens never returned) |
88
+ | `op_add_instance` | Add/update an instance. Validates the token against the API. |
89
+ | `op_remove_instance` | Remove an instance by name |
90
+ | `op_list_vaults` | List vaults visible to the service account |
91
+ | `op_list_items` | List items in a vault (by vault id or title) |
92
+ | `op_search_items` | Title-substring search across one or all vaults |
93
+ | `op_get_item` | Fetch a full item. Concealed fields redacted unless `includeConcealed=true`. |
94
+ | `op_get_secret` | Resolve a `op://Vault/Item/field` secret reference |
95
+ | `op_generate_password` | Generate Random / Memorable / Pin passwords via the 1Password generator |
96
+ | `op_create_item` | Create a new item with fields, tags, and websites |
97
+ | `op_delete_item` | Delete an item |
98
+ | `op_create_vault` | Create a new vault |
99
+ | `op_delete_vault` | Delete a vault |
100
+
101
+ All tools that talk to 1Password accept an optional `instance` parameter. Omit it to use the default instance.
102
+
103
+ ## Security notes
104
+
105
+ - Tokens live only in `~/.config/1password-mcp/config.json` (chmod 0600) and in the SDK client process. They are never logged or transmitted anywhere except to `*.1password.com`.
106
+ - Service accounts only see vaults that have been explicitly shared with them — personal vaults are inaccessible by design.
107
+ - Concealed fields are redacted by default in tool output so the model cannot accidentally quote a password back. Pass `includeConcealed: true` only when you actually need the cleartext.
108
+
109
+ ## Config shape
110
+
111
+ ```json
112
+ {
113
+ "instances": [
114
+ { "name": "work", "token": "ops_...", "description": "ITO service account" }
115
+ ],
116
+ "defaultInstance": "work"
117
+ }
118
+ ```
119
+
120
+ ## License
121
+
122
+ MIT