op-mcp
An MCP server that provides secure access to 1Password secrets and item management through the 1Password CLI. It enables MCP clients like Claude and Cursor to read, create, edit, and delete password vault items with biometric authentication handled by the 1Password desktop app.
README
op-mcp
MCP server that wraps the 1Password CLI
(op), exposing secret access and item management to MCP clients
(Cowork, Claude Code, Claude Desktop).
Architecture
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 vaults
The Python server is deliberately thin. Every tool handler shells out
to the op CLI and either parses JSON or returns the raw output. The
CLI handles biometric auth, session caching, and all vault access.
The Python side handles MCP protocol and argv construction.
This design is stateless by construction: each tool call spawns a
fresh CLI process. op caches its own session inside the 1Password
desktop app — we don't manage sessions, tokens, or credentials. See
docs/design-notes.md for the full rationale.
Prerequisites
- Python 3.11 or newer
- The
opCLI installed and on PATH. Install via Homebrew:brew install --cask 1password-cli(tested with v2.33.1). - The 1Password desktop app installed and CLI integration enabled: 1Password → Settings → Developer → ✓ "Integrate with 1Password CLI".
- Touch ID enabled for CLI authorization (same settings pane).
Install
uv tool install .
This creates an isolated venv and puts op-mcp on PATH. To upgrade
after code changes:
uv tool install --force .
--force overwrites the existing entry point and rebuilds from source.
(--reinstall re-downloads PyPI dependencies — not needed for a local
path install.)
Run
The server communicates over stdio, so it's normally launched by an MCP client rather than invoked by hand. For local smoke testing:
op-mcp
The server logs to stderr and waits for MCP protocol messages on stdin. Press Ctrl-C to exit.
Configure an MCP client
Claude Desktop: Settings → Connectors → Add → enter op-mcp
as the command. Or edit claude_desktop_config.json directly:
{
"mcpServers": {
"op": {
"command": "op-mcp"
}
}
}
Claude Code: Add to .mcp.json (project) or ~/.claude/mcp.json
(global) with the same shape.
Cowork: Add via Cowork's MCP server configuration.
Recommended permissions
Reads are safe to allow; writes should ask for confirmation.
{
"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"
]
}
}
Development
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
Tests use a fake op binary (temporary shell scripts), so they
don't require the real CLI or 1Password access. Live tests (marked
@pytest.mark.live) run against the real CLI, trigger Touch ID,
and are skipped by default.
Tools
10 tools total: 3 infrastructure, 4 read, 3 write.
Infrastructure
| Tool | Description |
|---|---|
op_ping |
MCP server liveness check |
op_version |
op CLI binary version |
op_whoami |
Currently authenticated 1Password account |
Read tools
| Tool | Description |
|---|---|
op_list_vaults |
List all accessible vaults (names and IDs) |
op_get_item |
Get all fields of an item by name or ID |
op_read_secret |
Read a secret by op://vault/item/field reference |
op_list_items |
List items in a vault (or across all vaults) |
Write tools
| Tool | Description |
|---|---|
op_create_item |
Create a new item |
op_edit_item |
Edit an existing item |
op_delete_item |
Archive or permanently delete an item |
Out of scope (for now)
op signin/op signout— session management isop's job.op document/op vault— add when use cases emerge.op inject/op run— template injection and env-loading workflows are command-line conveniences without a clean MCP equivalent.- Service account tokens — this server assumes biometric desktop auth.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。