# publish_cloud_code

Publish server-side game logic (CloudCode) and make it live. This is the only way to run custom code on the server, and the only way to write protected data: the ReadOnly/Internal buckets of a player's UserCustomData and the Runtime scope of the title's data store. The script is plain JavaScript filling a global 'handlers' object, e.g. handlers.claimDailyBonus = function (args, context) { … }. Inside a handler: log.Info/Warning/Error, context.UserID, and server.* (ReadUserData, GetTitleConfig, GetUserCustomData, SetUserCustomData, DeleteUserCustomData, BatchSetUserCustomData, BatchDeleteUserCustomData, GetPublicUserCustomDataOf, GetTitleCustomData, SetTitleCustomData, IncrementTitleCustomData, DeleteTitleCustomData, BatchSetTitleCustomData, BatchDeleteTitleCustomData, GetIntegrationVariable, HttpRequest) — each returns { Success, Error, Data }. No async/await, no imports; 10 seconds wall-clock per call and a per-execution cap on server.* calls. The only way out to the network is server.HttpRequest({ Method, Url, Headers, Body }) — there is no fetch and no XMLHttpRequest; it reaches only publisher-allow-listed hosts over https, and credentials go in as {{secret:NAME}} placeholders (see list_title_secrets), never as literal values. The code REPLACES the previous revision entirely — read get_cloud_code first and send back the full script. Games call handlers through the SDK's client.cloudCode.execute(name, args).

Agent View of the PolicyLayer registry record for `publish_cloud_code`. HTML page: https://policylayer.com/tools/com-idosgames-platform/publish-cloud-code

## Facts

- Tool: `publish_cloud_code`
- Server: iDos Games (`https://site.idosgames.com/api/v2/mcp`) — https://policylayer.com/tools/com-idosgames-platform.md
- Homepage: https://github.com/iDos-Games/idosgames-mcp
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server auth posture: open
- Server CORS policy: *
- Server rate-limited: no
- Parameters: 4 (2 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string | yes | Full JavaScript source of the revision. |
| `comment` | string | no | Short note about what changed. |
| `handlers` | array | no | Optional whitelist of callable handlers; anything not listed is rejected by the server. |
| `title_id` | string | yes | TitleID. |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "publish_cloud_code",
    "arguments": {
      "code": "<code>",
      "title_id": "<title_id>"
    }
  }
}
```

## Why publish_cloud_code is rated Medium

An AI agent can call publish_cloud_code faster than any human can review: one bad instruction and it creates or modifies resources in iDos Games by the hundred, each call as confident as the last.

Risk signals: Accepts freeform code/query input (code)

## Use case

AI agents use publish_cloud_code to create or update resources in iDos Games, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your iDos Games environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches iDos Games:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "publish_cloud_code": {
      "limits": [
        {
          "counter": "publish_cloud_code_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on iDos Games (158)

- `delete_kanban_card` — Destructive — https://policylayer.com/tools/com-idosgames-platform/delete-kanban-card.md
- `delete_kanban_column` — Destructive — https://policylayer.com/tools/com-idosgames-platform/delete-kanban-column.md
- `delete_kanban_project` — Destructive — https://policylayer.com/tools/com-idosgames-platform/delete-kanban-project.md
- `get_push` — Destructive — https://policylayer.com/tools/com-idosgames-platform/get-push.md
- `get_usage` — Destructive — https://policylayer.com/tools/com-idosgames-platform/get-usage.md
- `save_push` — Destructive — https://policylayer.com/tools/com-idosgames-platform/save-push.md
- `save_usage` — Destructive — https://policylayer.com/tools/com-idosgames-platform/save-usage.md
- `begin_build_upload` — Execute — https://policylayer.com/tools/com-idosgames-platform/begin-build-upload.md
- `finish_build_upload` — Execute — https://policylayer.com/tools/com-idosgames-platform/finish-build-upload.md
- `draft_social_reply` — Read — https://policylayer.com/tools/com-idosgames-platform/draft-social-reply.md
- `estimate_media_cost` — Read — https://policylayer.com/tools/com-idosgames-platform/estimate-media-cost.md
- `get_advertising` — Read — https://policylayer.com/tools/com-idosgames-platform/get-advertising.md
- `get_ai` — Read — https://policylayer.com/tools/com-idosgames-platform/get-ai.md
- `get_analytics` — Read — https://policylayer.com/tools/com-idosgames-platform/get-analytics.md
- `get_asset_bundle` — Read — https://policylayer.com/tools/com-idosgames-platform/get-asset-bundle.md
- `get_attribution` — Read — https://policylayer.com/tools/com-idosgames-platform/get-attribution.md
- `get_authentication` — Read — https://policylayer.com/tools/com-idosgames-platform/get-authentication.md
- `get_ban` — Read — https://policylayer.com/tools/com-idosgames-platform/get-ban.md
- `get_blockchain` — Read — https://policylayer.com/tools/com-idosgames-platform/get-blockchain.md
- `get_build` — Read — https://policylayer.com/tools/com-idosgames-platform/get-build.md
- `get_character` — Read — https://policylayer.com/tools/com-idosgames-platform/get-character.md
- `get_chat` — Read — https://policylayer.com/tools/com-idosgames-platform/get-chat.md
- `get_cloud_code` — Read — https://policylayer.com/tools/com-idosgames-platform/get-cloud-code.md
- `get_collection` — Read — https://policylayer.com/tools/com-idosgames-platform/get-collection.md
- `get_community_marketing` — Read — https://policylayer.com/tools/com-idosgames-platform/get-community-marketing.md
- `get_coop_event` — Read — https://policylayer.com/tools/com-idosgames-platform/get-coop-event.md
- `get_craft` — Read — https://policylayer.com/tools/com-idosgames-platform/get-craft.md
- `get_currency` — Read — https://policylayer.com/tools/com-idosgames-platform/get-currency.md
- `get_data_collections` — Read — https://policylayer.com/tools/com-idosgames-platform/get-data-collections.md
- `get_deal_offer` — Read — https://policylayer.com/tools/com-idosgames-platform/get-deal-offer.md
- …and 128 more: https://policylayer.com/tools/com-idosgames-platform.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=com-idosgames-platform · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/com-idosgames-platform
