op-mcp
op-mcp
MCP 服务器,封装了 1Password CLI (op),为 MCP 客户端(Cowork、Claude Code、Claude Desktop)提供密钥访问和条目管理功能。
架构
MCP client (Cowork, Claude Code, Claude Desktop)
↓ stdio (MCP protocol)
op-mcp (this Python server)
↓ subprocess per tool call
op CLI (1Password CLI)
↓ biometric prompt (Touch ID) + 1Password desktop app
1Password vaultsPython 服务器设计得非常轻量。每个工具处理程序都会调用 op CLI,并解析 JSON 或返回原始输出。CLI 负责处理生物识别认证、会话缓存和所有密码库访问。Python 端负责处理 MCP 协议和 argv 构建。
这种设计在构建上是无状态的:每次工具调用都会启动一个新的 CLI 进程。op 在 1Password 桌面应用内缓存其自己的会话——我们不管理会话、令牌或凭据。有关完整原理,请参阅 docs/design-notes.md。
Related MCP server: @1claw/mcp
先决条件
Python 3.11 或更高版本
已安装
opCLI 并将其添加到 PATH。通过 Homebrew 安装:brew install --cask 1password-cli(已在 v2.33.1 版本测试)。已安装 1Password 桌面应用并启用了 CLI 集成:1Password → 设置 → 开发者 → ✓ “集成 1Password CLI”。
已为 CLI 授权启用 Touch ID(在同一设置面板中)。
安装
uv tool install .这将创建一个隔离的 venv 并将 op-mcp 添加到 PATH。代码更改后如需升级:
uv tool install --force .--force 会覆盖现有的入口点并从源代码重新构建。(--reinstall 会重新下载 PyPI 依赖项——本地路径安装不需要此操作。)
运行
服务器通过 stdio 进行通信,因此它通常由 MCP 客户端启动,而不是手动调用。用于本地冒烟测试:
op-mcp服务器将日志记录到 stderr,并等待 stdin 上的 MCP 协议消息。按 Ctrl-C 退出。
配置 MCP 客户端
Claude Desktop: 设置 → 连接器 → 添加 → 输入 op-mcp 作为命令。或者直接编辑 claude_desktop_config.json:
{
"mcpServers": {
"op": {
"command": "op-mcp"
}
}
}Claude Code: 添加到 .mcp.json(项目)或 ~/.claude/mcp.json(全局),格式相同。
Cowork: 通过 Cowork 的 MCP 服务器配置添加。
推荐权限
读取操作可以安全允许;写入操作应要求确认。
{
"permissions": {
"allow": [
"mcp__op__op_ping",
"mcp__op__op_version",
"mcp__op__op_whoami",
"mcp__op__op_list_vaults",
"mcp__op__op_get_item",
"mcp__op__op_read_secret",
"mcp__op__op_list_items"
],
"ask": [
"mcp__op__op_create_item",
"mcp__op__op_edit_item",
"mcp__op__op_delete_item"
]
}
}开发
uv sync --extra dev
make test # uv run pytest (fake `op` binary)
RUN_LIVE_OP_TESTS=1 uv run pytest -m live # live tests against real op CLI
make lint # ruff + pyright
make install-mcp # reinstall after code changes测试使用伪造的 op 二进制文件(临时 shell 脚本),因此它们不需要真实的 CLI 或 1Password 访问权限。实时测试(标记为 @pytest.mark.live)针对真实的 CLI 运行,会触发 Touch ID,默认情况下会被跳过。
工具
共 10 个工具:3 个基础设施工具,4 个读取工具,3 个写入工具。
基础设施
工具 | 描述 |
| MCP 服务器存活检查 |
|
|
| 当前已认证的 1Password 账户 |
读取工具
工具 | 描述 |
| 列出所有可访问的密码库(名称和 ID) |
| 通过名称或 ID 获取条目的所有字段 |
| 通过 |
| 列出密码库中的条目(或跨所有密码库) |
写入工具
工具 | 描述 |
| 创建新条目 |
| 编辑现有条目 |
| 归档或永久删除条目 |
暂未实现(目前)
op signin/op signout— 会话管理是op的工作。op document/op vault— 当出现用例时添加。op inject/op run— 模板注入和环境变量加载工作流是命令行便利功能,没有简洁的 MCP 等效项。服务账户令牌 — 此服务器假设使用桌面生物识别认证。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Kliv is an AI web-app builder. It hosts each app with its own database, edge functions, commerce and email. Connect Claude Code or Cursor to Kliv's MCP server, sign in with your Kliv account, and your AI tool can work on your apps with the same tools the Kliv builder uses. It can edit an app's files, change the database, write and run edge functions, set up products and subscriptions, and run your tests. Then it can build and publish the app. Other MCP clients connect the same way. Your AI tool runs on your own AI subscription, so this work doesn't use your Kliv usage. Kliv still hosts the app and everything behind it. Each person signs in as themselves and reaches only the apps they can edit. The account owner sees every connected tool and can remove one at any time. The address is https://mcp.kliv.dev/mcp for everyone. Sign-in is OAuth in your browser, with your Kliv account. There are no API keys. Setup guide: https://docs.kliv.dev/integrations/mcp
Related MCP Servers
- AlicenseCqualityCmaintenanceAn MCP server that integrates 1Password with AI agents, providing secure access to vaults and items with secrets redacted by default.1619 npm1MIT

@1claw/mcpofficial
AlicenseAqualityBmaintenanceMCP server for secure, just-in-time secret retrieval from 1claw vault and malicious content inspection, enabling AI agents to access secrets and security analysis.1763 npm4MIT- AlicenseBqualityDmaintenanceMCP server that enables AI models to securely interact with a Bitwarden password manager vault via the rbw CLI.111MIT
- AlicenseAqualityAmaintenanceMCP server for secure AI agent access to Bitwarden/Vaultwarden vaults with BYOK, exposing tools to list items, reveal secrets via encrypted Sends, get TOTP codes, and save credentials.7274 npmMIT