io.github.CakeRepository/1password

编码与调试

by cakerepository

提供用于 1Password service accounts 的 MCP server,支持安全集成与凭据访问管理。

什么是 io.github.CakeRepository/1password

提供用于 1Password service accounts 的 MCP server,支持安全集成与凭据访问管理。

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 defaultspassword_read and item_get return metadata 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; plaintext is redacted from stdout/stderr and never logged back to the model.
  • 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 1password://… 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).
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. Concealed values stay hidden unless reveal: true. 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. 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
1password://configNon-secret server config (name, version, log level, token source, Node version).
1password://vaultsJSON list of accessible vaults.
1password://vaults/{vaultId}/itemsJSON item metadata for one vault (no secret values).

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 DeveloperService 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.

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: lock op_run / op_check_ref to certain vaults

By default those tools may resolve op:// references from 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. References outside the list are rejected before resolution. Same setting via --allowed-vaults.


For agents: how to handle secrets

Follow this order every time:

  1. Discover with vault_listitem_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_generatepassword_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 allowed for op_run / op_check_ref. 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

code
--service-account-token <token>   1Password service account token
--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 allow-list for op_run / op_check_ref

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 referencesop://… + op_run beat pasting passwords into prompts or files.
  • Least privilege — Dedicated automation vaults beat sharing your whole account.

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.git
cd 1Password-MCP
npm ci
npm run build
npm test
npm run lint

Watch mode: npm run dev.

Project layout

code
src/
  index.ts                 # Entrypoint — MCP stdio + protocol negotiation
  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 & allow-list checks
  utils.ts                 # Result helpers, password generation
  tools/                   # All 15 MCP tools
  prompts/                 # Interactive workflow prompts
  resources/               # 1password:// resources
tests/

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


Changelog

See CHANGELOG.md for version history, including 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

常见问题

io.github.CakeRepository/1password 是什么?

提供用于 1Password service accounts 的 MCP server,支持安全集成与凭据访问管理。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描171.4k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描171.4k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描171.4k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
89.7k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
60.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
49.9k

评论