# Install the Gridize MCP server

Gridize gives AI agents pixel art tools: turn any image into clean pixel art,
generate pixel art sprites from a prompt, and animate them. This guide is for
an AI assistant setting it up for its user. Follow the section for the client
you are running in, then do "Check it works".

- MCP URL (sign in with a Gridize account): https://gridize.dev/api/mcp/account
- Transport: Streamable HTTP. Authentication: OAuth 2.1 sign-in in the browser.
- Human-readable page: https://gridize.dev/mcp

## Rules for the assistant

1. Use the sign-in URL above. The user signs in once in their browser; new
   accounts get 30 free trial credits. No API key is needed.
2. Never ask the user to paste an API key into the chat. If the user already
   pasted one, use the API key section below and suggest they delete that key
   at https://gridize.dev/settings/apikeys and create a new one, since chat history keeps it.
3. Do the steps yourself when you can run commands or edit files. Otherwise
   give the user the exact clicks, one step at a time.
4. If the user only wants the free converter and no account, use the open URL
   in "Without an account".

## Claude (claude.ai, Claude Desktop, Claude mobile)

The chat cannot change settings, so tell the user to do this (about a minute):

1. Open https://claude.ai/customize/connectors (Customize → Connectors).
2. Click "+ Add", then "Add custom connector".
3. Name: Gridize. URL: https://gridize.dev/api/mcp/account
4. Click Continue, keep the suggested sign-in settings, click Add, then Connect.
5. Sign in to Gridize and click Allow.

Once added, it works in Claude on the web, desktop and mobile. The Free plan
allows one custom connector. Team and Enterprise: an Owner adds it under
Organization settings → Connectors.

## Claude Code

Run:

    claude mcp add --transport http --scope user gridize https://gridize.dev/api/mcp/account

Then sign in: run `claude mcp login gridize` in a terminal, or type `/mcp`
in Claude Code, pick gridize and follow the browser sign-in.

## Codex (CLI and app)

Run:

    codex mcp add gridize --url https://gridize.dev/api/mcp/account
    codex mcp login gridize

Or add to ~/.codex/config.toml and then run `codex mcp login gridize`:

    [mcp_servers.gridize]
    url = "https://gridize.dev/api/mcp/account"

## Cursor

Add to ~/.cursor/mcp.json (merge into an existing "mcpServers" object):

    {
      "mcpServers": {
        "gridize": { "url": "https://gridize.dev/api/mcp/account" }
      }
    }

Cursor finds the sign-in automatically; enable the server in Cursor Settings →
MCP and sign in when asked.

## Antigravity

Add to ~/.gemini/config/mcp_config.json (merge into "mcpServers"):

    {
      "mcpServers": {
        "gridize": { "serverUrl": "https://gridize.dev/api/mcp/account" }
      }
    }

Then open Agent settings (Ctrl+, or Cmd+,) → Customizations, click
Authenticate next to gridize, finish the browser sign-in, copy the code and
paste it back, then Submit.

## Other clients

Any client with remote MCP and OAuth: add https://gridize.dev/api/mcp/account as a Streamable HTTP
server and sign in when asked. Clients that only run local (stdio) servers:
command `npx`, args `["-y", "gridize-mcp"]`, environment
`GRIDIZE_API_KEY` set to a key from https://gridize.dev/settings/apikeys (Node.js 18+).

## With an API key instead of sign-in

For scripts or clients without OAuth: create a key at
https://gridize.dev/settings/apikeys and send `Authorization: Bearer <key>` to https://gridize.dev/api/mcp/account
(or https://gridize.dev/api/mcp). Put the key in the client's config or an environment variable,
never in the chat.

## Without an account

https://gridize.dev/api/mcp needs no sign-in and offers the free tools (image_to_pixel_art,
list_palettes), limited to 10 calls a minute per address.

## Check it works

1. Call `list_palettes`. A list of palettes means the connection works.
2. Call `get_credits`. A balance means sign-in works.
3. Tell the user it is ready and suggest a first request, for example:
   - "Turn this image into 32-color pixel art."
   - "Make a 32 px pixel art knight with a blue shield."
   - "Animate that knight walking to the right in a loop."

## Tools

| Tool | Cost |
|---|---|
| image_to_pixel_art: PNG, JPEG or WebP up to 1024 px → native-size pixel art, auto pixel size, color limit or one of 25 palettes | Free |
| list_palettes: the 25 palette presets | Free |
| generate_pixel_art: 1 or 4 sprites at 16, 32 or 64 px from a prompt in any language | 8 credits for one, 20 for four |
| animate_sprite: animate a 16–256 px PNG sprite from a motion prompt; returns an id | 30 credits up to 33 frames, 40 longer |
| get_animation: the finished loop as a GIF, optionally every frame as PNG; poll about every 30 s | Free |
| get_credits: balance and prices | Free |

## Troubleshooting

- "Sign in again" or HTTP 401: the sign-in expired or the app was
  disconnected; repeat the client's sign-in step.
- Not enough credits: buy credits at https://gridize.dev/pricing.
- The user can disconnect apps at https://gridize.dev/settings/apikeys (Connected apps).
