# Estiba auth.md

How an AI agent gets access to a person's Estiba account. Estiba (estiba.cloud) hosts the apps people build with their agents; the agent works through Estiba's MCP server, `https://app.estiba.cloud/mcp`, or its REST API, `https://app.estiba.cloud/api/v1`.

## Who it is for

AI agents and MCP clients (Claude, ChatGPT, Claude Code, Codex, Cursor or any client that supports remote MCP servers with OAuth) acting for a person who has, or creates, an Estiba account. There are no API keys and no accounts for agents themselves: the agent always acts as the person who approved it.

## Registering

Estiba is an OAuth 2.1 authorization server, issuer `https://app.estiba.cloud`:

- Authorization server metadata: <https://app.estiba.cloud/.well-known/oauth-authorization-server>
- Protected resource metadata of the MCP: <https://app.estiba.cloud/.well-known/oauth-protected-resource/mcp>
- Dynamic client registration (RFC 7591): `POST https://app.estiba.cloud/register`. Public clients (`token_endpoint_auth_method: none`) are accepted, as are `client_secret_post` and `client_secret_basic`.

An MCP client needs nothing but the address: a request to `/mcp` without a token answers 401 with a `WWW-Authenticate` header pointing at the metadata, and the client registers and signs in from there.

## Methods

- Authorization code with PKCE (`S256`), then refresh tokens. The client opens `https://app.estiba.cloud/authorize` in the person's browser; the person signs in with a code sent to their email (signing in with a new email creates the account) and approves the client once. There are no scopes.
- Nothing else: there is no client credentials grant, no anonymous access and no way to create an account without the person.

## Using the credential

- Send the access token as `Authorization: Bearer <token>` to `/mcp` or to any route of `/api/v1` (OpenAPI at `https://app.estiba.cloud/api/v1/openapi.json`).
- Access tokens last an hour; get a new one from `POST https://app.estiba.cloud/token` with the refresh token. Revoke with `POST https://app.estiba.cloud/revoke`.
- A token can do everything the person can do with their apps, except change their credit: the person pays from the dashboard, and an agent whose client has an x402 wallet can pay a top-up with `add_credit` (USDC on Base), only when the person asks.

More: [Connect your agent](https://estiba.cloud/docs/connect-your-agent).
