Everything an autonomous agent (or its developer) needs to discover, authenticate against, and call cloakapps' MCP server. Information-dense, machine-friendly, and the canonical source — start here.
If your agent is crawling cloakapps for the first time, start with one of these:
https://www.cloakapps.com/llms.txt
Plain-text manifest pointing to all agent-relevant resources. Lowest-friction entry point.
https://www.cloakapps.com/.well-known/mcp.json
JSON manifest of MCP server(s) hosted by cloakapps — endpoint URL, transport, auth model, advertised tools.
GET https://kms.cloakapps.com/kms/mcp/info
Live discovery endpoint on the KMS server itself. Returns the canonical tool list, JSON-RPC examples, and Codex/Cursor configs. Requires a Bearer token.
Three steps from zero to a successful tool call.
Sign in to kms-console, go to Agent access, click New credential. Pick the scopes the agent needs (see scope table below). You'll get a credential ID and a one-time secret — copy the secret now, it isn't shown again.
curl -H "Authorization: Bearer $CLOAK_AGENT_TOKEN" \ https://kms.cloakapps.com/kms/mcp/info
Returns the canonical tool list and JSON-RPC example payloads.
{
"mcpServers": {
"cloakKms": {
"url": "https://kms.cloakapps.com/kms/mcp",
"headers": {
"Authorization": "Bearer $CLOAK_AGENT_TOKEN"
}
}
}
}
POST /kms/mcp
Content-Type: application/json
Authorization: Bearer $CLOAK_AGENT_TOKEN
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}
Nine HSM-backed primitives. The live JSON schema for each is at GET /kms/mcp/info; the table below summarises name, required scope, and intent. See the agents page for input/output examples.
| Tool | Scope | Description |
|---|---|---|
| kms_list_masterkeys | KEYS_READ | List masterkeys visible to the credential. |
| kms_read_public_key | PUBLIC_KEY_READ | Return the PEM public key for a named masterkey. |
| kms_create_masterkey | KEY_GENERATE | Provision a new HSM key (RSA / ECC / AES; SIGN / ENCRYPT / DERIVE usage). |
| kms_delete_masterkey | KEY_DELETE | Irreversibly delete a masterkey from every keystore that holds it. |
| kms_sign | CRYPTO_SIGN | Sign a SHA-256 digest inside the HSM (RSA-PSS / RSA-PKCS / ECDSA). |
| kms_verify | CRYPTO_VERIFY | Verify a signature against a masterkey's public half. |
| kms_encrypt | CRYPTO_ENCRYPT | Encrypt bytes with an HSM-held key (RSA-OAEP / AES-CBC). |
| kms_decrypt | CRYPTO_DECRYPT | Decrypt ciphertext with an HSM-held key. |
| kms_ecdh_derive | CRYPTO_DERIVE | Derive an ECDH shared secret using an HSM-held ECC key and a peer public point. |
All requests carry Authorization: Bearer <token>. Two token kinds are accepted:
Issued by the cloakapps Keycloak realm via the interactive console flow. Carries full user permissions; used by humans and by trusted host applications calling on the user's behalf.
Long-lived, scope-bound token issued via Agent access in kms-console. Per-credential scope is enforced before every operation — a credential without CRYPTO_DECRYPT scope cannot call kms_decrypt, even with a valid token. Credentials can be rotated, auto-rotated, or revoked instantly.
Scope names: KEYS_READ, PUBLIC_KEY_READ, CRYPTO_SIGN, CRYPTO_VERIFY, CRYPTO_ENCRYPT, CRYPTO_DECRYPT, CRYPTO_DERIVE, KEY_GENERATE, KEY_DELETE.
Every MCP tool also has a REST equivalent under /kms/users/{v}/agent-tools/. Use this if your agent framework doesn't speak MCP. Auth and scope enforcement are identical.
GET /kms/users/1/agent-tools/keys POST /kms/users/1/agent-tools/read-public-key POST /kms/users/1/agent-tools/create-masterkey POST /kms/users/1/agent-tools/delete-masterkey POST /kms/users/1/agent-tools/sign POST /kms/users/1/agent-tools/verify POST /kms/users/1/agent-tools/encrypt POST /kms/users/1/agent-tools/decrypt POST /kms/users/1/agent-tools/ecdh-derive
All examples assume CLOAK_AGENT_TOKEN and CLOAK_BASE environment variables.
curl -X POST "$CLOAK_BASE/kms/users/1/agent-tools/sign" \ -H "Authorization: Bearer $CLOAK_AGENT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "alias": "agent-signing-key", "keyId": "0101", "algorithm": "ECDSA_SHA_256", "digestHex": "a4caf7bd…21083d95" }'
# pip install mcp from mcp.client.streamable_http import streamablehttp_client from mcp import ClientSession async with streamablehttp_client( "$CLOAK_BASE/kms/mcp", headers={"Authorization": f"Bearer {token}"} ) as (read, write, _): async with ClientSession(read, write) as s: await s.initialize() result = await s.call_tool("kms_sign", { "alias": "agent-signing-key", "keyId": "0101", "algorithm": "ECDSA_SHA_256", "digestHex": digest_hex })
Once the MCP config block from Step 3 is in place, ask the agent: "Use the cloakKms.kms_list_masterkeys tool to show me my available signing keys." The IDE will surface the tool list and call it on your behalf.
Errors return a typed body with a stable code, a human message, and a remediation hint. Examples:
{
"code": "KEY_NOT_FOUND",
"message": "The requested key was not found.",
"retryable": false,
"remediation": "List available keys first and retry with a valid alias and keyId."
}
Stable codes: INVALID_REQUEST, KEY_NOT_FOUND, UNSUPPORTED_KEY_USAGE, UNSUPPORTED_ALGORITHM, DOWNSTREAM_FAILURE. Scope failures return HTTP 403.
Workflow tools planned but not yet shipped:
encrypt_file / decrypt_file — file-level encrypt/decrypt with policy + receipt. Marketing aliases: cloak_file / uncloak_file. Ships as @cloakapps/cloak-encrypt-mcp — local stdio MCP server so plaintext stays on the agent's host (Cloak Files)sign_pdf — AATL PDF signing (Batchsign)create_receipt / verify_receipt — verifiable audit receiptsrotate_key, revoke_access — policy-bound key/recipient lifecycle