Developer Resources / Agents & MCP / Connect Claude

Connect Claude to GameLayer

Connect Claude to your GameLayer account, then ask it to plan and build gamification content: events, missions, achievements, quizzes, surveys, streaks, levels, leaderboards and prizes. Claude works through GameLayer's MCP server with the permissions you approve. It shows you its plan before it changes anything, and every change it makes is in your account's audit log.

MCP server URL
https://api.gamelayer.co/mcp

Using Claude Desktop or claude.ai? Follow Claude Desktop and claude.ai. Using the terminal? Follow Claude Code.

Before you start#

  • You need to be an account admin of the GameLayer account you want to connect. Users with read-only access can't approve a connection.
  • Agent access must be turned on for the account. GameLayer turns it on. If the Agent Keys section of your account says Agent access is not enabled for this account. Contact GameLayer., contact GameLayer.
  • Your Claude plan: custom connectors work on every Claude plan. The Free plan allows one custom connector. On Team and Enterprise plans, an organization owner adds the connector first (see below).

Claude Desktop and claude.ai#

A connector belongs to your Claude account, so once it's added it works in Claude Desktop and on claude.ai alike.

Add the connector#

  1. In Claude, open Customize›Connectors.

  2. Click + Add, then Add custom connector.

  3. Name it GameLayer, enter the server URL https://api.gamelayer.co/mcp and click Add. Leave the advanced and authentication settings empty.

Sign in and approve#

  1. In Customize›Connectors, click Connect next to GameLayer. A GameLayer page opens.

  2. Sign in to GameLayer. Approving a connection needs a sign-in from the last 5 minutes, so you may be asked to sign in again even if you're already signed in. This stops anyone using a dashboard left open to connect an agent. Your choices on the page are kept while you sign in.

  3. Check the page shows Claude (Desktop and web) and claude.ai.

    Approve only a connection you started yourself. If this page opened and you didn't click Connect, close it.

  4. Choose the account, and what Claude may do:

    • Read and Write are ticked by default.
    • Delete and restore is off unless you tick it.
    The GameLayer approval page: Claude (Desktop and web) asks to read and change configuration, with an Account menu, Read and Write ticked, Delete and restore unticked, and Cancel and Approve buttons
    The approval page in the dashboard
  5. Click Approve. You're returned to Claude, and the connector shows as connected.

The connection appears on the account's Agent Keys page as Claude – your name – date.

Claude Code (the CLI)#

Choose one of two ways. Signing in is the recommended one: no key is copied or stored in your configuration.

  1. Add the server. Run this in the folder where you'll use Claude Code, or add --scope user to make it available in every folder:

    Terminal
    $ claude mcp add --transport http gamelayer https://api.gamelayer.co/mcp
  2. Start Claude Code in that folder, type /mcp, choose gamelayer and then Authenticate. Your browser opens the GameLayer page.

  3. Sign in and approve as described in Sign in and approve. The page shows A local app on this computer, such as the Claude CLI.

  4. Finish within a few minutes.

    Claude Code stops waiting for the browser after a short time. If you see localhost refused to connect, run /mcp again and approve straight away.

The connection appears on the Agent Keys page as Local app – your name – date.

What Claude can do#

The tools Claude gets depend on the permissions you approve.

ToolWhat it doesNeeds
get_contextThe account's element limits and usage, its languages, and the connection's permissions and expiryRead
get_guideHow GameLayer elements behave for players, and how to change them safelyRead
get_schemaThe exact shape of an element for creating or changing itRead
list_elementsLists the elements of a type, in short formRead
get_elementReads one element in fullRead
get_changesetReads the result of a changesetRead
list_auditWho changed what and whenRead
create_elementCreates an elementWrite
update_elementReplaces an elementWrite
patch_elementChanges part of an elementWrite
plan_changesetChecks up to 50 changes together without making themWrite
apply_changesetMakes up to 50 changes together, all or nothingWrite
delete_elementDeletes an element, which can be restoredDelete and restore
restore_elementRestores a deleted elementDelete and restore

Ready-made prompts#

Two prompts come with the connector:

PromptWhat it doesIn Claude Code
plan_campaignGive a goal, and Claude reads your setup, plans the whole campaign as one changeset, shows you the plan, and applies it only after you confirm./mcp__gamelayer__plan_campaign
review_accountClaude reviews your setup and reports anything that looks wrong, such as expired elements or missions pointing at missing ones. It changes nothing./mcp__gamelayer__review_account

Limits per connection#

Each connection can make 600 reads, 120 writes and 20 changeset applies a minute.

Each change inside a changeset counts as one write. Over a limit, Claude is told to wait and try again.

Try it#

A good first prompt:

Using GameLayer, tell me what's set up in my account. Then suggest a 4-week onboarding campaign for new players. Plan it and show me the plan, but don't apply anything until I say so.

Disconnecting and revoking#

Revoke on the Agent Keys page to stop a connection everywhere. Revoking stops it within 60 seconds. Any account admin can revoke any connection to that account.

  • Claude Desktop and claude.ai: remove the connector in Customize›Connectors. This removes it from Claude, but revoke it on the Agent Keys page too.
  • Claude Code: run claude mcp logout gamelayer, which revokes the connection, then claude mcp remove gamelayer.
Terminal
$ claude mcp logout gamelayer
$ claude mcp remove gamelayer

When someone leaves your team, remove them from the GameLayer account, and on the Agent Keys page revoke their connections. Use Approved by to filter by person.

Good to know#

  • Connections last 30 days. After that, Claude asks you to sign in again, and you approve the connection as before. A key you create on the Agent Keys page lasts as long as you chose, at most 365 days.
  • One connection per person, per kind, per account. Signing in to Claude Code on a second computer replaces the connection from the first. Adding the connector in a second Claude account (for example a personal one and a work one) replaces the first one's connection. Claude Desktop and claude.ai share one connection.
  • If GameLayer turns agent access off, Claude's GameLayer tools answer that agent access isn't enabled, without asking you to sign in. They work again as soon as it's back on.
  • Claude remembers the tool list until it reconnects. If GameLayer adds tools, disconnect and reconnect (or restart Claude Code) to see them.
  • Every change is audited. Changes made through Claude appear in the account's audit log under the connection, and deleted elements can be restored.

Troubleshooting#

You seeWhat to do
Only an account admin can connect an agent.Your login isn't an admin of any account available for connecting. Ask an account admin to connect, or to give you admin access.
Agent access is not enabled for this account. Contact GameLayer.Contact GameLayer to turn on agent access for the account.
Your sign-in is more than 5 minutes old. Sign in again to approve.Click Sign in again. Your choices are kept.
localhost refused to connect (Claude Code)Claude Code stopped waiting. Run /mcp, choose gamelayer, authenticate again, and approve straight away.
This account has 10 active Agent Keys. Revoke one on the Agent Keys page first.Revoke a key you no longer need on the Agent Keys page, then approve again.
Claude asks you to sign in againThe connection expired or was revoked. Sign in and approve it again.