Docs menu
Docs/AI agents

Connect OpenCode to Spritory

Connect Spritory to OpenCode, the open source coding agent, and have it build pixel art game assets for you in your own style.

What you need

A Spritory token and the server address https://spritory.com/api/mcp. See how to connect to create a token. Below, replace spt_your_token with yours.

Add Spritory to your config

Open opencode.json in your project, or your global config at ~/.config/opencode/opencode.json, and add Spritory under mcp. This example reads the token from an environment variable so it stays out of the file:

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "spritory": {
      "type": "remote",
      "url": "https://spritory.com/api/mcp",
      "enabled": true,
      "headers": {
        "Authorization": "Bearer {env:SPRITORY_TOKEN}"
      }
    }
  }
}

Set your token

Add this to your shell profile, such as ~/.zshrc or ~/.bashrc, and open a new terminal:

bash
export SPRITORY_TOKEN="spt_your_token"

Good to know

  • Project or global. A project opencode.json applies only there. The global file applies to every project, which suits a tool like Spritory that you use across games.
  • Turn it off without removing it. Set enabled to false to keep the entry but hide Spritory from your agent.

Check the connection

bash
opencode mcp list

Spritory should be listed. Start a new session so OpenCode loads it.

Next steps

Ask your agent to make something in Spritory. For ideas, see prompt ideas. If something goes wrong, see troubleshooting.

Try it in the Forge

Open the editor for free and build along with this page.

Open the Forge