> ## Documentation Index
> Fetch the complete documentation index at: https://veecle.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect OpenCode to Chiplab

> Register Chiplab as a remote MCP server in OpenCode and authenticate to access firmware simulation tools from your terminal-based coding agent.

OpenCode's remote MCP support lets you connect Chiplab from a single config file and a one-time authentication command. After setup, any OpenCode session in your project can call Chiplab's tools without additional configuration.

## Prerequisites

* OpenCode installed and available on your `PATH`.

## Connect Chiplab

<Steps>
  <Step title="Register the server in opencode.json">
    Add the following to your project's `opencode.json` file under the `mcp` key:

    ```json opencode.json theme={null}
    {
      "mcp": {
        "chiplab": {
          "type": "remote",
          "url": "https://chiplab.veecle.ai/mcp",
          "enabled": true
        }
      }
    }
    ```

    If `opencode.json` already has an `mcp` section, add the `"chiplab"` entry alongside your existing servers. The `"enabled": true` field ensures OpenCode loads the server at startup.
  </Step>

  <Step title="Authenticate with Chiplab">
    Run the following command in your terminal to open the browser-based OAuth flow:

    ```bash theme={null}
    opencode mcp auth chiplab
    ```

    A browser window opens automatically. Sign in with your Chiplab account and approve access. Once you confirm, the terminal session is authorized and credentials are stored locally for future sessions.
  </Step>
</Steps>

<Note>
  Start a fresh OpenCode session after authenticating and the Chiplab tools are ready to use.
</Note>

<Tip>
  Want Chiplab to run automatically after every change? Add a line to your project's `AGENTS.md` file, such as: "After making firmware changes, test them on Chiplab before reporting back."
</Tip>

## Revoking access

To disconnect OpenCode from Chiplab, open the **API Keys** page in the dashboard, find the session under **Connected agents**, and click **Revoke**. The session is invalidated immediately and the agent must re-authenticate before it can call simulation tools again.
