# Feeds auth.md

How an agent or an MCP client authenticates to Feeds.

Feeds has two protected resources: the REST API at https://usefeeds.com/v1 and the MCP server at https://usefeeds.com/mcp.
Both take `Authorization: Bearer <token>`. There are two kinds of token.

## OAuth 2.1, for AI assistants and MCP clients

1. Read the protected resource metadata: https://usefeeds.com/.well-known/oauth-protected-resource/mcp. A 401 from /mcp also names it in `WWW-Authenticate`.
2. Read the authorization server metadata: https://usefeeds.com/.well-known/oauth-authorization-server.
3. Register a public client at the `registration_endpoint` (RFC 7591) with `redirect_uris`. There is no client secret.
4. Send the person to the `authorization_endpoint` with PKCE S256. They sign in or create an account, and approve the scopes.
5. Exchange the code at the `token_endpoint`. Access tokens (`fm_oat_…`) last 1 hour. Refresh tokens rotate and last 30 days.

Scopes: `read` (trackers, posts, balance), `track` (create and change trackers, one-off queries; spends credits), `webhooks`.
The person can disconnect the client at any time in the console, under API keys.

## API keys, for servers and developer tools

A person creates a key (`fm_live_…`) at https://app.usefeeds.com/keys. A key has every scope. Keep it in a secret store.

## Accounts

An agent cannot create an account by itself. A person signs up at https://app.usefeeds.com/signup, during the OAuth flow or before it, and confirms their email to receive 1,000 free credits.
