1password — Claude Code MCP server: what it does, how to install
Connects a 1Password Service Account to your AI assistant. Enables safe credential management and local command execution using op:// references without leaking plaintext.
claude mcp add --env OP_SERVICE_ACCOUNT_TOKEN=<OP_SERVICE_ACCOUNT_TOKEN> --env OP_KEYCHAIN_SERVICE=<OP_KEYCHAIN_SERVICE> --env OP_KEYCHAIN_ACCOUNT=<OP_KEYCHAIN_ACCOUNT> --transport stdio 1password -- npx -y @takescake/1password-mcpWhat 1password does
This server connects AI coding assistants to your 1Password vaults using a Service Account token. It provides fifteen tools covering entry searches, secure note creation, password generation, and credential updates.
Inspection tools omit passwords and sensitive tokens by default, returning non-confidential metadata unless explicitly requested. The op_run tool runs shell commands by resolving paths like op://vault/item/field straight into child process environment variables, scrubbing known secrets from the returned console stream.
Operation requires Node.js 20 or newer and an active service account token passed via OP_SERVICE_ACCOUNT_TOKEN. Without vault access granted to that service account, queries will fail.
What it helps with
- execute local CLI scripts with secrets injected through
op_run - generate random or memorable passwords and record them in a vault
- search and retrieve entry metadata without exposing confidential fields in chat
- audit accessible vaults and detect duplicate items via workflow prompts
Example prompts for the agent
- Search my automation vault for staging database credentials and show metadata
- Generate a 32-character random password and update the backend service login
- Run the deployment command with
op_runusingop://production/aws/secret_key
How to install 1password
Platform CLI
claude mcp add --env OP_SERVICE_ACCOUNT_TOKEN=<OP_SERVICE_ACCOUNT_TOKEN> --env OP_KEYCHAIN_SERVICE=<OP_KEYCHAIN_SERVICE> --env OP_KEYCHAIN_ACCOUNT=<OP_KEYCHAIN_ACCOUNT> --transport stdio 1password -- npx -y @takescake/1password-mcpReplace <…> with your own values
Platform CLI
codex mcp add 1password --env OP_SERVICE_ACCOUNT_TOKEN=<OP_SERVICE_ACCOUNT_TOKEN> --env OP_KEYCHAIN_SERVICE=<OP_KEYCHAIN_SERVICE> --env OP_KEYCHAIN_ACCOUNT=<OP_KEYCHAIN_ACCOUNT> -- npx -y @takescake/1password-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"1password": {
"command": "npx",
"args": [
"-y",
"@takescake/1password-mcp"
],
"env": {
"OP_SERVICE_ACCOUNT_TOKEN": "<OP_SERVICE_ACCOUNT_TOKEN>",
"OP_KEYCHAIN_SERVICE": "<OP_KEYCHAIN_SERVICE>",
"OP_KEYCHAIN_ACCOUNT": "<OP_KEYCHAIN_ACCOUNT>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"1password": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@takescake/1password-mcp"
],
"env": {
"OP_SERVICE_ACCOUNT_TOKEN": "<OP_SERVICE_ACCOUNT_TOKEN>",
"OP_KEYCHAIN_SERVICE": "<OP_KEYCHAIN_SERVICE>",
"OP_KEYCHAIN_ACCOUNT": "<OP_KEYCHAIN_ACCOUNT>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e OP_SERVICE_ACCOUNT_TOKEN=<OP_SERVICE_ACCOUNT_TOKEN> -e OP_KEYCHAIN_SERVICE=<OP_KEYCHAIN_SERVICE> -e OP_KEYCHAIN_ACCOUNT=<OP_KEYCHAIN_ACCOUNT> 1password npx -y @takescake/1password-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about 1password
How to install 1password in Claude Code?
Run this terminal command: claude mcp add 1password -e OP_SERVICE_ACCOUNT_TOKEN=<OP_SERVICE_ACCOUNT_TOKEN> -- npx -y @takescake/1password-mcp.
What does 1password MCP server do?
It gives MCP-compatible assistants controlled access to 1Password vaults via a service account token. The agent can browse items, rotate passwords, and pass secret references directly into subcommands.
How does op_run protect credentials?
It injects values from op:// paths strictly into the child subshell environment. The tool redacts resolved secret values from standard output before handing text back to the assistant.