# auth.md — xTiles Agent Authentication

xTiles exposes an MCP server at https://mcp.xtiles.app/mcp and a REST API at https://api.xtiles.app/v1.

## OAuth 2.1 (MCP)
- Protected Resource Metadata: https://mcp.xtiles.app/.well-known/oauth-protected-resource/mcp
- Authorization Server Metadata: https://mcp.xtiles.app/.well-known/oauth-authorization-server
- Dynamic Client Registration: supported (see `registration_endpoint` in the AS metadata)
- Flow: authorization_code + PKCE (S256), refresh_token
- Scope: an authorization request without `scope` is treated as `openid profile email`, limited to the scopes the client registered

## REST API (PAT)
- The REST API at https://api.xtiles.app/v1 authenticates with Personal Access Tokens (`xt_...`)
  passed as `Authorization: Bearer <token>`.
- Docs: https://api.xtiles.app/docs
