Import a key from a file
crypto_key_importImport PKCS#8 private keys or raw 32-byte symmetric/HMAC keys from a server-approved file and get an opaque handle that keeps key material inside the service.
Instructions
Import an existing key from a file in the directory the server operator set in CRYPTO_MCP_KEY_DIR (disabled when it is unset). Reads an unencrypted PKCS#8 PEM private key (Ed25519, RSA 2048/3072/4096, ECDSA P-256/P-384/secp256k1; the type comes from the key) or a raw 32-byte key, as 32 binary bytes or 64 hex digits, imported as 'symmetric-256' (default) or 'hmac-sha256'. Files over 65536 bytes are refused. The key bytes never pass through the conversation. Secret key material stays inside the server; only an opaque keyHandle is returned.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "crypto_key_import"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | For a raw 32-byte key only: 'symmetric-256' (crypto_encrypt, crypto_decrypt, crypto_kms_wrap; default) or 'hmac-sha256' (crypto_sign, crypto_verify). | |
| path | Yes | Path of the key file, relative to CRYPTO_MCP_KEY_DIR. Absolute paths, '..' segments and symlinks that lead outside the directory are refused. |