How do I connect Claude Code or Cursor with an access token?
Generate an access token on the Connect AI Assistants page and add it with the TrueROAS address to Claude Code, Cursor or another MCP tool.
When you need a token
An access token is a long secret code that lets an AI tool read your TrueROAS data without signing in. The Connect AI Assistants page uses one for developer tools such as Claude Code and Cursor. You can also use one for any other AI tool that supports MCP, a standard way for AI tools to talk to other apps.
Claude on the web or desktop and ChatGPT connect with your TrueROAS login and need no token. See How do I connect Claude or ChatGPT to TrueROAS?.
Anyone who has your token can read your store data, so keep it as safe as a password.
Generate a token
- Open Setup in the left menu and click Integrations.
- Under AI MCP, click the button on the Claude, ChatGPT & more card. The Connect AI Assistants page opens.
- Under 1. Your access token, click Generate new token.
- The new token appears in the field. It starts with
troas_pat_. A yellow box tells you to copy it now, because TrueROAS cannot show it again. - Click Copy. You see Copied token.
If your login already has an active token, including one from a Claude or ChatGPT connection, the field reads You have an active token (hidden for security). TrueROAS never shows an old token again, so if you lost it, generate a new one.
If generating fails, you see Couldn't generate token. and a red box with the reason.
A token from Generate new token gets all four permissions listed in the next section: it can read your numbers, read and add to what TrueROAS has saved about your business, and read your past chats with Trew Media Buyer.
Make a token with only the permissions you choose
- Go to app.trueroas.com/settings/integrations in your browser while you are logged in. The page is called Trew MCP integrations. It has no item in the menu, so type the address.
- Under Active tokens, click New token.
- In the window New personal access token, fill in Label with a name you will recognise later, such as the tool and the computer you use it on. The field suggests e.g. Claude Desktop @ home.
- Under Scopes, turn on what the token may do, as described in the table below.
- Click Create token. It stays greyed out until you have a label and at least one switch on, and it reads Creating… while it works.
- The window changes to Your new token with the warning Save this token now. It cannot be shown again. Click the copy icon next to the token (tooltip Copy token). Copied to clipboard shows at the bottom of the screen.
- Click Done.
Read metrics includes attribution data. Attribution is how TrueROAS decides which ad gets the credit for a sale.
| Switch | What it allows | On when the window opens |
|---|---|---|
| Read metrics | Pull ad performance and attribution data. | Yes |
| Read memory | Read the knowledge base (business profile, facts, summary). | Yes |
| Write memory | Add learned facts and update the business profile. | Yes |
| Read past conversations | Read past in-app chat threads + messages. Opt-in. | No |
When your AI tool asks for something its token is not allowed to do, TrueROAS refuses that request and tells the tool which permissions the request needs. A label longer than 80 characters is cut off when it is saved.
Add the token to your AI tool
Give your AI tool these two things:
- The server address
https://app.trueroas.com/api/trew-mcp. - The header
Authorizationwith the valueBearer, a space and your token, for exampleAuthorization: Bearer troas_pat_....
Where you enter them depends on your tool. Look in its settings for MCP servers. The Connect AI Assistants page has step-by-step instructions for Claude and ChatGPT only, not for Claude Code or Cursor.
The MCP endpoint box at the top of Trew MCP integrations shows the same address with a copy button (tooltip Copy). Under it is the line Configure your MCP client with this URL and the token below.
Test the token
- Right after you generate a token on Connect AI Assistants, scroll down to 3. Test the connection and click Test connection. It calls the same address your AI tool uses.
- When it works, you see Connected. and the number of tools your AI tool can use.
- Click Try a real call to see the stores your token can read. The store you have selected in TrueROAS is marked (default). If your login has no stores, you see No stores found.
If the test fails, a red box explains why. When your token was rejected, generate a new one and try again. When TrueROAS reports a server error, wait a moment and try again.
Good to know
- Test connection only works while the token you just generated is on screen. After you leave or reload the page, and for tokens made on Trew MCP integrations, it stays greyed out. Test those by asking your AI tool a question.
- A test counts as a use of the token, so the Claude, ChatGPT & more card on Integrations can show Connected before your AI tool has sent its first request. What the card shows is explained in How do I connect Claude or ChatGPT to TrueROAS?.
- Every click on Generate new token or Create token adds a new token. Older tokens keep working until you revoke them. See How do I disconnect an AI tool or revoke an access token?.
- A token has no end date. It works until you revoke it.
- Tokens belong to your login and read the stores on your login. Everyone on the store makes their own.
- A token cannot change your ads until you turn on Let AI assistants change my ads. See Can Claude or ChatGPT change my ads?.
- The key from the TrueROAS API card is a different key and does not work as an access token. See How do I get an API key and pull my TrueROAS data?.