> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OAuth setup

> Authorize a client to execute tools or read tasks on a user's behalf.

Use authorization code with PKCE when each user should connect their own Mouter account. Discover the authorization server from Mouter's protected-resource metadata:

| Interface | Discovery |
| - | - |
| REST | [REST protected-resource metadata](https://mouter.ai/.well-known/oauth-protected-resource/v1) |
| MCP | Use the `resource_metadata` URL advertised in the `WWW-Authenticate` challenge, or [the MCP resource metadata](https://mouter.ai/.well-known/oauth-protected-resource/mcp). |

Use the resource and issuer advertised by the server and keep the resource consistent across authorization, token exchange, and refresh. Verify the issuer in the authorization callback. Request only the scopes your application needs. See [Authentication](/docs/authentication.md) for the scope list.

If you request a token for a single-tool MCP resource, use it on that tool's MCP endpoint. Keep task reads under the authorization that submitted the task.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.