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

# OpenCode

> Connect SendKit to OpenCode for AI-powered email management from the terminal

[OpenCode](https://github.com/opencode-ai/opencode) is an open-source AI coding assistant that runs in your terminal. You can connect it to SendKit's MCP server to manage your email infrastructure with natural language.

## Prerequisites

* OpenCode installed
* A SendKit API key with **Full** permission

## Setup

<Steps>
  <Step title="Open the configuration file">
    Edit your OpenCode configuration at `.opencode.json` in your project root (or `~/.opencode.json` for global config):

    ```json theme={null}
    {
      "mcpServers": {
        "sendkit": {
          "type": "sse",
          "url": "https://mcp.sendkit.dev/sendkit",
          "headers": {
            "Authorization": "Bearer sk_your_api_key_here"
          }
        }
      }
    }
    ```

    <Note>
      Replace `sk_your_api_key_here` with your actual API key from the [SendKit dashboard](https://app.sendkit.dev).
    </Note>
  </Step>

  <Step title="Restart OpenCode">
    Close and reopen OpenCode to load the new MCP configuration.
  </Step>

  <Step title="Verify the connection">
    Ask OpenCode to interact with your SendKit account:

    ```
    List all my SendKit domains
    ```
  </Step>
</Steps>

<Tip>
  OpenCode currently supports `stdio` and `sse` transports. The `sse` transport is used for remote HTTP servers.
</Tip>

## Example prompts

```
Create a sender called "Support" with username "support" on my verified domain
```

```
Show me my email sending metrics for the last 7 days
```

```
Add user@example.com to the suppression list
```
