> For the complete documentation index, see [llms.txt](https://playbook.nativemsg.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://playbook.nativemsg.com/mcp/authentication.md).

# Authentication & Scopes

The MCP server uses **OAuth 2.1**. You sign in with your nativeMsg login from inside your AI tool — no API keys to copy, nothing pasted into config files.

## How it works

1. Your AI client connects to `https://mcp.nativemsg.com/mcp` and is told authorization is required.
2. The client discovers the authorization server from the standard metadata:
   * Protected resource: `https://mcp.nativemsg.com/.well-known/oauth-protected-resource/mcp`
   * Authorization server: `https://auth.nativemsg.com/realms/nativemsg` (OpenID metadata at `/.well-known/openid-configuration`)
3. The client registers itself (dynamic client registration), opens the nativeMsg sign-in page, and you approve access.
4. From then on the client calls tools with a short-lived access token, refreshing automatically.

Clients that implement the MCP authorization spec (Claude, ChatGPT, Cursor, and others) do all of this on their own — you just sign in.

## Scopes

| Scope             | Grants                                                                                       |
| ----------------- | -------------------------------------------------------------------------------------------- |
| `nativemsg.read`  | List/get tools: contacts, channels, experiences, blasts, templates, webhooks, message status |
| `nativemsg.write` | Everything that creates, updates, deletes, sends, or schedules                               |
| `offline_access`  | Refresh tokens, so you don't re-sign-in every session                                        |

Your agent only gets the scopes approved at sign-in. A read-only connection (approve `nativemsg.read` only) is a good fit for analytics and reporting use cases where the agent should never send.

## Access control & revocation

* The connection acts **as you** — it can do what your nativeMsg user can do, within the approved scopes.
* Revoke a client anytime from your nativeMsg account settings (connected clients), or remove the connector in your AI tool. Tokens stop working immediately on revocation.
* Each AI tool is its own OAuth client: revoking ChatGPT's access doesn't affect Claude's.

## For workspace admins

Connections are per-user. To audit what agents have done, nativeMsg logs tool actions under the authenticating user — review them in the platform's activity history. If your organization restricts which AI tools may connect, manage that in each AI tool's own admin settings (e.g., Claude Enterprise connector policies, ChatGPT workspace connector controls).

## Troubleshooting sign-in

* **Sign-in loop / "registration failed":** your AI client couldn't complete dynamic client registration — make sure you're on a current version of the client, then retry. If it persists, contact support with the client name and timestamp.
* **401 after connecting:** the token's scopes don't cover the tool being called — reconnect and approve both read and write scopes.
* More in [Troubleshooting](/mcp/troubleshooting.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://playbook.nativemsg.com/mcp/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
