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

# Introduction to XentFi Agent Tools

> Give any AI agent — Claude, Cursor, ChatGPT, ElizaOS, CrewAI, Codex, or your own agent runtime — policy-governed wallets and payments through the Model Context Protocol (MCP).

`@xentfi/mcp-server` is the official **Model Context Protocol (MCP)** server and SDK for XentFi. It exposes an agent's XentFi wallet, spend policy, and payment capabilities as MCP tools, so any MCP-compatible client can call them directly — no custom integration code required.

```bash theme={null}
npm install @xentfi/mcp-server
```

## Why MCP for agents

XentFi's core API (see [API Reference](/api-reference/introduction)) is built for backends and dashboards. Agent workloads are different: an autonomous agent needs to *discover* what it can do, call tools with structured arguments, and get back errors it can reason about — all inside whatever chat or agent runtime it already lives in. MCP standardizes exactly that interface, and `@xentfi/mcp-server` wires it straight into the `/v1/agent-self/*` and `/v1/assets/*` surface of the XentFi API.

```mermaid theme={null}
flowchart TB
    subgraph Client["MCP Client"]
        Claude[Claude Desktop / Code]
        Cursor[Cursor / VS Code]
        ChatGPT[ChatGPT connector]
        Custom[ElizaOS / CrewAI / Codex]
    end

    subgraph SDK["@xentfi/mcp-server"]
        Stdio[xentfi-mcp — stdio]
        Http[xentfi-mcp-http — Streamable HTTP]
        Tools[15 xentfi_* tools]
    end

    subgraph XentFi["XentFi Platform"]
        AgentSelf[Agent Self API]
        Policy[Policy Engine]
        Assets[Assets & Prices API]
    end

    Client --> SDK
    SDK --> Tools
    Tools --> XentFi
    Policy -.enforces limits on.-> AgentSelf
```

## What you get

<CardGroup cols={2}>
  <Card title="🔑 One credential" icon="key">
    Your agent's XentFi API key authenticates every tool call — no separate OAuth flow to build.
  </Card>

  <Card title="🛡️ Server-side guardrails" icon="shield-check">
    Every payment is checked against the agent's XentFi Policy (limits, allowlists, allowed hours) before it executes — enforced by the API, not the client.
  </Card>

  <Card title="🔌 Two transports" icon="plug">
    `xentfi-mcp` (stdio) for local desktop clients, `xentfi-mcp-http` (Streamable HTTP) for remote and multi-tenant deployments.
  </Card>

  <Card title="🧩 Programmatic SDK" icon="code">
    Import `createXentfiMcpServer()` or the raw `XentfiClient` to embed XentFi tools in your own MCP server or agent framework.
  </Card>
</CardGroup>

## The agent tool surface

`@xentfi/mcp-server` exposes 15 tools, all prefixed `xentfi_`, across four areas: **Agent & Wallets**, **Policy**, **Payments**, and **Market Data**. See the full [Tools Reference](/agent/tools-reference) for input/output details.

## Get started

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/agent/quickstart">
    Get an API key and connect your first MCP client in a few minutes.
  </Card>

  <Card title="Tools Reference" icon="list" href="/agent/tools-reference">
    Every `xentfi_*` tool, its arguments, and what it returns.
  </Card>

  <Card title="Claude Desktop / Code" icon="bot" href="/agent/claude-desktop">
    The most common way people run this today.
  </Card>

  <Card title="Remote HTTP deployment" icon="server" href="/agent/http-transport">
    For ChatGPT connectors and shared/multi-tenant deployments.
  </Card>
</CardGroup>

## Relationship to the core API

Agent tools call the same `/v1/agent-self/*` and `/v1/assets/*` routes documented in [API Reference](/api-reference/introduction) — `@xentfi/mcp-server` doesn't add new backend behavior, it just exposes that surface as MCP tools with agent-friendly names, descriptions, and error messages. If you're building an agent that needs to *make payments through x402* rather than manage its own wallet directly, see the [x402 Facilitator](/x402/introduction) tab instead.
