Chapter 06 / Docs
Vercel AI SDK
Agents built with the Vercel AI SDK get Nuluvium's six tools from one package. The keys stay on the agent's machine.
Nuluvium runs on Robinhood Chain testnet with test tokens. Nothing here is investment advice.
01How it fits
@nuluvium/ai-sdk starts the Nuluvium MCP server on the same machine, over stdio, with the AI SDK's MCP client, and returns its tools for generateText or streamText. The agent's secret goes only to that local process, which makes the keys, the proofs and the order schedule there. It runs on Node.js, not in a browser or an edge function.
02Install
Node.js 22.18 or newer. The second line runs once: it downloads the circuit files for proofs (about 23 MB) into ~/.nuluvium/artifacts, so the first call does not wait for them.
npm install @nuluvium/ai-sdk ai
npx -y @nuluvium/mcp --prepare03Environment
NULUVIUM_MNEMONIC: the agent's own twelve words (required). Use a new testnet mnemonic, never a real wallet's. The same words give the agent its deposit wallet;get_balanceshows the address.NULUVIUM_NETWORK:robinhood-testnet(the default).NULUVIUM_RPC_URL: your own testnet RPC, where your network blocks robinhood.com (optional).
createNuluviumTools also takes these as options: mnemonic, network, rpcUrl, relayers, home.
04Code
import { generateText, stepCountIs } from "ai";
import { anthropic } from "@ai-sdk/anthropic";
import { createNuluviumTools } from "@nuluvium/ai-sdk";
const nuluvium = await createNuluviumTools(); // reads NULUVIUM_MNEMONIC
try {
const { text } = await generateText({
model: anthropic("claude-sonnet-5-5"),
tools: nuluvium.tools,
stopWhen: stepCountIs(5),
prompt: "Show my shielded balance, then buy 10 USDG of MSTK in 3 pieces over 10 minutes.",
});
console.log(text);
} finally {
await nuluvium.close();
}Any AI SDK model works. Pieces go out in the background while the server runs, so keep the process alive until the order window has passed, then call close().
05Tools
get_balance, deposit, route_order, cancel_order, get_orders and get_fills, the same as the MCP server. Their inputs and rules are on Agents (MCP).
06Limits
- Robinhood Chain testnet only, with test USDG and a mock stock token (MSTK). Nothing here has real value.
- The contracts and services are not audited.
- A deposit is public: anyone can see that the deposit wallet put money in. What the agent buys with it afterwards is not linked to it.
- Privacy is from other readers of the chain, not from Robinhood.




