> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xentfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Quickstart

> Get an agent API key and connect your first MCP client to XentFi in a few minutes.

This guide gets an AI agent talking to XentFi through MCP — from creating an agent to seeing wallet data inside a chat client.

## Prerequisites

* A XentFi account ([Sign up](https://dashboard.xentfi.com))
* Node.js 18+ available wherever your MCP client spawns tools (most desktop clients bundle their own)
* One of the supported clients: Claude Desktop, Claude Code, Cursor, VS Code, ChatGPT, ElizaOS, CrewAI, or OpenAI Codex/Agents SDK

## Step 1: Create an Agent and get its API key

<Steps>
  <Step title="Log into Dashboard">
    Navigate to [dashboard.xentfi.com](https://dashboard.xentfi.com).
  </Step>

  <Step title="Create an Agent">
    Go to **Agents** → **New Agent**. This is the identity your AI will act as — separate from your own dashboard login.
  </Step>

  <Step title="Attach a Policy">
    Under **Policies**, create or attach a spend policy to the agent: per-transaction / daily / weekly / monthly USD limits, an allowed-recipients list, and (optionally) allowed hours. This is what keeps an autonomous agent from overspending or paying the wrong address — XentFi enforces it server-side on every payment.
  </Step>

  <Step title="Generate the API key">
    From the agent's page, generate an new Agent. Copy the Agent key — it's shown once.
  </Step>
</Steps>

<Warning>
  An agent API key authorizes payments on behalf of that agent. Store it the same way you'd store any other production secret — never in source control or a chat log.
</Warning>

## Step 2: Set your environment variables

```bash theme={null}
export XENTFI_AGENT_KEY="sk_agent_xxx"
```

## Step 3: Connect an MCP client

The fastest path is Claude Desktop. Add this to your MCP config (see [Claude Desktop guide](/agent/claude-desktop) for the exact file path):

```json theme={null}
{
    "mcpServers": {
        "xentfi": {
            "command": "npx",
            "args": [
                "-y",
                "@xentfi/mcp-server"
            ],
            "env": {
                "XENTFI_AGENT_KEY": "sk_agent_xxx",
                "XENTFI_ORG_ID": "org_xxx"
            }
        }
    }
}
```

Restart the client, open a new chat, and confirm the `xentfi` server appears with 15 tools available.

## Step 4: Make your first agent tool call

Ask your agent:

> "Check my XentFi agent info and list my wallets."

Behind the scenes this calls `xentfi_get_agent_info` then `xentfi_list_wallets`:

<CodeGroup>
  ```json xentfi_get_agent_info response theme={null}
  {
    "id": "agent_123e4567-e89b-12d3-a456-426614174000",
    "organizationId": "org_123e4567",
    "name": "Trading Agent",
    "status": "ACTIVE"
  }
  ```

  ```json xentfi_list_wallets response theme={null}
  {
    "data": [
      {
        "id": "aw_123e4567-e89b-12d3-a456-426614174000",
        "agentId": "agent_123e4567",
        "isActive": true,
        "addressWallet": {
          "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0",
          "network": "base-mainnet"
        }
      }
    ],
    "total": 1,
    "hasMore": false
  }
  ```
</CodeGroup>

If `data` is empty, have the agent call `xentfi_create_wallet` first (see [Tools Reference](/agent/tools-reference#xentfi_create_wallet)).

## Step 5: Try a policy-checked payment

> "Send 1 USDC to 0x... from my wallet."

This calls `xentfi_create_payment`, which requires an explicit `confirm: true` and is evaluated against the agent's Policy server-side:

```json theme={null}
{
    "agentWalletId": "aw_123e4567",
    "assetId": "asset_usdc_id",
    "recipient": "0x...",
    "amount": "1.00",
    "confirm": true
}
```

If it exceeds a limit or isn't on the allowlist, you'll get back a structured `POLICY_DENIED` result instead of a silent failure — see [Error Handling](/agent/errors).

## Next steps

<CardGroup cols={2}>
  <Card title="Tools Reference" icon="list" href="/agent/tools-reference">
    Every tool, its arguments, and what it returns.
  </Card>

  <Card title="Choose your client" icon="puzzle" href="/agent/claude-desktop">
    Guides for Claude, Cursor, VS Code, ChatGPT, ElizaOS, CrewAI, and Codex.
  </Card>

  <Card title="Remote deployment" icon="server" href="/agent/http-transport">
    Run a shared, multi-tenant MCP endpoint instead of a local process.
  </Card>

  <Card title="Error handling" icon="alert-triangle" href="/agent/errors">
    How policy denials and API errors surface to the agent.
  </Card>
</CardGroup>
