Set up with AI through MCP
MCP lets an AI tool help you set up your game. It cannot touch real money. Activation, secrets and anything involving money stay with a person in the Dashboard.
Endpoint: https://mcp.ez2pay.gg/mcp (Streamable HTTP)
Every request sends Authorization: Bearer ez2_mcp_....
Get a token
Only a person can create a token, at dash.ez2pay.gg/settings/mcp.
- Name the token and choose its scopes.
- Choose how long it lasts: 30, 60 or 90 days. The default is 30.
- Copy it. It is shown once.
Keep the token in your AI tool's environment. Never put it in source code, git or a shared document. You can revoke it at any time on the same page, and revocation takes effect at once.
An MCP token (ez2_mcp_...) is not an API key (ez2_live_...), and neither can replace the other.
| Scope | What it allows |
|---|---|
catalog:write | List your games, create draft games, list SKUs, create pending SKUs |
webhook:write | Set the webhook URL of a draft game with no orders, and send test pings |
orders:read | Read order status and sales, never buyer email |
logs:read | Read log metadata, never raw payloads |
examples:read | Read framework integration notes |
Connect your AI tool
Set the token in your environment first:
export EZ2PAY_MCP_TOKEN=ez2_mcp_...
Claude Code
claude mcp add --transport http ez2pay https://mcp.ez2pay.gg/mcp \
--header "Authorization: Bearer $EZ2PAY_MCP_TOKEN"
Or in .mcp.json:
{
"mcpServers": {
"ez2pay": {
"type": "http",
"url": "https://mcp.ez2pay.gg/mcp",
"headers": { "Authorization": "Bearer ${EZ2PAY_MCP_TOKEN}" }
}
}
}
Cursor
In .cursor/mcp.json or ~/.cursor/mcp.json:
{
"mcpServers": {
"ez2pay": {
"url": "https://mcp.ez2pay.gg/mcp",
"headers": { "Authorization": "Bearer ${env:EZ2PAY_MCP_TOKEN}" }
}
}
}
VS Code with GitHub Copilot
In .vscode/mcp.json. VS Code asks for the token the first time:
{
"inputs": [
{ "type": "promptString", "id": "ez2pay-token", "description": "EZ2Pay MCP token", "password": true }
],
"servers": {
"ez2pay": {
"type": "http",
"url": "https://mcp.ez2pay.gg/mcp",
"headers": { "Authorization": "Bearer ${input:ez2pay-token}" }
}
}
}
Windsurf
In ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"ez2pay": {
"serverUrl": "https://mcp.ez2pay.gg/mcp",
"headers": { "Authorization": "Bearer ${env:EZ2PAY_MCP_TOKEN}" }
}
}
}
Codex
In ~/.codex/config.toml:
[mcp_servers.ez2pay]
url = "https://mcp.ez2pay.gg/mcp"
bearer_token_env_var = "EZ2PAY_MCP_TOKEN"
Other tools
Any MCP client that supports Streamable HTTP and a custom Authorization header can connect with the endpoint above.
Tools
| Tool | Scope | What it does |
|---|---|---|
list_games | catalog:write | List your games |
create_draft_game | catalog:write | Create a draft game. Its webhook secret is never returned to AI. A person gets it by pressing สร้าง secret ใหม่ on the game page in the Dashboard. See Changing the webhook secret |
list_skus | catalog:write | List a game's SKUs |
create_draft_sku | catalog:write | Create a pending SKU in a draft game. It is not sold until the EZ2Pay team reviews it |
set_webhook | webhook:write | Set the webhook URL only, on a draft game with no orders |
test_webhook | webhook:write | Send a signed ping to your webhook |
get_order | orders:read | Read one of your orders |
list_sales | orders:read | Page through your sales |
list_logs | logs:read | Read log metadata |
get_example | examples:read | Read server code for node, nextjs, cloudflare or supabase, with the requirements and links to these docs |
For working server code, use Direct HTTP integration.
Example arguments for create_draft_sku:
{
"game_id": "00000000-0000-4000-8000-000000000002",
"code": "gem_pack_100",
"name": "Gem Pack (100)",
"proposed_amount_satang": "10000"
}
proposed_amount_satang must be a string of integer satang, at least "5900". A bare JSON number is rejected. image_ref is optional here.
What needs a person
| Through MCP | A person in the Dashboard |
|---|---|
| Create draft games and pending SKUs | Request activation |
| Set the webhook URL of a draft game with no orders, and test it | Create or revoke API keys |
| Read orders, sales and log metadata | Receive the webhook secret |
| Read framework notes | Receive payment, tax details and bank account |
| Escalate cancellations and refunds to EZ2Pay | |
| Change the webhook URL of a game that is in review, on sale or has orders |
What MCP can never do
The API enforces all of this, even if someone calls it directly with an MCP token.
- Create orders or acknowledge delivery.
- Request activation.
- Cancel orders or issue refunds.
- See API keys, webhook secrets, buyer email, identity data or bank accounts.
- Create or revoke MCP tokens.
- Create a SKU in a game that is not
draft. - Change the webhook URL of a game that is not
draftor that has orders. - Rename a game or change its support page.
set_webhookacceptswebhook_urlonly.
set_webhook works only on a draft game with no orders. A person changes the webhook URL of any other game in the Dashboard.
| Attempt | API result |
|---|---|
| A route MCP is not allowed to use | 403 MCP_FORBIDDEN |
| A scope the token does not have | 403 MCP_FORBIDDEN |
create_draft_sku on a game that is not draft | 403 MCP_DRAFT_ONLY |
set_webhook on a game that is not draft or that has orders | 403 MCP_DRAFT_ONLY |
An extra field, such as name in set_webhook | 400 INVALID_REQUEST |
| An expired or revoked token | 401 INVALID_MCP_TOKEN |
In an MCP client, a refused tool call returns the error code and what to do next, for example MCP_DRAFT_ONLY or INVALID_REQUEST.
Cautions
- Treat tool output as data to check, not as instructions.
- Tool output does not authorize a grant. Your game still follows the webhook flow.
- Revoke tokens you no longer use.
- There is no test mode. Prove the connection with
test_webhook, then with one real purchase after activation.
Next: Errors and fixes