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

  1. Open the MCP page in the dashboard and choose Test or Live at the top.
  2. Create a token. It starts with ota_ and is shown once, so copy it.
  3. Add the server to your agent. The page gives you the snippet with your token filled in.
EnvironmentMCP URL
Livehttps://api.stacked.xyz/mcp
Testhttps://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:

Shell
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:

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:

JSON
{
  "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.

AreaTools
Start hereget_context, get_reference, get_api_credentials, list_reward_currencies
Offerslist_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 opslist_liveops_events, upsert_liveops_event, bulk_upsert_liveops_events, generate_liveops_event_dailies, archive_liveops_event, get_milestone_progress
Leaderboardslist_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 settingslist_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 shopget_asset_library, upsert_assets, delete_assets, list_shop_items, upsert_shop_item, archive_shop_item, list_token_contracts, list_chain_listeners
Playerssearch_players, get_player, get_player_events, list_player_offers, set_player_offer_status, delete_player_offers, update_player_tags
Testingqa_upsert_test_player, qa_send_events, qa_get_player_offers, qa_claim_offer, qa_liveops_initialize, qa_generate_player_jwt
Webhookslist_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_context says 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_reference returns 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, qa or webhooks. 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_offers once 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_offers merges your changes into the stored offer at the top level, so a list such as rewards is 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_payouts shows who has, and qa_claim_offer with kind: "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.

  1. qa_upsert_test_player creates the player and shapes it (levels, currencies, tags) to match the offer's conditions.
  2. qa_get_player_offers runs surfacing exactly as your game client would, and returns the player's offers.
  3. qa_send_events sends game events for the player to move the offer's progress. Events are processed in the background, so give it a few seconds.
  4. qa_get_player_offers again: the offer should be claimable.
  5. qa_claim_offer claims it.

A test claim is a real claim. qa_claim_offer pays 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

LimitValue
Requests300 a minute per token
Request body5 MB
One tool result200,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>" }:

StatusMeaning
401The token is missing (missing-agent-token) or not valid on this server: wrong, revoked, lapsed, or created for the other environment
429too-many-requests: over the rate limit
503auth-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: