ncrypted / guides

Vercel AI SDK

Drop-in AI SDK tools: one-time links and Vercel env delivery, encrypted in your server process.

npm install ncrypted ai zod
import { generateText } from "ai";
import { ncryptedTools } from "ncrypted/ai-sdk";

const { text } = await generateText({
  model, // your model
  tools: ncryptedTools(), // ncrypted_create, ncrypted_read, ncrypted_status, ncrypted_burn, ncrypted_to_vercel_env
  system: "When a credential must be shared or installed, use the ncrypted tools. Never paste secrets into chat.",
  prompt: "Create a one-time link for the new admin password so I can send it to Sam.",
});

Encryption happens in your server process; ncrypted only stores ciphertext. Pick a subset with `ncryptedTools({ include: ["ncrypted_create", "ncrypted_read"] })`. `ncrypted_to_vercel_env` needs VERCEL_TOKEN and writes the value without the model ever seeing it. Payments come from NCRYPTED_WALLET_PRIVATE_KEY once the free tier is used up.

via MCP instead

import { createMCPClient } from "@ai-sdk/mcp";
import { Experimental_StdioMCPTransport } from "@ai-sdk/mcp/mcp-stdio";

const ncrypted = await createMCPClient({
  transport: new Experimental_StdioMCPTransport({ command: "npx", args: ["-y", "@seidl-family/ncrypted-mcp"] }),
});
const tools = await ncrypted.tools(); // includes the request-a-secret tools; close() when done

pricing

The first 3 secrets per day are free (TTL up to 24h). After that each costs 0.005 USDC, paid over x402 from a local Base wallet: `npx ncrypted wallet new` (or the ncrypted_wallet_setup tool) creates it and returns a funding link. Reads, requests and deliveries are free.