DocsDevelopers
MCP server for AI assistants
Connect Claude, ChatGPT, Cursor and other AI assistants to Thrice over MCP, choose read-only or full access, and see every tool and its limits.
The Model Context Protocol (MCP) is an open standard that lets AI assistants use the tools of other apps. Thrice runs an MCP server, so you can manage your loyalty program from Claude, ChatGPT, Cursor and other MCP clients by asking in plain language. The assistant can work with almost everything in Thrice: ways to earn, rewards, VIP tiers, challenges, settings, store design and the page builder, texts and languages, emails, customers and points, segments, analytics, import and export, the team, Klaviyo, webhooks and API keys.
Each connection belongs to one store and acts with the access you give it.
Connect
The server address is the same for every store:
https://app.thriceloyalty.com/mcp
Developers shows it under AI connections (MCP) as MCP server URL, with ready-made snippets for Claude Code and Cursor.
There are two ways to connect:
- Sign in. The client opens Thrice in your browser. You sign in to the Thrice panel with your own account (see Team and sign-in), choose the store and the access, and choose Allow access. Use this wherever the client supports it.
- Access token. For tools that can't sign in through the browser. You create a token on the Developers page and the client sends it in the
Authorizationheader. See Access tokens below.
The sign-in page names the address of the app that asks for access and where your browser goes back to. Check both before you allow it. It lists every store you belong to, except stores where Thrice is no longer installed and stores that require two-step verification while you haven't passed it in this session. A signed-in connection stays connected as long as the client uses it at least once every 60 days.
Claude (claude.ai and Claude Desktop)
- In Claude, add a custom connector and paste the server address.
- Connect it. Claude opens the Thrice sign-in page.
- Sign in, choose the store and the access, and choose Allow access.
Which Claude plans can add custom connectors is up to Anthropic.
ChatGPT
In ChatGPT, add a custom connector with the server address, then sign in to Thrice when ChatGPT asks and choose Allow access. Which ChatGPT plans can add custom connectors is up to OpenAI.
Claude Code
Add the server, then run /mcp in Claude Code and sign in to thrice from there:
claude mcp add --transport http thrice https://app.thriceloyalty.com/mcp
The sign-in page warns that the app sends you back to this computer (localhost). That is expected for Claude Code.
With an access token instead:
claude mcp add --transport http thrice https://app.thriceloyalty.com/mcp \
--header "Authorization: Bearer thr_mcp_..."
Cursor
Add this to mcp.json and set the THRICE_MCP_TOKEN environment variable to an access token, so the token stays out of the file:
{
"mcpServers": {
"thrice": {
"url": "https://app.thriceloyalty.com/mcp",
"headers": { "Authorization": "Bearer ${env:THRICE_MCP_TOKEN}" }
}
}
}
Other clients
Any client that supports remote MCP servers over HTTP can connect, either by signing in with OAuth or by sending an access token as Authorization: Bearer thr_mcp_.... For client developers: OAuth uses PKCE (S256) with dynamic client registration or client metadata documents, and the scopes are mcp:read and mcp:write. A request without a valid credential gets 401 with a WWW-Authenticate header that points to the server's OAuth metadata.
Access levels
Every connection has one of two levels:
- Read-only. Sees your program, settings, customers and reports. Changes nothing. Tools that change something aren't offered to it at all.
- Full access. Can also make changes, as you can in the panel.
A connection never gets more than the role of the person behind it:
- Viewers can only give read-only access. On the sign-in page Full access is turned off for a store where you are a viewer, and also when the app itself asked for read-only access.
- Roles are checked on every request. Make someone a viewer and their full-access connections become read-only at once. Remove someone from the team and every token and connection they made for the store is revoked.
- Some tools also depend on your role:
export_dataandlist_access_logare for admins and owners, and work on a read-only connection too. The team tools that change something are for owners only.
Access tokens
- Open Developers and go to AI connections (MCP).
- Under Create an access token, enter a Token name (up to 60 characters, for example "Cursor on my laptop").
- Choose Access: Read-only (the default) or Full access.
- Choose when it Expires: In 30 days, In 90 days (the default), In 1 year or Never.
- Choose Create token and copy the token from the banner. It starts with
thr_mcp_and is shown only once.
A store can have up to 25 active access tokens. Expired and revoked tokens don't count. An expired token stays in the list, marked Expired, until you revoke it.
A token acts as the person who created it, with their role at the time of each request. A token created inside the Shopify admin has no person behind it: it acts as an admin, and the list shows Shopify admin under Created by. For owner-only tools, an owner must create the token while signed in to the panel at app.thriceloyalty.com, or connect by signing in. Viewers can't create tokens; they can connect by signing in, read-only.
Tokens stop working if Thrice is uninstalled from the store.
Warning: An access token, or any connection with full access, works like a password to your store's loyalty data. Keep tokens out of shared files and chats, give each tool its own token, and revoke the ones you no longer use.
What the assistant can do
The server has 128 tools. A connection sees only the ones it may use. Tools whose names start with get_, list_, find_ or preview_, and whoami and export_data, only read. Every other tool changes something and needs full access.
Long lists (ways to earn, rewards, challenges, customers, imports, webhook deliveries, API keys and the access log) return 25 items a page by default and up to 100, with a cursor for the next page. Other lists return every item at once. update_ tools change only the fields the assistant sends.
Connection
whoami: the store, whether the program is live or paused, the connection's role and access, and the areas it can use. Assistants are told to call it first.
Ways to earn and referrals
list_rules,get_rule: ways to earn in display order, with how often each was earned.create_rule: adds a way to earn, 1 to 1,000,000 points, switched on unless told otherwise.update_rule: changes a way to earn. The kind can't change.set_rule_active: switches one on or off. A follow or visit rule needs its link first.move_rule: moves one a step up or down in the order shoppers see.delete_rule: deletes one. Points already earned with it stay.get_referral_program,set_referral_program: reads or changes the referral program: the referrer's points and the friend's discount. Creates the referral rule if there is none.
Rewards
list_rewards,get_reward: rewards in display order, with their tier and redemption count.create_reward: adds an amount off, percentage off, free shipping, free product or store credit reward, 1 to 1,000,000 points.update_reward: changes a reward. The kind can't change.set_reward_active: switches one on or off.move_reward: moves one a step up or down.delete_reward: deletes one. A reward that was ever redeemed is switched off instead.
VIP tiers
list_tiers,get_tier: tiers by threshold, with multiplier, benefits and member count.create_tier,update_tier,delete_tier: add, change or delete a tier. Adding or deleting one recalculates every member's tier, and so does changing a threshold or multiplier. That can move many members and send tier emails. Rewards limited to a deleted tier become open to everyone.update_tier_settings: whether tiers count points or spend, over 1 to 60 months. Changing either recalculates every member's tier.
Challenges
list_challenges,get_challenge: challenges with status, participants and completions.create_challenge: adds a challenge. Without dates it runs for 30 days from today.update_challenge: changes one, including switching it on or off. Progress already made stays.delete_challenge: deletes one with every member's progress. Bonus points already given stay.
Program settings
get_program_settings,update_program_settings: every option on the Settings page. A change is checked as on the page, and nothing is saved if one value fails.pause_program,resume_program: pause or resume the program. Orders placed while paused never earn.get_program_status: live, paused or not launched, the setup checklist and the program health checks.mark_widget_launched: records that you turned the widget on in your theme, the one step Thrice can't see for itself.list_onboarding_templates,apply_onboarding_template: the Starter, Engagement and VIP templates. Applying one adds all of its rows again each time, so a store that has a program or applied a template before needs an extra confirmation.
Store design
get_design: the design and the themes, fonts and limits it accepts.update_design: changes colors, font, corners, spacing, launcher, header image, sections or custom CSS. Live at once.apply_design_preset: switches to a theme's colors, font, corners and spacing. Custom colors are lost.sync_storefront: sends the saved design, texts and published layout to the storefront again after a failed sync.
Page builder
get_layout,list_layout_versions,get_layout_version: the draft, the live layout and the last 50 published versions. Custom code is shown only on request.update_layout_item,move_layout_item: show, hide, move or set up a block, card or section in the draft.add_custom_block,update_custom_block,remove_custom_block: custom HTML, CSS and JavaScript blocks in the draft, up to 20.set_page_code: the loyalty page's own CSS and JavaScript in the draft.restore_layout_version: copies a published version into the draft.discard_layout_draft: deletes the draft. The live layout doesn't change.publish_layout: puts the draft live with a note of up to 200 characters.rollback_layout: puts an earlier version live again. The draft stays.reset_layout: goes back to the built-in layout at once and deletes the draft. Versions stay.
Languages and text
list_text_groups,get_texts: every storefront text, its default and the store's own text.set_texts: sets texts in one language, one line and up to 400 characters each. Live at once. Changingpoints_namerenames points everywhere, emails included.reset_texts: puts texts in one language back to the defaults.list_languages,add_language,remove_language: the 8 built-in languages and the ones the store added. Only added languages can be removed.
Emails
list_email_templates,get_email_template: the seven loyalty emails, their status in each language and their texts.preview_email: renders an email with sample values, from the saved text or a draft that isn't saved.update_email_template: saves the subject (up to 200 characters) and body (up to 5,000) for one language.reset_email_template: puts one language back to Thrice's text.set_email_template_enabled: turns an email on or off in every language.get_email_sender,update_email_sender: sender name, reply-to address, logo and accent color.get_email_domain,add_email_domain,verify_email_domain,set_email_local_part,remove_email_domain: your own sending domain, at most 3 adds a day. A domain not verified within 7 days is removed.send_test_email: sends a test to the store's own email address, at most 5 an hour per store.
Customers
list_customers: members by points, spend or join date, filtered by tier or segment. Emails are masked and names are never shown.find_customer: one member by exact email address or Shopify customer ID.get_customer: one member in full, with points history, redemptions, referrals, challenges, orders and emails.adjust_points: adds or removes points with a reason of up to 200 characters. The balance can't go below zero.block_customer,unblock_customer: blocks a member with a reason of up to 500 characters, or lets them back in.set_customer_birthday: sets or clears a member's birthday.
Segments
list_segments,get_segment: the four built-in segments and your own, with how many members match now.create_segment,update_segment,delete_segment: your own segments, with up to 20 conditions. Built-in segments can't be changed.
Analytics
get_overview: the Overview page: active program items, health warnings and dashboard cards.get_revenue_report,get_points_report,get_members_report,get_rewards_report,get_retention_report: the Analytics tabs, for 7, 30, 90 or 365 days or your own dates, each with the period before it.set_dashboard_cards: which Overview cards show, and their order, for the whole team.
Import and export
export_data: rows of the members, points history, redemptions or orders export, up to 100 a call, with a link to the full file. Admins and owners only.validate_member_import,start_member_import,undo_member_import: check, run or undo a member points import from a CSV of up to 1 MB.list_import_jobs,get_import_job: imports with their status and skipped rows. The values of skipped rows are shown to admins and owners only, and reading them is recorded in the access log.preview_order_import,start_order_import: award points for paid Shopify orders from the last 7, 30 or 60 days that Thrice hasn't recorded. Customers get no emails.
Team
list_team: team members with their role and two-step verification, and pending invites.invite_team_member,resend_invite,revoke_invite: invite someone as admin or viewer, send an invite again or cancel it.change_team_role: makes a member admin or viewer.remove_team_member: removes an admin or viewer and revokes their tokens and connections.set_require_two_factor: turns the store's two-step verification requirement on or off.
Every team tool except list_team is for owners only, on a connection an owner made while signed in.
Klaviyo and Shopify Flow
get_klaviyo_status: whether Klaviyo is connected, and the last event and member sync.connect_klaviyo,disconnect_klaviyo: save or delete the Klaviyo private API key. To connect, the key has to be pasted into the conversation.send_klaviyo_test_event: sends a test event for one email address.sync_klaviyo: updates the Thrice properties on every member's Klaviyo profile, without starting flows.list_integration_failures: Klaviyo and Flow deliveries that failed for good in the last 30 days.list_flow_triggers: Thrice's Flow triggers and whether a workflow uses them. Workflows are built in Shopify Flow.
Webhooks
list_webhook_endpoints,list_event_types: your endpoints, up to 10, and the events they can receive.create_webhook_endpoint,update_webhook_endpoint: add or change an endpoint. The URL must be a publichttps://address.set_webhook_endpoint_active,delete_webhook_endpoint: pause or delete an endpoint.rotate_webhook_secret: gives an endpoint a new signing secret. The old one stops working at once.send_test_webhook: sends one signedtest.pingevent.list_webhook_deliveries: deliveries with attempts and the last error.
API keys and access log
list_api_keys,revoke_api_key: REST API keys, shown by the start of the key. New keys are made on the Developers page only, so a connection can't leave a credential behind that outlives it.list_access_log: who viewed, exported or changed customer data in the last 12 months. Admins and owners only.
Safety
- Custom code goes to the draft. Custom blocks and page code the assistant writes stay in the page builder's draft, which shoppers don't see. The Custom CSS field of Store design is the exception: it goes live at once, cleaned the same way as on the Store design page. Publishing or rolling back to a layout with custom code needs an explicit acknowledgement in the call, because that code isn't sanitized and runs for every visitor. The assistant is told to show you the change and ask first. Thrice can't check that it did. If a publish goes wrong,
rollback_layoutor Version history in the page builder brings back an earlier version. See Custom code blocks. - Everything is recorded. Every change, and every read that returns customer data, goes to the access log under Settings > Data & privacy, with the connection's name, for example "MCP: Cursor on my laptop". See Privacy and data.
- Customer data is limited. Lists show masked emails and no names. A full email and name appear only when the assistant looks up one customer, and in
export_data, which is for admins and owners. The skipped rows of a member import also show the file's values, emails included, to admins and owners. - Points changes are counted once.
adjust_pointsneeds an idempotency key, so a retried call doesn't add the points twice. - Secrets are shown once. A new webhook signing secret appears once in the reply that creates or rotates it. Keys you paste, such as a Klaviyo key, pass through the conversation too, so only share them in a chat you trust.
- Text from customers is data. Names, notes and imported values are marked so the assistant treats them as data, and it is told never to follow instructions in them.
- Deleting needs care. Most deletes and resets can't be reversed from the assistant. It is told to ask you first. Thrice marks these tools as destructive, so clients can ask for confirmation.
The assistant can't:
- create, extend or revoke MCP connections and access tokens;
- create a REST API key;
- show a webhook signing secret that already exists;
- delete or anonymize a customer's data;
- change your plan or billing;
- make anyone an owner;
- redeem a reward for a customer.
Limits and errors
| Limit | Value |
|---|---|
| Tool calls per connection | 120 a minute |
| Changes per connection | 30 a minute |
| Heavy calls per connection (analytics, exports, imports, test sends, segment lists, domain checks) | 10 a minute |
| HTTP requests per connection | 300 a minute |
| Test emails per store | 5 an hour |
| Request size | 2 MB |
| Reply size | 60,000 characters |
Batch requests are refused: the client must send one message per request. A request sent from a web page on another site is refused with 403. Clients that run on a server or your computer aren't affected.
A reply that would be too long is cut, with a note asking for less. export_data returns up to 100 rows a call and gives a cursor for the next ones, plus a link to download the full file from the panel.
Customer search is exact. Names can't be searched, because they are stored encrypted. Use a full email address or a Shopify customer ID.
Design, texts, languages, program name and language, and publishing, rolling back or resetting the layout go live on the storefront at once. If the storefront can't be updated, the change is still saved and the reply says the sync failed. sync_storefront tries again, and so does the next change.
Errors are plain text in English that the assistant reads. The common ones:
- Sign-in needed (
401). The token is missing, unknown, revoked or expired, the person who connected left the team, or Thrice was uninstalled. It also happens when the store requires two-step verification and the person who connected hasn't set it up: their tokens and connections stop until they do, then work again. Tokens made inside the Shopify admin aren't affected. A signed-in client starts sign-in again. - Read-only. A tool that changes something answers "is not available: this connection is read-only. Reconnect with full access to make changes." For a viewer it says Viewers can't make changes and an owner can change the role in Team.
- Role. "needs the Owner role in this store" (or the Admin role). For a token made in the Shopify admin, an owner has to connect while signed in to the panel.
- Shopify connection. "Thrice has no valid Shopify connection for this store. Open Thrice in the Shopify admin once to reconnect."
- Nothing to change. An
update_call that sends no fields: "Nothing to change: send at least one of …". - Unknown cursor. A
cursorthat isn't anextCursorof that list in this store is refused instead of returning an empty page. Pass thenextCursorthe previous page returned, or leave it out to start again. - Invalid input. The field and the problem, one per line, such as "birthday: month 4 has no day 31." Unknown or misspelled fields are refused.
- Too many calls. For example "Too many writes: this connection may make 30 a minute. Try again in 12 s."
Revoke access
- Open Developers and go to AI connections (MCP).
- Find the connection. The list shows every token (Access token) and every signed-in app (Signed-in app) with its Access, Created by, Created, Last used and Expires.
- Choose Revoke and confirm.
The assistant loses access to your store right away, and this can't be undone. Admins and owners can revoke any connection in the store; viewers can't revoke. Last used is updated at most once a minute.
Removing Thrice from the client stops that client from using it. Some clients also tell Thrice to end the connection; if it is still in the list, revoke it there.