---
title: "OpenCode MCP Server Setup"
description: "Add 3D AI Studio as a remote MCP server in opencode.json, sign in with opencode mcp auth, and generate textured 3D models and images straight from OpenCode."
source: https://docs.3daistudio.com/mcp/setup/opencode
---

# OpenCode MCP Server Setup

Add 3D AI Studio as a remote MCP server in opencode.json, sign in with opencode mcp auth, and generate textured 3D models and images straight from OpenCode.

OpenCode can use 3D AI Studio as a remote MCP server to create 3D models, images and materials from the terminal.

New to 3D AI Studio? See the [3D model generation MCP](https://www.3daistudio.com/MCP) for what it can do and example results.

## What you need

- A **3D AI Studio account on a paid plan**.
- **OpenCode**, updated to a recent version.
- A browser on the same machine for the sign in.

> [!NOTE]
> **Config not working?** OpenCode updates its MCP configuration from time to time, so the steps below can go out of date. OpenCode can usually set it up for you. Paste this into a session:

```text
Add the 3D AI Studio MCP server for me: https://mcp.3daistudio.com/mcp
(remote server, OAuth sign in, no API key).
Follow https://docs.3daistudio.com/mcp-setup.md, and if your version works differently, use the current way to add a remote MCP server.
```

## Setup

### Add the server

Add a remote MCP server named `3daistudio` to your `opencode.json` (in the project, or in your global OpenCode config). If the file already has an `mcp` section, add the entry inside it:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "3daistudio": {
      "type": "remote",
      "url": "https://mcp.3daistudio.com/mcp",
      "enabled": true
    }
  }
}
```

> [!WARNING]
> Use the URL exactly as shown. `https://www.3daistudio.com` does **not** work as an MCP server address.

### Sign in

Run:

```bash
opencode mcp auth 3daistudio
```

A 3D AI Studio page opens:

1. Sign in with your 3D AI Studio account.
2. Under **Use credits from**, keep **Personal** or choose a team.
3. Click **Authorize**.

### Try it

Start OpenCode and ask:

> "Use 3D AI Studio to make a low poly tree as a GLB."

## Check that it worked

Ask OpenCode: **"What's my 3D AI Studio credit balance?"** It should call the connector and answer with a number.

## OpenCode specific fixes

| Problem | Fix |
| --- | --- |
| Signed out, or the server needs authentication | Run `opencode mcp auth 3daistudio` again |
| "Restart needed" in 3D AI Studio settings | Close all running OpenCode sessions and start a new one. Your connection itself is fine |
| The server fails to connect | Check the URL is exactly `https://mcp.3daistudio.com/mcp` and `type` is `remote` |
| You used another server name | Replace `3daistudio` in the commands with your name |

Results show as **links** in the terminal, and image uploads use a browser upload page. See [Images & Uploads](https://docs.3daistudio.com/mcp/images-and-uploads). More fixes are on the [Troubleshooting](https://docs.3daistudio.com/mcp/troubleshooting) page.

---

> Documentation index for AI agents: https://docs.3daistudio.com/llms.txt
