# Tessera > Tessera is an OAuth 2.1, OpenID Connect and MCP authorization server for products built by people and agents. Invite-only. To add sign-in to an app, protect an MCP server, or switch to Tessera from your current sign-in, run `tessera init` in the project; it registers the app, writes the environment variables and prints the code for the stack. ## Do this If the user said "use Tessera" (or asked for login, SSO or sign-in), follow these steps. They are safe to repeat. 1. Check the CLI: `tessera version`. If it is missing, stop and tell the user to install it: the install command is `curl -fsSL https://tessera.kurthlabs.ai/install.sh | bash` (it checks the download's signature and installs to ~/.local/bin, no sudo). During early access, the CLI download is by invitation. Ask us for it. Put that folder on the PATH. Do not run anything else until it prints a version. 2. Preview: `tessera init --dry-run -o json`. It detects the stack (Next.js, SvelteKit, Express, Go, Python, MCP server), the dev port and the realm. The preview needs a sign-in (a device login), so if you only have a pairing code, skip it and go to step 3. 3. Ask the user for a pairing code (they run `tessera pairing create`; it looks like ABCD-1234, works once and lasts 10 minutes). Run: `tessera init --pair -o json`. The code lets you register this one app and nothing else; you never hold the owner's credentials. If the CLI says the code is invalid, expired or used, ask for a new one. Do not guess codes. No code available: `tessera init -o json` starts a device login; tell the user to open the printed URL and enter the code. 4. Read the `quickstart` field of the result and add that code to the app. It already has the real issuer, client id and redirect URL. 5. Verify: `tessera doctor -o json` fetches discovery and the keys, compares the registered redirect and logout URIs with the app's (`--fix` adds missing ones) and validates a token when the realm has a test persona. Each failing check carries a `code` and a `remedy`. 6. Start the dev server and confirm the login route redirects to the issuer. Optional: `tessera skill install` writes a Claude Code skill (.claude/skills/tessera/SKILL.md) that does all of this. ## Rules for agents - Never print, echo, log or commit a client secret or token. `tessera init` writes secrets to the env file (.env.local, or .env for Python) and nowhere else. Do not read that file, and do not pass --print-secret. - Never ask the user to paste a secret or token into the chat. - Re-running `tessera init` is safe: it changes nothing that is already right and keeps existing redirect URIs. Add a deployed URL with `tessera init --url https://app.example`. - If the client exists but its secret is not in the env file (exit code 5), ask the user before using --rotate-secret: it invalidates the old secret. - For an MCP server, `tessera doctor --mcp ` checks the 401 challenge, the protected-resource metadata and audience binding. - Customer apps may use any OIDC library. The quickstarts use Auth.js, openid-client, go-oidc and Authlib. ## Documentation Every page is also a web page at the same path without `.md`. All pages in one file: [llms-full.txt](https://tessera.kurthlabs.ai/llms-full.txt). Error codes: [errors.json](https://docs.kurthlabs.com/tessera/errors/errors.json). ### Start here - [Your first sign-in](https://docs.kurthlabs.com/tessera/docs/start/first-sign-in.md): This page takes you from a Tessera invite to a working sign-in in your own app. - [Tell your agent](https://docs.kurthlabs.com/tessera/docs/start/tell-your-agent.md): You can ask your coding agent to add Tessera sign-in to your app with one sentence. - [What is Tessera](https://docs.kurthlabs.com/tessera/docs/start/what-is-tessera.md): Tessera is a sign-in service for the apps and agents you build, using standard OpenID Connect and OAuth 2.1. ### Concepts - [Workspaces](https://docs.kurthlabs.com/tessera/docs/concepts/workspaces.md): A workspace is your team's account with Tessera, and it owns the realms you create. - [Realms](https://docs.kurthlabs.com/tessera/docs/concepts/realms.md): A realm is one set of users, apps, keys and sign-in pages. - [Apps](https://docs.kurthlabs.com/tessera/docs/concepts/apps.md): An app is an OAuth client in a realm: the web app, API, agent or MCP server that asks Tessera to sign people in. - [Roles and permissions](https://docs.kurthlabs.com/tessera/docs/concepts/roles-and-permissions.md): Tessera puts a person's roles and permissions into their tokens, so your app can decide what they may do without calling back. - [Sign-in methods](https://docs.kurthlabs.com/tessera/docs/concepts/sign-in-methods.md): A realm decides how its people prove who they are, and Tessera enforces the choice on the server. - [Themes](https://docs.kurthlabs.com/tessera/docs/concepts/themes.md): A theme is the look of a realm's sign-in pages, emails and account pages. - [Domains](https://docs.kurthlabs.com/tessera/docs/concepts/domains.md): A realm can sign people in on your own address, such as login.example.com, instead of the shared Tessera address. ### Connect an app - [Connect your app](https://docs.kurthlabs.com/tessera/docs/connect/overview.md): Tessera speaks standard OpenID Connect and OAuth 2.1, so any certified OIDC library signs people in to your app with no Tessera SDK. - [The sign-in flow](https://docs.kurthlabs.com/tessera/docs/connect/sign-in-flow.md): Tessera uses the OAuth authorization code flow with PKCE (S256); this page shows each request and response, so you can check what your OIDC library sends. - [Client types](https://docs.kurthlabs.com/tessera/docs/connect/client-types.md): A client is the registration of your app in a realm; its type decides how it proves who it is and which settings you can change. - [Logout](https://docs.kurthlabs.com/tessera/docs/connect/logout.md): Signing out has two parts: ending your app's own session, and ending the person's Tessera session so their other apps sign out too. - [Webhooks](https://docs.kurthlabs.com/tessera/docs/connect/webhooks.md): A webhook subscription makes Tessera POST a signed JSON message to your server whenever a matching event happens in a realm, such as a user being created or disabled. - [Helper libraries](https://docs.kurthlabs.com/tessera/docs/connect/helpers.md): Sign-in itself is plain OpenID Connect, so use any certified library for it (the quickstarts use Auth.js, openid-client, go-oidc and Authlib). You need more only when your code has to check Tessera tokens or events for itself. ### Agents - [Agents overview](https://docs.kurthlabs.com/tessera/docs/agents/overview.md): Tessera gives software that acts without a person at the keyboard its own identity, so every token says who is acting and for whom, and you can narrow, limit and stop it. - [Agent identities](https://docs.kurthlabs.com/tessera/docs/agents/identities.md): How to create a service account, a delegated agent, or a whole fleet of agents, and what each one gets. - [Acting for a person](https://docs.kurthlabs.com/tessera/docs/agents/acting-for-a-person.md): How an agent gets a token that says "this person, acted for by this agent", and how agents pass a smaller token to other agents. - [Workload identity](https://docs.kurthlabs.com/tessera/docs/agents/workload-identity.md): How a CI job, a pod or a cloud service gets a short-lived Tessera token with no client secret, by proving where it runs. - [Get and refresh tokens in code](https://docs.kurthlabs.com/tessera/docs/agents/token-source.md): How an agent or backend job gets an access token, keeps it, and renews it, with plain HTTP and the standard library of your language. - [Protect an MCP server](https://docs.kurthlabs.com/tessera/docs/agents/protect-an-mcp-server.md): How to make an MCP server accept Tessera access tokens, how MCP clients find Tessera and register themselves, and how tokens stay bound to your server. - [Revocation and the kill switch](https://docs.kurthlabs.com/tessera/docs/agents/revocation-and-kill-switch.md): How to stop one agent, one app or every agent in a realm right now, and how your own servers find out within seconds. - [Quotas and usage](https://docs.kurthlabs.com/tessera/docs/agents/quotas-and-usage.md): How Tessera limits how fast an agent or client can ask for tokens, how to set those limits, and how to see what each agent was issued. ### Make it yours - [Make it match your brand](https://docs.kurthlabs.com/tessera/docs/customize/themes.md): This page shows how to change the look of your sign-in pages and emails. - [Login domains](https://docs.kurthlabs.com/tessera/docs/customize/login-domains.md): A login domain lets people sign in on your own address, such as login.example.com, with your DNS provider of choice. - [Invites](https://docs.kurthlabs.com/tessera/docs/customize/invites.md): An invite is a one-time link that lets a person join a workspace or a realm, optionally with roles already attached. - [Sign-up agreements](https://docs.kurthlabs.com/tessera/docs/customize/agreements.md): Sign-up agreements let a realm ask people to accept your terms and privacy policy, and keep a record of who accepted which version. ### Reference - [Endpoints](https://docs.kurthlabs.com/tessera/docs/reference/endpoints.md): Every protocol endpoint a Tessera realm serves, with its method, how it is authenticated and the parameters that matter. - [Token claims](https://docs.kurthlabs.com/tessera/docs/reference/claims.md): The claims in Tessera's ID tokens, access tokens and userinfo answer, and what each one means. - [Error codes](https://docs.kurthlabs.com/tessera/docs/reference/error-codes.md): Every failure Tessera reports has a stable code, an HTTP status, a cause and a fix, and the full list is published at /errors. - [Webhook events](https://docs.kurthlabs.com/tessera/docs/reference/webhook-events.md): The event types a webhook subscription can receive, when each one fires, and what its payload holds. - [The tessera CLI](https://docs.kurthlabs.com/tessera/docs/reference/cli.md): The tessera command-line tool registers apps, manages access and invites, and runs your realm from a terminal or a script. ### For agents - [Reading these docs](https://docs.kurthlabs.com/tessera/docs/for-agents/reading-these-docs.md): Every page of these docs is available as plain text, so a coding agent or a script can read it without scraping. - [Setup steps](https://docs.kurthlabs.com/tessera/docs/for-agents/setup-steps.md): These are the steps for adding Tessera sign-in to a project, written so that a person or a coding agent can follow them the same way. ### Quickstarts - [Next.js with Auth.js](https://docs.kurthlabs.com/tessera/docs/quickstart/nextjs.md): Sign users in to a Next.js app with Tessera. About five minutes, three small files. - [SvelteKit with Auth.js](https://docs.kurthlabs.com/tessera/docs/quickstart/sveltekit.md): Sign users in to a SvelteKit app with Tessera. Two small files. - [Express with openid-client](https://docs.kurthlabs.com/tessera/docs/quickstart/express.md): Sign users in to an Express app with Tessera, using the standard openid-client library and PKCE. - [Go with go-oidc](https://docs.kurthlabs.com/tessera/docs/quickstart/go.md): Sign users in to a Go web app with Tessera, using coreos/go-oidc and golang.org/x/oauth2 with PKCE. - [Python with Authlib](https://docs.kurthlabs.com/tessera/docs/quickstart/python.md): Sign users in to a Flask app with Tessera, using Authlib and PKCE. - [Protect your MCP server](https://docs.kurthlabs.com/tessera/docs/quickstart/mcp-server.md): Make your MCP server an OAuth 2.1 resource server that accepts Tessera access tokens. MCP clients (coding agents, Claude, Cursor) find Tessera from your server's metadata, sign the user in, and call your tools with a token bound to your server. - [Switch to Tessera from your current sign-in](https://docs.kurthlabs.com/tessera/docs/quickstart/switch-sign-in.md): Keep your app, your pages, your sessions and your users, and point sign-in at Tessera. Auth.js is shown (Next.js; SvelteKit uses the same provider object), and the pattern is the same for any OpenID Connect library: register the app, replace the provider's settings, carry your existing users across, then remove the old provider. ## Reference - [Documentation index](https://docs.kurthlabs.com/tessera/): every page as a web page; quickstarts at https://docs.kurthlabs.com/tessera/docs/quickstart. - [Privacy](https://tessera.kurthlabs.ai/privacy): the cookies Tessera sets (no analytics, advertising or marketing), the bot check, invite requests and accounts. - [Security notes](https://tessera.kurthlabs.ai/security): key rotation, realm isolation, token audience, logging, how to report a vulnerability (security@kurthlabs.com). - Issuer pattern: https://login.kurthlabs.com/realms/; discovery at /.well-known/openid-configuration, keys at /jwks. - Tessera is standard OpenID Connect: no Tessera library is required, any certified OIDC library works. - Access tokens are JWTs with header typ "at+jwt", signed EdDSA, audience-bound to the resource they were issued for (RFC 8707). - MCP: Tessera is an authorization server for MCP (RFC 9728 protected resource metadata, dynamic client registration, client ID metadata documents, resource indicators, DPoP).