1Password MCP Server - Complete Setup Guide¶
Table of Contents¶
Prerequisites¶
System Requirements¶
- Python: 3.12 or higher
- Operating System: Windows, macOS, or Linux
- Memory: Minimum 256MB RAM
- Network: Internet access for 1Password API calls
1Password Requirements¶
- 1Password Account: Business or Enterprise plan
- Service Account: With appropriate vault permissions
- Vault Access: Read permissions to target vaults
Installation Methods¶
Method 1: PyPI Installation (Recommended)¶
# Install the package
pip install onepassword-mcp-server
# Verify installation
onepassword-mcp-server --help
Method 2: From Source¶
# Clone the repository
git clone https://github.com/your-org/1password-mcp-server.git
cd 1password-mcp-server
# Install with uv (recommended)
uv sync
# Or install with pip
pip install -e .
Method 3: Docker (Coming Soon)¶
# Pull the image
docker pull onepassword/mcp-server:latest
# Run with environment variables
docker run -e OP_SERVICE_ACCOUNT_TOKEN=ops_your_token onepassword/mcp-server
Configuration¶
Step 1: Create 1Password Service Account¶
- Access Developer Console:
- Go to 1Password Developer Console
-
Sign in with your 1Password account
-
Create Service Account:
- Click "Create Service Account"
- Choose descriptive name: "MCP Server - [Environment]"
-
Save the token securely
-
Configure Vault Access:
- Select target vaults (e.g., "AI", "Credentials")
- Grant "Read" permissions
- For write operations: Grant "Read/Write" permissions
Step 2: Environment Configuration¶
Create a .env
file:
# Required: 1Password Service Account Token
OP_SERVICE_ACCOUNT_TOKEN=ops_your_service_account_token_here
# Environment (development, staging, production)
ENVIRONMENT=production
# Security Settings
SECURITY_DEFAULT_VAULT=AI
RATE_LIMIT_MAX_REQUESTS=10
RATE_LIMIT_WINDOW_SECONDS=60
# Feature Flags
ENABLE_WRITE_OPERATIONS=false # Enable with caution
# Logging Configuration
LOG_LEVEL=INFO
LOG_FORMAT=json
# Monitoring
MONITORING_HEALTH_CHECK_ENABLED=true
MONITORING_METRICS_ENABLED=true
Step 3: Claude Desktop Configuration¶
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"1Password": {
"command": "onepassword-mcp-server",
"env": {
"OP_SERVICE_ACCOUNT_TOKEN": "ops_your_token_here"
}
}
}
}
Alternative for development:
{
"mcpServers": {
"1Password": {
"command": "uv",
"args": [
"run",
"--with", "onepassword-mcp-server",
"onepassword-mcp-server"
],
"env": {
"OP_SERVICE_ACCOUNT_TOKEN": "ops_your_token_here"
}
}
}
}
Deployment¶
Development Environment¶
# Set environment variables
export OP_SERVICE_ACCOUNT_TOKEN=ops_your_token
export ENVIRONMENT=development
export LOG_LEVEL=DEBUG
# Run the server
onepassword-mcp-server
Production Environment¶
- Security Checklist:
- Use dedicated service account for production
- Limit vault access to minimum required
- Enable audit logging
- Configure rate limiting
-
Set up monitoring
-
Environment Variables:
-
Process Management:
High Availability Setup¶
For production environments requiring high availability:
- Load Balancer Configuration:
- Health check endpoint:
/health
- Timeout: 30 seconds
-
Retry: 3 attempts
-
Multiple Instances:
Verification¶
Test Installation¶
# Check version
onepassword-mcp-server --version
# Test configuration
python -c "
from onepassword_mcp_server.config import ConfigLoader
config = ConfigLoader.load_from_environment()
print('Configuration loaded successfully')
print(f'Environment: {config.environment.value}')
print(f'Default vault: {config.security.default_vault}')
"
Test 1Password Connectivity¶
# Health check
python -c "
import asyncio
from onepassword_mcp_server.monitoring import onepassword_connectivity_check
result = asyncio.run(onepassword_connectivity_check())
print(f'1Password connectivity: {result[\"status\"]}')
"
Test Claude Integration¶
- Launch Claude Desktop
- Test credential retrieval:
- Test health monitoring:
Troubleshooting¶
Common Issues¶
1. Authentication Failures¶
Symptoms:
Solutions: - Verify token is set: echo $OP_SERVICE_ACCOUNT_TOKEN
- Check token format: Should start with ops_
- Verify token permissions in 1Password console
2. Vault Access Denied¶
Symptoms:
Solutions: - Verify vault exists and is accessible - Check service account permissions - Confirm item name spelling and format
3. Rate Limiting¶
Symptoms:
Solutions: - Wait for rate limit window to reset - Increase RATE_LIMIT_MAX_REQUESTS
if appropriate - Implement client-side rate limiting
4. Circuit Breaker Open¶
Symptoms:
Solutions: - Wait for circuit breaker recovery (default: 60 seconds) - Check 1Password service status - Review error logs for underlying issues
Advanced Troubleshooting¶
Enable Debug Logging¶
Test Individual Components¶
# Test configuration loading
python -c "
from onepassword_mcp_server.config import ConfigLoader
try:
config = ConfigLoader.load_from_environment()
print('✓ Configuration loaded successfully')
except Exception as e:
print(f'✗ Configuration error: {e}')
"
# Test 1Password authentication
python -c "
import asyncio
from onepassword_mcp_server.server import OnePasswordSecureClient
from onepassword_mcp_server.config import ConfigLoader
from onepassword_mcp_server.monitoring import MetricsCollector
async def test_auth():
config = ConfigLoader.load_from_environment()
metrics = MetricsCollector()
client = OnePasswordSecureClient(config, metrics)
try:
await client._authenticate()
print('✓ 1Password authentication successful')
except Exception as e:
print(f'✗ Authentication error: {e}')
asyncio.run(test_auth())
"
Performance Monitoring¶
# Check metrics
python -c "
import asyncio
from onepassword_mcp_server.server import get_metrics_impl
result = asyncio.run(get_metrics_impl())
print('Current metrics:', result)
"
Getting Help¶
- Check Logs: Review application logs for detailed error information
- Health Status: Use health check endpoints for system status
- Documentation: Review Security Policy for security-related issues
- Community: Check GitHub issues for similar problems
- Support: Contact support with logs and configuration details
Next Steps¶
After successful setup:
- Review Security: Read the Security Guide
- Configure Monitoring: Set up log aggregation and alerting
- Test Backup: Verify credential access during outages
- Performance Tuning: Adjust rate limits and timeouts for your use case
- Documentation: Document your specific deployment configuration
For additional configuration options, see the Configuration Reference. For security considerations, see the Security Guide.