# OAuth MCP Endpoints

An OAuth MCP Endpoint is the kind of [MCP Endpoint](/products/ai-studio/agent-channels/mcp-endpoints) where each person connects as themselves. Instead of sharing one token and one executor, every user signs in to Treasure AI Studio from their MCP client and allows it access. From then on, the client runs Actions and chats in the work folders that person can already use, with their own credentials, permissions, and credits. Nobody shares a secret, and nobody's permissions are lent to anyone else.

This page covers creating an OAuth endpoint, the common MCP URL, what a person sees when they connect, and how access ends. The tools and their results are the same for both connection methods and are covered in [Connecting an MCP Client](/products/ai-studio/agent-channels/mcp-clients).

Create one when many people in the account want to use Studio from an MCP client they already work in, and each of them should reach only what they can reach in Studio. Use a [static-token endpoint](/products/ai-studio/agent-channels/mcp-endpoints) instead when the caller is a single agent or service that should work in one shared work folder as one designated executor.

## How It Differs from a Static-Token Endpoint

| Aspect  | Static Token  | OAuth  |
|  --- | --- | --- |
| **Runs as** | The endpoint's executor | The person who allowed access |
| **Work folders reached** | One shared work folder, chosen at creation | The person's own private work folders, plus the shared work folders added to Studio that they have permission to use |
| **What a chat can change** | Nothing in the folder. It reads the folder and writes only to a temporary work area discarded with the chat | The person's work folders, within their permissions, as a chat they start in Studio can |
| **What the client is given** | The Connection URL and a `tasgwt_` token in a fixed `Authorization` header | The Connection URL or the common MCP URL only. The client signs the person in and obtains its own credentials |
| **Who can create one** | Anyone the account's creation policy allows, who manages the folder | Account administrators only, whatever the creation policy says |
| **Who manages it** | The executor and the folder's managers; account administrators can only disable and enable it | Account administrators |
| **How access ends** | Revoke a token, disable, or delete the endpoint | Disable or delete the endpoint. There is no per-person or per-client revocation in Studio — see [End Access](#end-access) |


Both methods share the same six tools, the same tool results, and the same refusal of browser requests. OAuth adds a sign-in challenge on `401` and an `insufficient_scope` refusal on `403`.

## Prerequisites

- You are an **account administrator**. For anyone else, the **OAuth · connected user** option in the wizard is disabled with the note *"Only account administrators can create OAuth endpoints."*
- Treasure AI Studio on **Web or Desktop**, where Agent Channels are created and managed. They cannot be set up from the Mobile app.
- The people who will connect use an MCP client that supports OAuth sign-in for remote MCP servers: it registers itself with the server (dynamic client registration), uses PKCE with S256, names the MCP URL as the resource it wants access to, opens a browser for sign-in, and receives the result through a browser callback. Clients cannot be registered in advance, and clients that ask the person to copy an authorization code back by hand are not supported.


No shared work folder or executor is chosen, so you do not need manage access to any folder to create one.

## Create an OAuth Endpoint

1. Open **Settings → Agent Channels** and select **New MCP Endpoint** in the **MCP Endpoints** section.
2. Under **Connection method**, choose **OAuth · connected user**. The wizard keeps the name and comment if you switch back and forth.
3. Enter an **Endpoint name** — for example, *"Studio for MCP clients"*. Up to 255 characters.
4. Optionally add a **Comment** for your colleagues, up to 1,000 characters.
5. Decide whether this endpoint gets the account's **common MCP URL** with **Use the common MCP URL** (see [The Common MCP URL](#the-common-mcp-url)). The box is checked for you when no other endpoint in the account holds it.
6. Select **Create endpoint**.


There is no folder to choose, no executor seat, and no token to store. The completion screen, **OAuth endpoint created**, shows the URL to give the client — the **Connection URL**, and the **Common MCP URL** as well when this endpoint holds it. Both are shown again on the endpoint's detail page.

## The Common MCP URL

Every OAuth endpoint has its own **Connection URL**, `https://<your account's Agent Gateway>/v1/mcp/<endpoint ID>`, like a static-token endpoint. One OAuth endpoint per account can also hold the **common MCP URL**, which is the same short URL for every account on the site:

```text
https://<Agent Gateway>/v1/mcp
```

The common URL names neither an account nor an endpoint; which one it reaches is decided by who signs in. When a person signs in through it, the candidates are the accounts they belong to in Studio that they can use with their current sign-in and that have an endpoint holding the common URL. If there is more than one, the consent screen asks which to use; if there is one, it is selected for you. The connection goes to the endpoint that holds the common URL in that account. Through an endpoint's own Connection URL, the only candidate is that endpoint's account. The endpoint's own Connection URL keeps working alongside the common URL.

- **One holder per account.** If another endpoint holds it, the wizard and the **Edit** dialog say *"The common URL is assigned to"* that endpoint and link to it with **Manage assigned endpoint**. Release it there first.
- **A disabled endpoint keeps it.** Disabling the holder stops connections through the common URL, but does not free the URL for another endpoint.
- **Changing it ends existing connections through it.** Turning the setting on or off for an endpoint revokes every credential that the account's users obtained through the common URL, and those clients have to authorize again. The **Edit** dialog asks you to confirm that before saving. Credentials obtained through an endpoint's own Connection URL are not affected.
- **Follow-ups stay with the endpoint that started the chat.** When the common URL moves to another endpoint, chats started through the previous holder can no longer be continued through the common URL. They can still be continued through that endpoint's own Connection URL, after authorizing the client for that URL, while the endpoint is enabled.


### How Many OAuth Endpoints to Create

Every OAuth endpoint offers the same tools, and each connection runs with the connected person's own permissions, so a second endpoint does not give anyone different access. Nor does it limit who can connect: any member of the account can authorize a client against any of its OAuth endpoints. For most accounts, one OAuth endpoint that holds the common MCP URL is enough. Create more only when you want to disable or delete connections separately, for example to stop one rollout without stopping the others.

## What a Person Sees When They Connect

The person adds the URL to their MCP client as a remote server. No header or token is entered. The first time the client connects, it opens Treasure AI Studio in a browser:

1. **Sign in**, if they are not signed in already. They sign in the same way they always sign in to Studio. The authorization request is kept while they do, so they return to it afterward.
2. **Review the request on Authorize MCP access.** The page shows the host the result will be sent back to, in bold, and the name the client gave itself. The name is supplied by the client's developer and is not verified, so the page asks the person to check the callback host before allowing access. It also shows the requested MCP resource and the requested permissions.
3. **Choose the account.** The candidates are the accounts the person belongs to in Studio that they can use with their current sign-in and that have an OAuth endpoint for the requested URL, each listed with its endpoint's name. When there is only one, it is selected for you. An endpoint's own Connection URL has only one candidate, its account. An endpoint that is disabled cannot be chosen. Accounts that require a different identity provider are not offered: each is named below the list with **Sign in**, to sign in with that provider and come back to the request.
4. **Select Allow access**, or **Deny** to refuse. The browser returns to the client, and the client can start calling tools.


The connection belongs to that person, in that account, and to the URL they signed in through. Someone who belongs to two accounts and wants to use both authorizes twice, and so does someone who switches a client between the common URL and an endpoint's own URL.

The client renews its own credentials as it goes, so people do not have to sign in every time they use it. They authorize again when their access has been ended, or when the client asks for a permission it was not granted.

### The Two Permissions

| Permission  | What It Allows  | Tools  |
|  --- | --- | --- |
| `mcp` | View work folders, list Actions, and read execution results | `list_work_folders`, `list_actions`, `get_chat_result` |
| `mcp:write` | Run Actions and start or continue chats | `run_action`, `start_chat`, `continue_chat` |


A client asks for the permissions it needs, and the consent screen lists them. When a client calls a tool that needs a permission it was not granted, the call is refused with `403` and `insufficient_scope`, and the client can ask the person to allow more.

### Which Work Folders the Connection Reaches

`list_work_folders` returns the person's own work folders in that account: their private work folders, and the shared work folders added to Studio that they have permission to use. A shared work folder they have not added to Studio is not included. Their permissions are checked each time a tool is used, not only when they allowed access, so losing access to a folder in Studio removes it from the connection too.

### The Chats Are the Person's Own Studio Chats

A chat started through an OAuth endpoint is an ordinary chat of the connected person, in the work folder the tool names. It is not the restricted, disposable chat that an SDK App or a static-token endpoint creates:

- **It can change files.** The agent writes to the person's private work folders, and to shared work folders as far as the person's work mode allows, exactly as it would in a chat they started in Studio. What it writes stays.
- **It works with everything the person has.** Their other work folders, their saved memory and settings, plugins, connections, and credentials are available as in their own chats.
- **It appears in their chat list** with the name of the folder it ran in, and no **MCP** label, with a conversation icon of two speech bubbles whose tooltip reads *"Created through MCP"*. They can open it and carry on in Studio.


Treat allowing a client access like letting it type into Studio as you. `continue_chat` and `get_chat_result` reach only the person's own chats that were started through the same endpoint. See [What an Agent Channel Chat Can Reach](/products/ai-studio/agent-channels/channel-chats) for how this compares with the other kinds.

## Manage an OAuth Endpoint

Only account administrators can change an OAuth endpoint: edit it, disable and enable it, and delete it. Other members see the same detail page, without **Edit**, the **Enabled** switch, or **Delete endpoint**.

The detail page's **Overview** shows **Connection method** as **OAuth · connected user**, **Folder** as **Accessible work folders**, **Executor** as **The connected user**, and the **Comment**, followed by what a connection is allowed to do and the fixed list of available tools. There is no **Tokens** section and no executor role to take over or step down from.

An OAuth endpoint is either **Active** or **Disabled**. Because there is no executor, it never shows **Stopped — needs an executor**.

### Disable and Enable

The **Enabled** switch stops every connection to the endpoint immediately, without revoking anything. Connected clients are refused with `403` and `mcp_disabled` until the endpoint is enabled again, and then they carry on with the credentials they already have, as long as those have not expired or been revoked. While the endpoint is disabled, the consent screen does not let anyone choose it.

### Edit

**Edit** changes the name, the comment, and whether the endpoint holds the common MCP URL. Changing the common URL setting asks for confirmation, because the account's connections through the common URL end — see [The Common MCP URL](#the-common-mcp-url).

### Delete an Endpoint

**Delete endpoint** permanently removes the endpoint. Every credential issued for its URLs stops working in the same action, including those issued through the common URL when this endpoint holds it. Chats the endpoint created stay in each person's chat list. Deletion cannot be undone.

## End Access

| Action  | Effect  |
|  --- | --- |
| **Disable the endpoint** | Every connection to it is refused until it is enabled again. Nothing is revoked |
| **Turn the common MCP URL on or off for the endpoint** | Every connection the account's users made through the common URL is revoked, and those clients must authorize again. Connections through the endpoint's own URL are unaffected |
| **Delete the endpoint** | Every connection to it is revoked. Permanent |
| **Remove the person from the account** | Their connections in that account stop working |


Every request is checked against the endpoint and the person's credentials, so each of these applies to the next tool call.

There is no way to end one person's connection on its own
Treasure AI Studio does not list the clients people have connected, and neither a person nor an administrator can revoke one connection from the app. To cut off one person, remove them from the account or take away their access to the folders concerned. To cut off everyone at once, disable or delete the endpoint. A person who wants to disconnect their own client removes the server from that client. That stops the client from using its credentials, but does not revoke them in Studio.

## Troubleshooting

| Symptom  | Cause and Fix  |
|  --- | --- |
| **OAuth · connected user** cannot be selected in the wizard | You are not an account administrator. Ask one to create the endpoint |
| **Use the common MCP URL** cannot be checked | Another endpoint in the account holds the common URL. Open it with **Manage assigned endpoint** and release it first. The box is also unavailable while the assignment is being checked; if the check fails, select **Retry** |
| The consent screen says *"No accessible account has an OAuth endpoint for the requested MCP resource"* | None of the person's accounts can be offered for that URL — the common URL is not assigned in their account, they are not a member of the endpoint's account, the endpoint was deleted, or the account that has it requires a different identity provider (sign in with it). Ask an account administrator |
| The consent screen says the endpoint *"is stopped or unavailable"* | The endpoint is disabled. An account administrator enables it |
| The consent screen asks to sign in with a different identity provider | The account requires another identity provider. Select **Sign in** and sign in with it |
| The consent screen says the client *"requests a manual authorization code return"* | The client cannot receive the result through a browser callback, which Studio requires. Use a different client |
| The client is refused with `403` and `insufficient_scope` | The client was not granted the permission that tool needs. Authorize the client again and allow it |
| The client is refused with `403` and `mcp_disabled` | The endpoint is disabled |
| The client is refused with `401`, or asks the person to sign in again | The connection was revoked. If the common URL setting changed, authorize again. If the endpoint was deleted or the person left the account, access through that endpoint cannot be restored |


## Next Steps

- [Connecting an MCP Client](/products/ai-studio/agent-channels/mcp-clients) — configure the client, and the tools and results it works with.
- [Static-Token MCP Endpoints](/products/ai-studio/agent-channels/mcp-endpoints) — the static-token method, for one shared work folder and one executor.
- [What an Agent Channel Chat Can Reach](/products/ai-studio/agent-channels/channel-chats) — what the chats can and cannot do.
- [Actions](/products/ai-studio/skills/actions) — create the Actions the client runs.