Skip to content
Documentation · MCP server
Docs / Agents & tools

MCP server

Connect an MCP client to model, media and account tools. Use browser sign-in for account access, or supply an API key.

On this page
mcp config (sign in with the browser)
{
  "mcpServers": {
    "xinf": { "url": "https://xavainf.com/mcp/account" }
  }
}

Choose an endpoint

EndpointAuthenticationUse
/mcp/accountBrowser sign-in or API keyAccount tools and inference within the connection's spending cap.
/mcpPublic catalog; key for account toolsModel discovery and clients that supply their own key.

The transport is Streamable HTTP. Requests are independent and do not require a persistent server session. Both endpoints accept Authorization: Bearer <key>.

or with an API key
{
  "mcpServers": {
    "xinf": {
      "url": "https://xavainf.com/mcp",
      "headers": { "Authorization": "Bearer xk_live_..." }
    }
  }
}

Sign in (OAuth)

We implement the MCP authorization spec: OAuth 2.1 with PKCE, protected resource metadata at /.well-known/oauth-protected-resource/mcp/account, server metadata at /.well-known/oauth-authorization-server, dynamic client registration and Client ID Metadata Documents. Access tokens last an hour and refresh by themselves; refresh tokens rotate on every use.

During consent, choose a monthly spending cap (default $50). It resets at 00:00 UTC on the first day of the month. Calls that would exceed it return 402 spending_cap_reached before inference starts.

Review or revoke access under API keys → Connected apps. Revoking a connection stops it immediately. For clients without browser sign-in, device login saves a revocable account key in ~/.xinf/credentials with mode 600.

Install and sign-in steps for each client (Claude Code, Claude Desktop, Codex, Cursor, Gemini CLI, OpenCode, Kimi, Pi, Cline, Windsurf) are on Agent plugins.

device login (any client)
curl -fsSLo xinf-login.mjs https://raw.githubusercontent.com/xavadao/xinf-plugin/main/bin/xinf-login.mjs
node xinf-login.mjs
export XINF_API_KEY="$(sed -n 's/^XINF_API_KEY=//p' ~/.xinf/credentials)"

Connect your application

Your own app can sign people in with their Xava Inference account too: register it in My Clients for a client ID (and a secret, shown once), then use the same OAuth 2.1 + PKCE flow. Request profile account:read for identity and balances, inference to run models, or tools:call for the marketplace tools your client requires. Users confirm every spending permission and pick a monthly cap for your app. Each marketplace tools/call from a registered client needs its own Idempotency-Key header.

Registration, scopes, the consent screen, the monthly cap, idempotent tool calls and every error are in Sign in with Xava. To sell your own tools, see Build & sell tools.

Tools

toolaccountwhat it does
list_modelsnosearch the catalog by type, provider or name, with the list price per unit
get_model_pricingnolist price for one model
chatyesone chat completion on any text model (prompt or messages)
generate_imageyesimages from a prompt; returns file URLs
generate_videoyesvideo from a prompt, by duration and resolution
generate_audioyesspeech from text, or music and sound from a prompt
get_balanceyesyour available and held credit
get_usage_summaryyesspend, requests and buybacks over the last N days, per model

Marketplace tools. Tools you install from Connections appear next to these on a signed-in connection or one with an API key, named <server>__<tool>. Each call is charged from your balance at the tool's listed price, and a failed call is not charged. With an API key, tool calls count toward the key's spend limit, together with its model requests: a call over the limit is not run and returns a tool error (isError) with the code key_limit_reached and limit_usd, spent_usd and required_usd. An expired key gets key_expired. A signed-in connection has no key limit; its monthly cap applies. Turn tools on or off in Dashboard, Connections. Pricing and billing: Build & sell tools.

For agents that read docs: /llms.txt (an index) and /llms-full.txt (everything, with the model list).