op-mcp
Enables to manage 1Password resources including vaults, items, documents, users, groups, and more through the 1Password CLI, exposing 65 tools for comprehensive password management via natural language.
README
op-mcp
MCP (Model Context Protocol) server for 1Password CLI, implemented in Bun TypeScript.
This is a port of the Rust op-mcp implementation to TypeScript for use with Bun runtime.
Features
- Wraps the 1Password CLI (
op) as an MCP server - Exposes 65 tools for managing 1Password resources
- Full TypeScript type safety with Zod schema validation
- Supports all major 1Password operations:
- Authentication (whoami, signin, signout)
- Account management
- Vault operations
- Item CRUD
- Document management
- User management
- Group management
- Connect server management
- Service accounts
- Events API
- Secret reading and injection
Prerequisites
- Bun runtime
- 1Password CLI (
op) installed and in PATH - 1Password account with CLI access configured
Authentication
The server supports automatic authentication via environment variables:
Option 1: Service Account Token (Recommended for automation)
export OP_SERVICE_ACCOUNT_TOKEN="your-service-account-token"
Option 2: Password-based Auto-signin
export OP_ACCOUNT="my" # Your account shorthand
export OP_PASSWORD="your-password"
When both OP_ACCOUNT and OP_PASSWORD are set, the server automatically signs in on startup.
Option 3: Default Account (Manual signin required)
export OP_ACCOUNT="my" # Your account shorthand
This sets the default account but requires you to be already signed in via op signin.
Installation
cd op-mcp.bun
bun install
Usage
Running the server
bun run start
# or
bun run src/index.ts
MCP Configuration
Add to your MCP client configuration file.
Claude Code (~/.claude.json)
Password-based auto-signin:
{
"mcpServers": {
"1password": {
"command": "bun",
"args": ["run", "/home/won/lab/config/op-mcp/op-mcp.bun/src/index.ts"],
"env": {
"OP_ACCOUNT": "my",
"OP_PASSWORD": "your-password"
}
}
}
}
Service account token:
{
"mcpServers": {
"1password": {
"command": "bun",
"args": ["run", "/home/won/lab/config/op-mcp/op-mcp.bun/src/index.ts"],
"env": {
"OP_SERVICE_ACCOUNT_TOKEN": "ops_..."
}
}
}
}
Default account (requires manual signin):
{
"mcpServers": {
"1password": {
"command": "bun",
"args": ["run", "/home/won/lab/config/op-mcp/op-mcp.bun/src/index.ts"],
"env": {
"OP_ACCOUNT": "my"
}
}
}
}
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json)
{
"mcpServers": {
"1password": {
"command": "/path/to/bun",
"args": ["run", "/path/to/op-mcp.bun/src/index.ts"],
"env": {
"OP_ACCOUNT": "my",
"OP_PASSWORD": "your-password"
}
}
}
}
Environment Variables Reference
| Variable | Description |
|---|---|
OP_SERVICE_ACCOUNT_TOKEN |
Service account token for authentication (takes priority) |
OP_ACCOUNT |
Account shorthand (e.g., my, work) |
OP_PASSWORD |
Password for auto-signin (requires OP_ACCOUNT) |
Tools
The server exposes 65 tools organized by domain:
Authentication (3 tools)
whoami- Get current user infosignin- Sign in to 1Passwordsignout- Sign out of 1Password
Account (4 tools)
account_list- List configured accountsaccount_get- Get account detailsaccount_add- Add a new accountaccount_forget- Remove an account from device
Vault (11 tools)
vault_list- List vaultsvault_get- Get vault detailsvault_create- Create a vaultvault_edit- Edit a vaultvault_delete- Delete a vaultvault_user_list- List users with vault accessvault_user_grant- Grant user access to vaultvault_user_revoke- Revoke user access from vaultvault_group_list- List groups with vault accessvault_group_grant- Grant group access to vaultvault_group_revoke- Revoke group access from vault
Item (9 tools)
item_list- List itemsitem_get- Get item detailsitem_create- Create an itemitem_edit- Edit an itemitem_delete- Delete an itemitem_move- Move item to another vaultitem_share- Create shareable linkitem_template_list- List item templatesitem_template_get- Get template details
Document (5 tools)
document_list- List documentsdocument_get- Download documentdocument_create- Upload documentdocument_edit- Replace document contentdocument_delete- Delete document
User (8 tools)
user_list- List usersuser_get- Get user detailsuser_provision- Create new useruser_confirm- Confirm pending useruser_edit- Edit useruser_suspend- Suspend useruser_reactivate- Reactivate useruser_delete- Delete user
Group (8 tools)
group_list- List groupsgroup_get- Get group detailsgroup_create- Create groupgroup_edit- Edit groupgroup_delete- Delete groupgroup_user_list- List group membersgroup_user_grant- Add user to groupgroup_user_revoke- Remove user from group
Connect (11 tools)
connect_server_list- List Connect serversconnect_server_get- Get server detailsconnect_server_create- Create serverconnect_server_edit- Edit serverconnect_server_delete- Delete serverconnect_token_list- List tokensconnect_token_create- Create tokenconnect_token_edit- Edit tokenconnect_token_delete- Delete tokenconnect_vault_grant- Grant vault accessconnect_vault_revoke- Revoke vault access
Service Account (2 tools)
service_account_create- Create service accountservice_account_ratelimit- Check rate limit
Events API (1 tool)
events_api_create- Create Events API integration
Secrets (3 tools)
secret_read- Read secret by referencesecret_inject- Inject secrets into templatesecret_run- Run command with secrets
Development
# Type check
bun run typecheck
# Build (optional)
bun run build
Testing
The project includes a comprehensive integration test suite that runs against a real 1Password account.
Prerequisites
Ensure you're authenticated before running tests:
export OP_ACCOUNT="my"
export OP_PASSWORD="your-password"
Running Tests
# Run all tests
bun test
# Run specific test suites
bun test:auth # Authentication tests
bun test:account # Account management tests
bun test:vault # Vault CRUD tests
bun test:item # Item CRUD tests
bun test:document # Document upload/download tests
bun test:user # User management tests (admin required)
bun test:group # Group management tests
bun test:connect # Connect server tests (Business/Teams required)
bun test:service # Service account tests
bun test:events # Events API tests (Business/Enterprise required)
bun test:secrets # Secret read/inject tests
Test Behavior
- Tests create resources with
op-mcp-testprefix for easy identification - Resources are cleaned up after each test suite
- Tests that require admin privileges or specific account types are automatically skipped
- A test vault named
op-mcp-test-vaultis created/reused for item and document tests
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。