# Give OpenCode a real phone number

> Install the Phonekit skill and OpenCode can read the texted code in your own app, so it can write and run real phone sign-in tests.

OpenCode gets a Phonekit number it can read. It can add the missing SMS step to your test suite and run it, whichever model you choose.

## Install the skill

```bash title="Install for OpenCode"
npx skills add https://www.phonekit.io --skill phonekit --agent opencode --copy
```

The skill lands in `.agents/skills/phonekit/SKILL.md`, which OpenCode reads. Start a new OpenCode session in the repository and ask it to load `phonekit`. OpenCode offers discovered skills through its skill tool; [its skills docs](https://opencode.ai/docs/skills/) cover discovery and permissions.

## Connect

### MCP

Merge this entry into the project's `opencode.json`, keeping its existing settings:

```json title="OpenCode remote MCP configuration"
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "phonekit": {
      "type": "remote",
      "url": "https://www.phonekit.io/api/mcp",
      "enabled": true
    }
  }
}
```

```bash title="Authenticate and confirm the server"
opencode mcp auth phonekit
opencode mcp list
```

Approve the workspace, actions and lines in Phonekit's browser flow. OpenCode handles the sign-in for the remote server. See [OpenCode's MCP guide](https://opencode.ai/docs/mcp-servers/) and [Phonekit's MCP reference](https://www.phonekit.io/docs/mcp).

### CLI

The CLI needs terminal access and Node.js 20.3 or newer.

```bash title="Connect the Phonekit CLI"
npx phonekit@latest docs agents
npx phonekit@latest login --wait 50
npx phonekit@latest number list
```

Approve the workspace and the numbers it may read in your browser. Exit code 8 means approval is still pending; run login again to resume. The skill uses MCP when it's connected and the CLI otherwise. Name the number for your project with the [quickstart](https://www.phonekit.io/docs/quickstart).

## Give it a task

**Add a Supabase phone sign-in test**

```text
Load the phonekit skill and read our Supabase Auth setup. Add a test that marks the assigned number, calls signInWithOtp through our configured environment, waits up to 120 seconds for the new code with the Phonekit SDK, then calls verifyOtp. Assert the signed-in user and session. Reuse our existing test-account setup, run the test and report the result without tokens or codes.
```

**What done looks like**

The sign-in request, the SDK receiving step, a verifyOtp assertion and a passing run. For browser coverage, add your app's final page assertion too.

The [Supabase guide](https://www.phonekit.io/docs/guides/supabase) has the provider calls. Give each parallel run its own number, as [one number per test](https://www.phonekit.io/learn/one-number-per-test) explains.

## Permissions

Allow OpenCode to load the Phonekit skill and run the commands the task needs under its tool policy. That permission covers OpenCode only; which numbers it can read is still decided when you approve the Phonekit connection.

## Questions

### Why doesn't OpenCode list the skill?

Check that the file is at .agents/skills/phonekit/SKILL.md, then check OpenCode's skill permissions. A hidden or denied skill is a discovery problem; a CLI approval failure is a separate one.

### Can I use the .opencode directory instead?

OpenCode reads that directory too. Keep one copy so you don't edit duplicates. The installer uses the shared .agents/skills directory.

### Does changing models change anything?

No. The CLI, SDK and the numbers a connection can read don't depend on the model. The agent still needs tools to run your tests.

### Which number type should I use?

Standard, a US local VoIP number, covers most tests of your own app. Use Mobile, a real SIM line on a mobile network, when a service you depend on only texts mobile numbers. No number is accepted by every service.

---

Source: https://www.phonekit.io/integrations/opencode
