Skip to main content
Glama
op-mcp
by jluckyiv

op-mcp

1Password CLI (op) をラップし、MCPクライアント(Cowork、Claude Code、Claude Desktop)に対してシークレットへのアクセスとアイテム管理機能を提供するMCPサーバーです。

アーキテクチャ

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

このPythonサーバーは意図的に軽量に設計されています。すべてのツールハンドラーは op CLI を呼び出し、JSONを解析するか、生の出力を返します。生体認証、セッションキャッシュ、およびすべての保管庫へのアクセスはCLI側が処理します。Python側はMCPプロトコルとargvの構築のみを処理します。

この設計は本質的にステートレスです。各ツール呼び出しは新しいCLIプロセスを生成します。op は1Passwordデスクトップアプリ内で独自のセッションをキャッシュするため、当サーバーでセッション、トークン、資格情報を管理することはありません。詳細な根拠については docs/design-notes.md を参照してください。

Related MCP server: @1claw/mcp

前提条件

  • Python 3.11以降

  • op CLIがインストールされており、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 バイナリ(一時的なシェルスクリプト)を使用するため、実際のCLIや1Passwordへのアクセスは不要です。ライブテスト(@pytest.mark.live とマークされたもの)は実際のCLIに対して実行され、Touch IDをトリガーするため、デフォルトではスキップされます。

ツール

合計10個のツール: インフラストラクチャ3個、読み取り4個、書き込み3個。

インフラストラクチャ

ツール

説明

op_ping

MCPサーバーの生存確認

op_version

op CLIバイナリのバージョン

op_whoami

現在認証されている1Passwordアカウント

読み取りツール

ツール

説明

op_list_vaults

アクセス可能なすべての保管庫を一覧表示(名前とID)

op_get_item

名前またはIDでアイテムの全フィールドを取得

op_read_secret

op://vault/item/field 参照でシークレットを読み取り

op_list_items

保管庫内(または全保管庫)のアイテムを一覧表示

書き込みツール

ツール

説明

op_create_item

新しいアイテムを作成

op_edit_item

既存のアイテムを編集

op_delete_item

アイテムをアーカイブまたは完全に削除

範囲外(現時点)

  • 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…

    Related MCP Connectors

    • Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.

      https://remote.exza.de/mcp
    • Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.

      https://mssql.insightfulmcp.com/
    • 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.

      https://mcp.remote-mcp.com
    • 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

      https://mcp.kliv.dev/mcp

    Related MCP Servers

    • A
      license
      C
      quality
      C
      maintenance
      An MCP server that integrates 1Password with AI agents, providing secure access to vaults and items with secrets redacted by default.
      16
      19 npm
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for secure, just-in-time secret retrieval from 1claw vault and malicious content inspection, enabling AI agents to access secrets and security analysis.
      1
      763 npm
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      MCP server that enables AI models to securely interact with a Bitwarden password manager vault via the rbw CLI.
      11
      1
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      MCP 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.
      7
      274 npm
      MIT