MCP clientsAI

Connect OpenCode to thirds.ai

Use with your agent

Give this prompt to your AI agent. The agent does the task for you.

Read https://thirds.ai/docs/mcp/opencode and help me connect OpenCode to thirds.ai with an API key

Use OpenCode to build templates and create PDFs or images. Create an API key on the API keys page first. Each successful PDF or static image costs one credit.

Install the server

Set THIRDS_API_KEY in the environment that starts OpenCode. Add this remote server to ~/.config/opencode/opencode.json, or to opencode.json in one project:

JSON
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "thirds": {
      "type": "remote",
      "url": "https://thirds.ai/mcp",
      "enabled": true,
      "oauth": false,
      "headers": {
        "Authorization": "Bearer {env:THIRDS_API_KEY}"
      }
    }
  }
}

OpenCode needs "type": "remote" and a url field. Set "oauth": false so OpenCode uses the API key instead of an OAuth sign-in. See OpenCode's MCP server guide. Keep the key out of the JSON file and source control.

Check the connection

Run opencode mcp list. Ask OpenCode to list the thirds.ai tools.

Read the main MCP guide before you start paid work.

FAQ

Why does OpenCode start an OAuth flow?

Remote servers enable OAuth unless you set "oauth": false. Add that field and keep the bearer header.

Which configuration file should I use?

Use ~/.config/opencode/opencode.json for your own setup. Use a project opencode.json to share the server definition. Each person must set their own THIRDS_API_KEY.

Does connecting spend credits?

No. Connecting and listing tools don't spend credits. AI template work and successful renders can. Ask your agent to show the action and the cost before it starts paid work.

Ready to make your first file?

Start in the playground with a gallery template, or get an API key and send your first request from your own terminal.