# Building With an AI Agent

Give a coding agent Glint's rules and SDK docs through Foundry's public MCP server, glint.joinfoundry.xyz/llms.txt and the portable SKILL.md.

Give your coding agent Glint's rules (no network access, root `index.html` and `glint.json` in the ZIP, size budgets, and SDK lifecycle and mute calls) before it writes code. You can give them through the public MCP server, `llms.txt`, or the skill file that comes with the SDK.

## Connect the Public MCP Server

Foundry's public MCP address needs no account and no sign-in:

```text
https://api.joinfoundry.xyz/mcp/public
```

Add it to your client the same way as the signed-in address, without the sign-in step:

```bash tab="Claude Code"
claude mcp add --transport http glint https://api.joinfoundry.xyz/mcp/public
```

```bash tab="Codex"
codex mcp add glint --url https://api.joinfoundry.xyz/mcp/public
```

```json tab="Cursor"
{
  "mcpServers": {
    "glint": {
      "url": "https://api.joinfoundry.xyz/mcp/public"
    }
  }
}
```

Claude and ChatGPT add it as a custom connector. Setup for every client is in [Connect an AI Client](https://joinfoundry.xyz/help/developers/mcp-clients).

## The Glint SDK Tools

The public address offers four read-only tools. Each returns a short, focused answer, so an agent can ask for only the part it needs.

| Tool | What it returns | Input |
| --- | --- | --- |
| `glint_sdk_rules` | Size and rate budgets, Performance Score and Brotli repackaging tiers, Package X-Ray behavior, the zero-network sandbox and CSP, multiplayer and built-in room chat and voice rules, CLI install and update flags, the Glint Studio publishing steps, and the `glint.json` v1 schema. | `section`: `all` (default), `limits`, `sandbox`, `manifest`, `multiplayer`, `cli` or `publishing` |
| `glint_sdk_api` | Exact TypeScript signatures, behavior contracts, and snippets for all modules or a single runtime module. | `topic`: `all`, `overview` (default), `lifecycle`, `meter`, `demo`, `system`, `player`, `saves`, `achievements`, `leaderboards`, `multiplayer` or `input` |
| `glint_sdk_engine_guide` | Setup, the starter CLI template, export settings, and common pitfalls for one engine. | `engine`: `vanilla` (default), `phaser`, `threejs`, `pixijs`, `kaplay`, `godot`, `unity` or `wasm` |
| `glint_sdk_diagnose` | The meaning and fix for any CLI validator code (`GL001`-`GL014`, `GL101`-`GL104`) or descriptive diagnostic key. An unknown code returns the list of known keys. | `code`: e.g. `GL003` or `FP002_INVALID_MANIFEST` |

When you're signed in to the account address (`https://api.joinfoundry.xyz/mcp`) with Marketplace access, you also get the Glint Studio tools:

| Tool | Scope | What it does |
| --- | --- | --- |
| `glint_list_my_games` | `marketplace:read` or `marketplace:write` | Lists all games you manage in Glint Studio (drafts and published), with IDs, slugs, revisions, build/cover status, and Studio URLs. |
| `glint_studio_game_config` | `marketplace:read` or `marketplace:write` | Reads one game's revision, metadata, real achievement keys, leaderboard IDs and score bounds, live/pending build status, Package X-Ray findings, and exact `publishChecklist`. |
| `glint_create_game` | `marketplace:write` | Creates a new Glint Studio draft game (`title`, optional `slug`). |
| `glint_update_game` | `marketplace:write` | Updates title, slug (before first publish), description, genres, controls, orientation, price, cover/screenshot media IDs, and patch notes. |
| `glint_upsert_achievement` | `marketplace:write` | Creates or updates an achievement definition in Glint Studio to match `sdk.achievements.unlock(key)`. |
| `glint_upsert_leaderboard` | `marketplace:write` | Creates or updates a leaderboard definition in Glint Studio to match `sdk.leaderboards.submit(key, score)`. |

The full list of Foundry's tools is in the [Tool Reference](https://joinfoundry.xyz/help/developers/mcp-tools).

## Point an Agent at llms.txt

Glint publishes a plain-text summary for AI agents at:

```text
https://glint.joinfoundry.xyz/llms.txt
```

It lists the public and authenticated MCP tools, the core platform rules, and the `glint` CLI commands for validating and publishing builds.

## Use the Portable Skill File

The SDK package includes `SKILL.md`, a skill file written for coding agents. After you install the SDK it's in your project at:

```text
node_modules/@joinfoundry/glint-sdk/SKILL.md
```

Copy it to wherever your coding agent reads skills or project instructions, or tell the agent to read it at the start of a task. It covers platform rules, lifecycle, pause and mute handling, saves, multiplayer, local validation, and the **"Upload this to Glint"** publishing flow.

## Upload Directly From Your Coding Agent

Once you create a Foundry personal token with **Marketplace write** (`marketplace:write`) access in [AI Agents settings](https://joinfoundry.xyz/workspace/agents) and set `FOUNDRY_API_TOKEN` in your shell, you can tell your coding agent:

> "Upload this to Glint."

Following `SKILL.md`, your agent will:

1. Check that you are using the latest `@joinfoundry/glint-sdk` (via `npx --yes --prefer-online -p @joinfoundry/glint-sdk@latest glint ...`, or by updating with `npm install @joinfoundry/glint-sdk@latest`).
2. Run `glint publish --inspect --json` to read `glint.json`, locate your build folder, check existing Glint Studio games, and scan for cover and screenshot images (including checking Glint's `16:10`, minimum `640x400` cover requirement).
3. Ask for any missing details: whether this is a new game or an update, title, semver version, short description, 1 to 3 genres, controls, orientation, free or paid pricing, and whether to use project images for the cover and screenshots or upload them manually on the site.
4. Update `glint.json`, run `glint validate --json` (fixing any blocking `GL001`-`GL014` errors), and run `glint publish ... --json` to create or update the game, upload media and the build ZIP, and wait for Package X-Ray and Brotli inspection.
5. Return a direct Glint Studio link (`https://glint.joinfoundry.xyz/studio/games/<gameId>`; the game is also in the **Releases** list at `https://glint.joinfoundry.xyz/studio`) and list what's left to finish in Glint Studio, such as content rating, rights confirmation or a cover image.

## Recommended Workflow

1. Make sure you're on the latest `@joinfoundry/glint-sdk` (`npm view @joinfoundry/glint-sdk version`, `npm install @joinfoundry/glint-sdk@latest`, or use `npx --yes --prefer-online -p @joinfoundry/glint-sdk@latest glint ...`).
2. Have the agent read the rules and API signatures first: `glint_sdk_rules(section="all")` (or targeted sections `limits`, `sandbox`, `cli`, `publishing`) and `glint_sdk_api(topic="all")`.
3. Scaffold with the CLI for your engine and build the smallest playable version. The commands are in the [Glint SDK Quickstart](https://joinfoundry.xyz/help/developers/glint-sdk).
4. Run the build in the local emulator, then run `glint validate --json` and fix every error. The codes and fixes are in [CLI and Local Emulator](https://joinfoundry.xyz/help/developers/glint-sdk-cli).
5. Tell your agent to upload the build (`glint publish`), answer its metadata and cover-image questions, and open the returned Glint Studio link to complete content rating and click **Publish**.
6. Use `glint_upsert_achievement` / `glint_upsert_leaderboard` and `glint_studio_game_config` to keep your game's achievements and leaderboards in sync with Glint Studio.

Keep the platform rules in your project's instruction file too, so a new session starts with them. [Platform Rules and Budgets](https://joinfoundry.xyz/help/developers/glint-sdk-platform-rules) has the full list.
