Skip to content
Last updated

OAuth MCP Endpoints

WebDesktop

An OAuth MCP Endpoint is the kind of MCP Endpoint 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.

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 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 asThe endpoint's executorThe person who allowed access
Work folders reachedOne shared work folder, chosen at creationThe person's own private work folders, plus the shared work folders added to Studio that they have permission to use
What a chat can changeNothing in the folder. It reads the folder and writes only to a temporary work area discarded with the chatThe person's work folders, within their permissions, as a chat they start in Studio can
What the client is givenThe Connection URL and a tasgwt_ token in a fixed Authorization headerThe Connection URL or the common MCP URL only. The client signs the person in and obtains its own credentials
Who can create oneAnyone the account's creation policy allows, who manages the folderAccount administrators only, whatever the creation policy says
Who manages itThe executor and the folder's managers; account administrators can only disable and enable itAccount administrators
How access endsRevoke a token, disable, or delete the endpointDisable or delete the endpoint. There is no per-person or per-client revocation in Studio — see 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 box is checked for you when no other endpoint in the account holds it.
  6. Select Create endpoint.
New MCP Endpoint wizard with OAuth · connected user selected under Connection method, an endpoint name entered, an empty Comment field, Use the common MCP URL checked with its explanation, and the Create endpoint button

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.

OAuth endpoint created screen with the Connection URL and the Common MCP URL, each with a Copy button, and a note that the common URL connects to the assigned endpoint in the account chosen during authorization

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:

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.
Authorize MCP access consent screen showing the callback host localhost:57647 and the client name Claude Code, the note that the application name is provided by its developer, the requested MCP resource URL, the requested permissions to view work folders, list Actions, read execution results, run Actions, and start or continue chats (mcp), the account acme-inc with its endpoint name New MCP, and the Deny and Allow access buttons

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 has not been granted mcp.

The MCP Permission

OAuth uses a single scope, mcp, for all six tools. It permits viewing work folders, listing Actions, reading execution results, running Actions, and starting or continuing chats. There is no separate read-only OAuth scope.

Allowing access authorizes the client to use these tools on an ongoing basis, within the connected person's permissions. OAuth does not ask for consent before each execution. Existing connections granted mcp can also run Actions and chats without renewed consent.

If a token does not include mcp, requests are refused with 403 and insufficient_scope. Authorize the client again and grant mcp.

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.
Chat list row of a chat started through an OAuth endpoint, with the folder name above the title and the two speech bubble icon, and the tooltip Created through MCP

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 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.

Detail page of an OAuth MCP endpoint: the Active status and Enabled switch, the Connection URL and Common MCP URL with Copy buttons, the Overview with Connection method OAuth · connected user, Folder Accessible work folders, Executor The connected user, and Comment, the access description, the available tools, and Delete endpoint in the danger zone

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.

Edit MCP endpoint dialog with the Name field, the Use the common MCP URL checkbox and its explanation, a warning that changing the setting revokes this account's credentials for the common URL, the confirmation checkbox, the optional Comment field, and Cancel and Save buttons

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 endpointEvery connection to it is refused until it is enabled again. Nothing is revoked
Turn the common MCP URL on or off for the endpointEvery 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 endpointEvery connection to it is revoked. Permanent
Remove the person from the accountTheir 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 wizardYou are not an account administrator. Ask one to create the endpoint
Use the common MCP URL cannot be checkedAnother 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 providerThe 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_scopeThe client's token does not include mcp, the scope required for all MCP tools. Authorize the client again and grant mcp
The client is refused with 403 and mcp_disabledThe endpoint is disabled
The client is refused with 401, or asks the person to sign in againThe 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