Skip to main content

Keystore MCP Server

PyPI MCP Registry

A Model Context Protocol (MCP) server for Ethereum keystore encryption, decryption, and management following the Web3 Secret Storage Definition Version 3 standard.

Features

Tools (9)

  • encrypt_keystore - Encrypt private key to Web3 Secret Storage V3 format
  • decrypt_keystore - Decrypt keystore to recover private key
  • save_keystore_file - Save keystore with standard Ethereum naming
  • load_keystore_file - Load and validate keystore files
  • get_keystore_info - Extract metadata without decryption
  • validate_keystore - Validate keystore structure
  • change_keystore_password - Change password and optionally upgrade KDF
  • batch_encrypt_keystores - Encrypt multiple wallets
  • keystore_to_private_key_file - Export decrypted private key (dangerous)

Resources (4)

  • keystore://specification - Web3 Secret Storage V3 specification
  • keystore://security-guide - Security best practices
  • keystore://kdf-comparison - Scrypt vs PBKDF2 comparison
  • keystore://examples/{type} - Example keystores

Prompts (4)

  • secure_wallet_backup - Guided backup creation
  • keystore_migration - Migration from legacy formats
  • keystore_recovery - Recovery assistance
  • keystore_security_audit - Security audit workflow

Installation

pip install -e .

# Or with dev dependencies
pip install -e ".[dev]"

Usage

Running the Server

keystore-mcp-server

Claude Desktop Configuration

{
  "mcpServers": {
    "keystore": {
      "command": "keystore-mcp-server"
    }
  }
}

Cryptographic Standards

Web3 Secret Storage V3

  • KDF: scrypt (recommended) or pbkdf2
  • Cipher: AES-128-CTR
  • MAC: Keccak-256
  • UUID: Version 4

Default Scrypt Parameters

Parameter Value Description
N 262144 (2^18) CPU/memory cost
r 8 Block size
p 1 Parallelization
dklen 32 Derived key length

Default PBKDF2 Parameters

Parameter Value Description
c 262144 Iterations
prf hmac-sha256 PRF
dklen 32 Derived key length

Security

⚠️ Important Security Notes:

  1. Never share keystore passwords - Treat like private keys
  2. Use strong passwords - Minimum 12 characters, mixed case, numbers, symbols
  3. Secure file storage - Files created with 0600 permissions
  4. Air-gapped operations - Use offline for high-value wallets
  5. Backup keystores - Store encrypted backups in multiple locations

Examples

Encrypt a Private Key

result = await encrypt_keystore(
    private_key="0x...",
    password="strong-password-123",
    kdf="scrypt"
)

Decrypt a Keystore

result = await decrypt_keystore(
    keystore=keystore_json,
    password="strong-password-123"
)

Save Keystore File

result = await save_keystore_file(
    keystore=keystore_json,
    directory="./keystores"
)
# Creates: UTC--2024-01-15T10-30-00.000Z--address.json

Testing

pytest tests/ -v

License

MIT License

Metadata

Release files for keystore-mcp-server 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keystore-mcp-server 1.0.0
File Size Uploaded
keystore_mcp_server-1.0.0.tar.gz 41.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for keystore-mcp-server 1.0.0
File Interpreter ABI Platform
keystore_mcp_server-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 88.2 kB

Release files / keystore_mcp_server-1.0.0.tar.gz

Download URL keystore_mcp_server-1.0.0.tar.gz
Size 41.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5560c9faa33e0e815a242165e95456bfa853d5cfdf3929de329cf005725a099a
BLAKE2b-256 checksum
How to use checksums
52d59f3e836998a628ad81a2b273e72d5090bed51303497814ab5f70fa67127d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / keystore_mcp_server-1.0.0-py3-none-any.whl

Download URL keystore_mcp_server-1.0.0-py3-none-any.whl
Size 46.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46e72acc1e11df78f0e32fbb5ec82efdbe5845dd284bd2168bb398a0480fbb3b
BLAKE2b-256 checksum
How to use checksums
c61596df52730aa709ae8105a973d99823444b45f73f61820a936a72ab0a0d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page