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
{
"mcpServers": {
"xinf": { "url": "https://xavainf.com/mcp/account" }
}
}Choose an endpoint
| Endpoint | Authentication | Use |
|---|---|---|
/mcp/account | Browser sign-in or API key | Account tools and inference within the connection's spending cap. |
/mcp | Public catalog; key for account tools | Model 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>.
{
"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.
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
| tool | account | what it does |
|---|---|---|
list_models | no | search the catalog by type, provider or name, with the list price per unit |
get_model_pricing | no | list price for one model |
chat | yes | one chat completion on any text model (prompt or messages) |
generate_image | yes | images from a prompt; returns file URLs |
generate_video | yes | video from a prompt, by duration and resolution |
generate_audio | yes | speech from text, or music and sound from a prompt |
get_balance | yes | your available and held credit |
get_usage_summary | yes | spend, 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).