# 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`.

1. **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:read` to read, plus `crm:write` and `agents:write` to make changes. Keep it in an environment variable, never in a file you commit:

   ```bash
   export RA_API_KEY=ra_live_…
   ```
2. **Install** (pinned):

   ```bash
   npm install --save-exact @anthropic-ai/claude-agent-sdk
   ```
3. **Give the agent the server:**

   ```ts
   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);
   }
   ```
4. **Check it.** The answer lists deals from your account. Any send or change to an existing record goes through
   `ra_propose` and waits in the approval inbox.

Next: [task recipes](https://www.closefinch.com/docs/recipes), [the MCP tools](https://www.closefinch.com/docs/mcp/tools), and
[what an agent can do alone](https://www.closefinch.com/for-agents).
