1password

io.github.CakeRepository由 GitHub 账号 CakeRepository 发布v2.5.0更新于 Oct 24, 2026

MCP server for 1Password service accounts — tools and resources for vaults and credentials

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

社区版 MCP 服务器,让助手通过受限的服务账户浏览、读取、创建、轮换和删除 1Password 保险库条目。

可以做什么
列出保险库、按标题搜索条目并查看条目的元数据,默认不暴露机密;读取条目和单个字段,机密值需显式开启才显示,并可校验 op:// 引用而不返回值;创建登录项、安全笔记和生成的密码或口令短语,并更新或轮换字段;运行本地命令,把 op:// 引用注入子进程环境,并从返回输出中尽力遮盖解析出的机密;归档或永久删除条目;提供密码生成、凭据轮换、保险库审计和引用构建的引导提示,以及可浏览的保险库与条目资源。
适用场景
适合让助手处理存放在 1Password 中的自动化或 CI 凭据,例如列出保险库、轮换密码,或运行需要机密但不必把机密贴进对话的命令。最好只用于专门的自动化保险库,而不是个人或银行登录信息。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js 20 或更高版本。需要 1Password 服务账户令牌,通过 OP_SERVICE_ACCOUNT_TOKEN 提供;在 macOS 上也可通过 OP_KEYCHAIN_SERVICE 和可选的 OP_KEYCHAIN_ACCOUNT 从钥匙串读取。可选 OP_MCP_ALLOWED_VAULTS 用于限制可用的保险库。需要访问 1Password 的网络连接。
安装前请注意
服务账户令牌相当于主密钥:应只授予专门的保险库,切勿提交到代码库,优先使用环境变量或钥匙串,而不是其他本地进程可读的命令行参数。被显示的值和条目备注可能发送给模型提供商,备注会原样返回。op_run 以你的用户身份执行任意命令,输出中的机密遮盖只是尽力而为,并非沙箱。item_delete 为永久删除,优先使用归档。

安装

在 SourceWeft 中

  1. 打开 控制台中的 1password,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

1Password MCP Server

[CI] [npm] [Node] [MCP] [License]

Give your AI assistant a locked door to 1Password — not a pile of passwords in the chat.

@takescake/1password-mcp is a community Model Context Protocol (MCP) server. It lets Claude, Cursor, VS Code Copilot, OpenAI Codex, Gemini, and other MCP clients manage vaults and credentials through a 1Password Service Account.

Built on the MCP TypeScript SDK v2 with protocol negotiation for 2026-07-28 (and legacy clients). Secrets stay in 1Password; agents prefer op:// references and op_run so plaintext never has to land in the model transcript.

Not an official 1Password product. Community-built, Apache 2.0 licensed.


Who this is for

You are…You get…
Not deeply technicalA one-time setup: create a service account, paste the token into your AI app’s MCP settings, then ask in plain English (“list my automation vault”, “rotate the staging DB password”).
An agent / LLMFifteen typed tools, four workflow prompts, three browsable resources, and clear rules: prefer op_run + op:// over revealing secrets.
A developer / SREFull item CRUD, secure notes, password generation, vault allow-lists, Keychain token loading on macOS, and CI-friendly env config.

Why teams pick this server

  • Security-first defaults — password_read returns metadata, and item_get hides secret-bearing fields (passwords, SSH keys, OTP seeds, card numbers), unless you opt in with reveal: true.
  • op_run (the MCP equivalent of op run) — inject op://vault/item/field into a local command’s environment; resolved secrets are redacted from the returned stdout/stderr on a best-effort basis (including common encodings).
  • Full vault toolkit — list, search, get, edit, create logins & notes, rotate passwords, archive, or delete.
  • Guided prompts — password generation, credential rotation, vault audit, and secret-reference helpers.
  • Browsable resources — vault and item catalogs over onepassword://… URIs (no secrets in resource payloads).
  • Modern MCP — stdio transport, Zod 4 schemas, MCP 2026-07-28 negotiation with legacy client compatibility.

What you get

Tools (15)

Grouped the way agents and humans actually use them.

Discover
ToolWhat it does
vault_listList vaults the service account can access (id, name, description, type), limited to the allow-list if one is set.
item_lookupSearch a vault by title substring; optional limit (max 200).
item_listList every item in a vault (id, title, category, tags, updatedAt) — never secrets.
Read (safe by default)
ToolWhat it does
item_getFull item: title, category, tags, notes, fields. Secret-bearing values (passwords and other concealed fields, SSH private keys, OTP seeds, card numbers) stay hidden unless reveal: true; only known non-secret field types are shown. Notes are returned as-is. Accepts op://… or vaultId + itemId.
password_readRead one field (default password) via op://… or ids. Metadata-only unless reveal: true. Prefer op_run to use a secret.
op_check_refValidate op://vault/item/field and return non-secret metadata only (vault, item, field). Never the value.
Create & update
ToolWhat it does
password_createCreate a Login or Password item (username, URL, tags, notes). returnSecret defaults to false.
note_createCreate a Secure Note with optional tags and custom fields.
password_updateRotate a password / concealed field (creates the field if missing).
item_editUpdate title, notes (empty string clears), tags, URL; upsert or remove fields. Unreferenced fields stay untouched.
password_generateCryptographically secure random password (length 8–128; symbols/numbers/uppercase toggles).
password_generate_memorableMemorable passphrase from a ~500-word list (word count, separator, number/symbol suffixes).
Use secrets without revealing them
ToolWhat it does
op_runRun a local command (command or argv) with env vars. Values matching op://… are resolved into the child process only; resolved secrets are redacted from returned output (best effort — see Security & privacy). Output is capped at 5 MiB per stream, and a timeout kills the whole process tree. Optional cwd, shell, timeout_ms, stdin.
Soft-delete & destroy
ToolWhat it does
item_archiveMove an item to the archive (hidden from normal views).
item_deletePermanently delete an item — cannot be undone.

Prompts (4)

PromptWhen to use it
generate-secure-passwordGenerate (random or memorable) and optionally store — without dumping the password into chat.
credential-rotationFind → verify access → generate → update → confirm op:// reference.
vault-auditInventory a vault by category; flag duplicates / oddities — never reveal secrets.
secret-reference-helperBuild a paste-ready op://vault/item/field from names.

Resources (3)

URIContents
onepassword://configNon-secret server config (name, version, log level, token source, Node version).
onepassword://vaultsJSON list of accessible vaults (limited to the allow-list if one is set).
onepassword://vaults/{vaultId}/itemsURI template (listed by resources/templates/list): JSON item metadata for one vault (no secret values).

Upgrading from 4.x: resource URIs used to start with 1password://, which MCP clients could never read (a URI scheme can't start with a digit). Replace any hard-coded 1password:// URIs with onepassword://.


Before you start

You need two things:

  1. Node.js 20 or newer
  2. A 1Password Service Account with access to the vault(s) you want the AI to use

Create a service account (plain English)

  1. Sign in to your 1Password account on the web.
  2. Open Developer → Service Accounts (or follow 1Password’s guide).
  3. Create a service account and grant it only the vaults you want automation to touch (for example an Automation or CI vault — not your personal banking vault).
  4. Copy the token once. Treat it like a master key.

Quick start

Claude Desktop / Cursor / VS Code / most IDEs

Add this to your MCP config (exact file depends on the app):

json
{  "mcpServers": {    "1password": {      "command": "npx",      "args": ["-y", "@takescake/1password-mcp"],      "env": {        "OP_SERVICE_ACCOUNT_TOKEN": "YOUR_SERVICE_ACCOUNT_TOKEN"      }    }  }}

Restart the app, then try: “List my 1Password vaults.”

macOS Keychain (no token in the config file)

Store the token in Keychain, then point the server at it:

json
{  "mcpServers": {    "1password": {      "command": "npx",      "args": ["-y", "@takescake/1password-mcp"],      "env": {        "OP_KEYCHAIN_SERVICE": "op-service-account-claude-automation",        "OP_KEYCHAIN_ACCOUNT": "your-macos-username"      }    }  }}

Token resolution order: CLI (--service-account-token / --token) → OP_SERVICE_ACCOUNT_TOKEN → macOS Keychain. OP_KEYCHAIN_ACCOUNT is optional when the service name alone is unique. Avoid the CLI flags: command-line arguments are visible to other local processes, and the server logs a warning at startup if you use them.

OpenAI Codex (TOML)

Option A — token in config:

toml
[mcp_servers."1password"]command = "npx"args = ["-y", "@takescake/1password-mcp"]
[mcp_servers."1password".env]OP_SERVICE_ACCOUNT_TOKEN = "YOUR_SERVICE_ACCOUNT_TOKEN"

Option B (recommended) — config only names the env var:

toml
[mcp_servers."1password"]command = "npx"args = ["-y", "@takescake/1password-mcp"]env_vars = ["OP_SERVICE_ACCOUNT_TOKEN"]

Set OP_SERVICE_ACCOUNT_TOKEN in your shell or CI. Note: codex mcp add ... --env OP_SERVICE_ACCOUNT_TOKEN=... writes the secret into Codex config; prefer env_vars when you can.

On macOS you can omit the token env and use OP_KEYCHAIN_SERVICE (+ optional OP_KEYCHAIN_ACCOUNT) instead.

Optional: restrict the server to certain vaults

By default the server can use any vault the service account can see. To allow-list vaults:

json
{  "env": {    "OP_SERVICE_ACCOUNT_TOKEN": "YOUR_SERVICE_ACCOUNT_TOKEN",    "OP_MCP_ALLOWED_VAULTS": "Automation, CI"  }}

Names or IDs work (case-insensitive). Same setting via --allowed-vaults. The allow-list applies server-wide, to every tool and resource that touches a vault, not only op_run / op_check_ref:

  • vault_list and onepassword://vaults show only allowed vaults.
  • Tools that take a vaultId, and the onepassword://vaults/{vaultId}/items resource, must be given the vault’s ID (not its name); vaults outside the list are rejected.
  • op:// references are checked both as written and by the vault they actually resolve to.
  • When an allow-list is set, each guarded call makes one extra vaults.list read (mind service-account rate limits), and the server fails closed if vaults can’t be listed.

Upgrading from 4.0.3 or earlier? If you set this expecting it to affect only op_run / op_check_ref, it now restricts everything.

This is defense in depth: scope the service account’s own vault access in 1Password first.


For agents: how to handle secrets

Follow this order every time:

  1. Discover with vault_list → item_lookup / item_list (metadata only).
  2. Confirm a reference with op_check_ref — never reveal just to see if a path exists.
  3. Use a secret in a command or API call with op_run and op://vault/item/field in env.
  4. Reveal with password_read / item_get + reveal: true only when the human explicitly needs the value in chat.
  5. Rotate with password_generate → password_update (keep returnSecret: false unless asked).
  6. Prefer item_archive over item_delete unless permanent removal is required.

op_run sketch

json
{  "argv": ["curl", "-sS", "https://api.example.com/health"],  "env": {    "API_TOKEN": "op://Automation/Example API/credential"  },  "timeout_ms": 60000}

Prefer argv over a shell command string when you can — fewer quoting surprises.


Configuration reference

Environment variables

VariableRequiredDescription
OP_SERVICE_ACCOUNT_TOKENUsually yesService account token. Not required on macOS if Keychain vars are set.
OP_KEYCHAIN_SERVICENomacOS: Keychain service name for the token.
OP_KEYCHAIN_ACCOUNTNomacOS: optional account to narrow the Keychain lookup.
OP_MCP_ALLOWED_VAULTSNoComma-separated vault names/IDs (case-insensitive) the server may use, enforced server-wide. Empty = unrestricted.
OP_INTEGRATION_NAMENoName reported to the 1Password SDK (default: 1password-mcp).
OP_INTEGRATION_VERSIONNoVersion reported to the SDK (default: package version).
MCP_LOG_LEVELNodebug | info | warn | error (default: info).
MCP_DEBUGNoIf set, forces debug logging.

CLI flags

--service-account-token <token>   1Password service account token (avoid: visible to other local processes)--token <token>                   Alias for --service-account-token--log-level <level>               error | warn | info | debug (default: info)--integration-name <name>         Custom integration name for the 1Password SDK--integration-version <version>   Custom integration version--allowed-vaults <list>           Comma-separated vault allow-list (names or IDs), applied server-wide

Security & privacy

Read this before pointing the server at a vault you care about.

  • LLM privacy — Anything revealed to the model may be sent to your AI provider and retained under their policies.
  • MCP is not end-to-end encrypted for secrets in flight — Values are plaintext inside the MCP workflow and toward the model. They are encrypted at rest in 1Password once stored.
  • Best fit — Automation credentials: CI tokens, bot accounts, disposable env secrets.
  • Avoid — Banking, primary personal logins, recovery codes, or anything you cannot afford to expose to a model provider.
  • Token = master key — Scope the service account tightly; rotate immediately if leaked; never commit tokens or MCP configs with secrets.
  • Prefer the env var or Keychain for the token — --token / --service-account-token puts it in the process arguments, which other local processes can read (the server warns at startup). A same-user process can generally read the server’s environment too (for example /proc/<pid>/environ on Linux), so on macOS Keychain is the strongest option: it keeps the token out of config files and the process environment.
  • Prefer references — op://… + op_run beat pasting passwords into prompts or files.
  • op_run runs arbitrary commands as your user — Keep your MCP client’s approval prompts on for it; don’t auto-approve it.
  • Redaction is best effort — op_run masks resolved secrets in returned output, including common encodings (base64, JSON- and URL-encoded forms, multi-line values). That protects against accidental disclosure. It is not a sandbox: a command can deliberately transform or transmit a secret it was given.
  • Notes are not concealed — item_get returns notes as-is (like op item get). Don’t keep secrets in the notes of vaults an agent can read.
  • Least privilege — Dedicated automation vaults beat sharing your whole account. OP_MCP_ALLOWED_VAULTS is a second fence, not a substitute.
  • Reporting vulnerabilities — Open a public issue; see SECURITY.md.

Protocol & compatibility

PieceDetail
Package@takescake/1password-mcp
RuntimeNode.js ≥ 20
Transportstdio
MCP SDK@modelcontextprotocol/server v2
ProtocolNegotiates 2026-07-28; keeps legacy client compatibility
Registry nameio.github.CakeRepository/1password

Development

bash
git clone https://github.com/CakeRepository/1Password-MCP.gitcd 1Password-MCPnpm cinpm run buildnpm testnpm run lint

Watch mode: npm run dev.

Project layout

src/  index.ts                 # Entrypoint — MCP stdio + protocol negotiation  server.ts                # buildServer() — registers tools, prompts, resources  config.ts                # CLI / env / Keychain / allow-list  client.ts                # 1Password SDK client  logger.ts                # Structured logs on stderr (stdout is protocol)  secret-ref.ts            # op:// parsing & reference checks  vault-access.ts          # Server-wide vault allow-list enforcement  redaction.ts             # op_run output redaction  utils.ts                 # Result helpers, password generation  tools/                   # All 15 MCP tools  prompts/                 # Interactive workflow prompts  resources/               # onepassword:// resourcestests/

See CONTRIBUTING.md. Maintainers / agents: agents.md.


Changelog

See CHANGELOG.md for version history, including the 5.0.0 release (resource URIs moved from 1password:// to onepassword://, plus security hardening; read its Changed notes before upgrading), the 4.0.0 MCP v2 / 2026-07-28 migration, and the 3.0.0 op_run / reveal-opt-in security changes.


License

Apache License 2.0

来源:README.md,提交 9287e77

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v2.5.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分