Skip to content

Quickstart

Quickstart: Claude Agent SDK

Markdown version

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:

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

    npm install --save-exact @anthropic-ai/claude-agent-sdk
  3. Give 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);
    }
  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, the MCP tools, and what an agent can do alone.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.

Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.