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

# ChatGPT (custom connector)

> Connect XentFi agent tools to ChatGPT via a hosted MCP connector.

ChatGPT's custom connectors (Settings → Connectors → Advanced → Custom Connector, or the equivalent in ChatGPT Enterprise/Team admin console) speak MCP over **remote Streamable HTTP**, not stdio — the subprocess-spawning config used in the other guides won't work here. You need a hosted instance of `xentfi-mcp-http`.

<Steps>
  <Step title="Deploy the HTTP server">
    Anywhere that runs Node 18+ — a small VM, Fly.io, Render, Railway, or a container platform:

    ```dockerfile theme={null}
    FROM node:20-slim
    WORKDIR /app
    RUN npm install @xentfi/mcp-server
    EXPOSE 8787
    CMD ["npx", "xentfi-mcp-http"]
    ```

    Deploy behind TLS (ChatGPT requires HTTPS), e.g. at `https://xentfi-mcp.yourcompany.com`. Health check: `GET /healthz`.

    This server is **stateless and multi-tenant** — don't set `XENTFI_API_KEY` in its environment for a shared deployment; each request supplies its own agent key (next step). See [Remote HTTP Deployment](/agent/http-transport) for full details.
  </Step>

  <Step title="Configure the auth header">
    In ChatGPT's custom connector setup, configure an `Authorization` header sent with every call:

    ```
    Authorization: Bearer sk_agent_xxx
    ```

    If you also need the market-data tools (which require an organization ID), add a second custom header:

    ```
    x-xentfi-org-id: org_xxx
    ```
  </Step>

  <Step title="Register the connector">
    In ChatGPT: **Settings → Connectors → Advanced settings → Add custom connector** (naming and location vary by plan/version):

    * **Name**: XentFi
    * **MCP Server URL**: `https://xentfi-mcp.yourcompany.com/mcp`
    * **Authentication**: Custom headers as configured above
  </Step>

  <Step title="Enable it in a chat">
    Save, then enable the XentFi connector via the "+" / tools menu in a chat to let the model call `xentfi_*` tools.
  </Step>
</Steps>

## Notes on trust & scoping

<Warning>
  Every distinct ChatGPT user/workspace should get its **own** XentFi agent, API key, and Policy — not a shared one. The header you configure is the credential that authorizes payments; treat it like a password.
</Warning>

* Keep `xentfi_create_payment`'s `confirm: true` requirement in mind: enable ChatGPT's tool-use/action-review setting for any connector that can move funds, so the call is surfaced for confirmation before it finalizes.
* For a read-only assistant (e.g. a portfolio dashboard), issue an API key attached to a Policy with all limits at `0` and an empty allowlist, so `xentfi_create_payment` always returns `POLICY_DENIED` even if invoked.

## Next steps

<CardGroup cols={2}>
  <Card title="Remote HTTP Deployment" icon="server" href="/agent/http-transport">
    Full deployment recipes: Docker, reverse proxy, Fly/Render/Railway.
  </Card>

  <Card title="Error Handling" icon="alert-triangle" href="/agent/errors">
    How policy denials and auth failures surface.
  </Card>
</CardGroup>
