Integrate12 / 12
MCP server
Stacked has a Model Context Protocol server. Connect an AI agent such as Claude Code, Cursor or VS Code to it, and the agent can run your game's Stacked setup for you: offers, live ops events, leaderboards, rules, players, the shop and webhooks. It acts as one member of your team and can do exactly what that member can do in the dashboard.
Connect an agent
- Open the MCP page in the dashboard and choose Test or Live at the top.
- Create a token. It starts with
ota_and is shown once, so copy it. - Add the server to your agent. The page gives you the snippet with your token filled in.
| Environment | MCP URL |
|---|---|
| Live | https://api.stacked.xyz/mcp |
| Test | https://api.sandbox.stacked.xyz/mcp |
A token works on one environment only. Create one on each if your agent should reach both.
Claude Code. Run in a terminal:
claude mcp add --transport http --scope user stacked https://api.stacked.xyz/mcp \
--header "Authorization: Bearer ota_your_token"Cursor. Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"stacked": {
"url": "https://api.stacked.xyz/mcp",
"headers": { "Authorization": "Bearer ota_your_token" }
}
}
}VS Code. Add to .vscode/mcp.json, or to your user MCP configuration:
{
"servers": {
"stacked": {
"type": "http",
"url": "https://api.stacked.xyz/mcp",
"headers": { "Authorization": "Bearer ota_your_token" }
}
}
}Any other client. The server speaks Streamable HTTP and is stateless. Your client must be able to send an Authorization: Bearer header. There is no OAuth sign-in.
Then ask your agent something like "list my Stacked offers".
What the agent may do
- It is you. The agent acts as the member who created the token, in that member's organization. It cannot reach another organization.
- Same permissions, always current. The agent can do what the member's role allows, nothing more. If the role changes, the agent's access changes with it. A call the member may not make answers
insufficient-permissions. - Every tool is listed to every agent. Whether a call is allowed is decided when it is made.
- Tokens do not expire on a date. A token lapses after 90 days without use, and you can revoke it on the MCP page at any time. Team admins see and can revoke every member's tokens.
A token is a password. Anyone who holds it can act as you. Keep it out of git and out of shared configuration files.
Tools
Your agent gets the current list from the server, with each tool's inputs. This is what it covers.
| Area | Tools |
|---|---|
| Start here | get_context, get_reference, get_api_credentials, list_reward_currencies |
| Offers | list_offers, get_offers, create_offers, update_offers, archive_offers, get_offer_stats, estimate_offer_reach, save_offer_groups, reorder_offer_groups, link_cross_game_offer, unlink_cross_game_offer, get_upload_url |
| Live ops | list_liveops_events, upsert_liveops_event, bulk_upsert_liveops_events, generate_liveops_event_dailies, archive_liveops_event, get_milestone_progress |
| Leaderboards | list_leaderboards, upsert_leaderboard, archive_leaderboard, get_leaderboard_standings, list_leaderboard_periods, list_leaderboard_shards, list_leaderboard_rewards, upsert_leaderboard_reward, archive_leaderboard_reward, set_leaderboard_reward_overrides, generate_leaderboard_rewards, retry_leaderboard_payouts, list_leaderboard_payouts, list_leaderboard_blacklist, blacklist_leaderboard_player, unblacklist_leaderboard_player |
| Rules and settings | list_reward_rules, upsert_reward_rules, delete_reward_rule, get_offer_rules, update_offer_rules, list_spend_limits, upsert_spend_limit, delete_spend_limit, get_settings, update_settings, update_game_profile, get_gift_card_limits, get_billing_summary |
| Assets and shop | get_asset_library, upsert_assets, delete_assets, list_shop_items, upsert_shop_item, archive_shop_item, list_token_contracts, list_chain_listeners |
| Players | search_players, get_player, get_player_events, list_player_offers, set_player_offer_status, delete_player_offers, update_player_tags |
| Testing | qa_upsert_test_player, qa_send_events, qa_get_player_offers, qa_claim_offer, qa_liveops_initialize, qa_generate_player_jwt |
| Webhooks | list_webhook_event_types, list_webhook_endpoints, create_webhook_endpoint, update_webhook_endpoint, delete_webhook_endpoint, get_webhook_secret, rotate_webhook_secret, send_test_webhook, list_webhook_deliveries, list_webhook_messages, resend_webhook, recover_failed_webhooks, get_webhook_portal_url |
Two tools matter most:
get_contextsays which organization the agent acts in, which member it acts as, and that member's roles and permissions. Agents are told to call it first.get_referencereturns a how-to guide and the exact types the server validates, for one topic:offers,conditions,offer_groups,ab_testing,player_offers,offer_rules,reward_rules,spend_limits,liveops,leaderboards,shop,asset_library,players,qaorwebhooks. Agents are told to read the topic before they write a document of that kind.
How it behaves
The tools run the same operations as the dashboard, with the same checks. A few rules keep an agent's changes safe to review:
- New offers are created disabled. Enable one with
update_offersonce you have looked at it. - Deleting is archiving. Offers, live ops events, leaderboards and shop items are archived, and can be restored.
- Updates replace lists whole.
update_offersmerges your changes into the stored offer at the top level, so a list such asrewardsis replaced, not appended to. - Leaderboard rewards are generated once, and only when asked:
generate_leaderboard_rewards. Generating grants nothing: each winner claims theirs in the game.list_leaderboard_payoutsshows who has, andqa_claim_offerwithkind: "leaderboard"claims one as a test player.
Test an offer end to end
The testing tools let an agent prove an offer works before any real player sees it. Use them on Test, with a made-up player id such as qa-alex.
qa_upsert_test_playercreates the player and shapes it (levels, currencies, tags) to match the offer's conditions.qa_get_player_offersruns surfacing exactly as your game client would, and returns the player's offers.qa_send_eventssends game events for the player to move the offer's progress. Events are processed in the background, so give it a few seconds.qa_get_player_offersagain: the offer should be claimable.qa_claim_offerclaims it.
A test claim is a real claim.
qa_claim_offerpays the rewards and sends your reward webhooks. Point your Test webhook endpoint at a backend that expects it.
qa_liveops_initialize shows what a player gets from Live Ops, and qa_generate_player_jwt gives a 15-minute player token for calling the client endpoints by hand.
Limits and errors
| Limit | Value |
|---|---|
| Requests | 300 a minute per token |
| Request body | 5 MB |
| One tool result | 200,000 characters. A longer one is cut: narrow it with filters or pages |
A request the server rejects before running a tool answers with an HTTP status and { "error": "<code>" }:
| Status | Meaning |
|---|---|
| 401 | The token is missing (missing-agent-token) or not valid on this server: wrong, revoked, lapsed, or created for the other environment |
| 429 | too-many-requests: over the rate limit |
| 503 | auth-unavailable: the token could not be checked just now. Try again |
A tool that fails returns an error result your agent can read: { "error": "<code>", "status": <http status>, "details": ... }. The common ones are invalid-input (400, with the fields at fault) and insufficient-permissions (403).
Read these docs from an agent
The docs themselves are plain markdown for agents:
/docs/llms-full.txtis every page in one file./docs/llms.txtis the index: each page with one line about it.