# AuthWAPI > AuthWAPI is a self-hosted auth server that runs as one Docker container with all its data in one folder. It gives apps email + password sign-up with verification, magic links, Google/GitHub sign-in, TOTP 2FA, passkeys, organizations, OIDC & SAML SSO, hosted sign-in pages, an OAuth 2.1 / OpenID Connect provider, and MCP authorization. It is built on Better Auth, Hono and SQLite. Facts an agent needs before acting: - Status: early pre-1.0 (M1–M6 built: core auth, social sign-in, 2FA/passkeys, orgs, OIDC/SAML SSO, OAuth for MCP servers, admin MCP server, and export/import). Do not put real users on it yet. - Start it (from source; the published image is `ghcr.io/anmolnoor/authwapi:0.3.1`): `git clone https://github.com/Anmolnoor/authwapi.git && cd authwapi && docker build -t authwapi .` then `docker run -d --name authwapi -p 127.0.0.1:4000:4000 -v "$PWD/authwapi-data:/data" authwapi`. Health: `GET http://localhost:4000/health` returns `{"status":"ok"}`. - Every request except `GET /health` needs a Host header equal to BASE_URL's host (default `localhost:4000`) or a name in ALLOWED_HOSTS, else 421 `unknown_host`. An Origin header, if sent, must be BASE_URL's origin (or an ALLOWED_HOSTS name), else 403 `untrusted_origin`. A POST to a Better Auth route that sends any cookie (such as the session cookie) must send that Origin, else 403 `MISSING_OR_NULL_ORIGIN` and nothing happens. - Without Resend configured, emails (verification, reset, magic links) are written as JSON files to `/outbox/`. They contain credentials, as do session cookies, sign-in responses and the client secret the CLI prints: never print or log them. - HTTP API: Better Auth routes under `BASE_URL/api/auth`. Machine-readable reference (OpenAPI 3.1): https://authwapi.vercel.app/openapi.json - Step-by-step runbook (start, sign up, verify from the outbox, sign in, create an OAuth client, then the admin MCP) with no human: https://authwapi.vercel.app/docs/for-ai-agents/ - Admin MCP for agents at `BASE_URL/mcp`: read the one-time bootstrap key from `/bootstrap-admin-key` (ends with a newline; trim it), use it once to mint a write key with `mint_agent_key`, then administer with that key. Never print a key. Runbook: https://authwapi.vercel.app/docs/for-ai-agents/#admin-mcp - Apps sign users in with OAuth 2.1 authorization code + PKCE (S256). Clients are created only with `docker exec -u 1000 authwapi node src/cli.ts clients create ...`; dynamic client registration is off. - Your own MCP servers can use AuthWAPI as their authorization server: `resource add `, then `resource link ` (an MCP client's client_id is its metadata document URL). Guide: https://authwapi.vercel.app/docs/protect-your-mcp-server/ ## Documentation Sets - [Abridged documentation](https://authwapi.vercel.app/llms-small.txt): a compact version of the documentation for AuthWAPI, with non-essential content removed - [Complete documentation](https://authwapi.vercel.app/llms-full.txt): the full documentation for AuthWAPI ## Notes - The complete documentation includes all content from the official documentation - The content is automatically generated from the same source as the official documentation ## Optional - [Source code](https://github.com/Anmolnoor/authwapi): the server, its tests and README.md