Quickstart
Quickstart: Claude Agent SDK
You need: Node.js 20 or later, @anthropic-ai/claude-agent-sdk (pin the version you install), an Anthropic API key in ANTHROPIC_API_KEY, and a Closefinch key in RA_API_KEY.
Get a key. Sign up at https://app.closefinch.com/sign-up (the Free plan, no card). An owner creates a key in Settings → API keys and picks its scopes:
crm:readto read, pluscrm:writeandagents:writeto make changes. Keep it in an environment variable, never in a file you commit:export RA_API_KEY=ra_live_…Install (pinned):
npm install --save-exact @anthropic-ai/claude-agent-sdkGive the agent the server:
import { query } from "@anthropic-ai/claude-agent-sdk"; for await (const message of query({ prompt: "Which of my deals close this month and have no next step?", options: { mcpServers: { revenueagent: { type: "http", url: "https://api.closefinch.com/mcp", headers: { Authorization: `Bearer ${process.env.RA_API_KEY}` } }, }, allowedTools: ["mcp__revenueagent__ra_records_list", "mcp__revenueagent__ra_ask"], }, })) { if (message.type === "result") console.log(message.result); }- Check it. The answer lists deals from your account. Any send or change to an existing record goes through
ra_proposeand waits in the approval inbox.
Next: task recipes, the MCP tools, and what an agent can do alone.