# FLONE with OpenCode

> Docs index: https://flone.ai/llms.txt · Edition: test period · Updated 2026-11-26
> Follow https://flone.ai/agents.md and the steps on https://api.flone.app/agents.md. This page lists what is
> specific to OpenCode.

## Use the flone tool (path A)

OpenCode has a shell (its `bash` tool) and can fetch pages, so it connects with the `flone` tool: download
`flone.py` from the address on https://api.flone.app/agents.md, check its SHA-256 against that page, then
`install`, `connect --name "OpenCode"`, `wait` and `call`. `FLONE` below is the path printed by
`python3 flone.py install`.

```sh
python3 FLONE call phone_context
python3 FLONE call phone_observe '{"screenshot": false}'
python3 FLONE tools
```

OpenCode has no sandbox of its own; which commands run without asking depends on the user's permission settings.
Every `flone.py` command needs network access to `api.flone.app`. While `wait` prints `pending`, run it again at
once and do not end your turn.

## As an MCP server: `flone.py mcp` (optional)

To keep FLONE as a tool, the user can add a local MCP server to `opencode.json`:

```json
{
  "mcp": {
    "flone": { "type": "local", "command": ["python3", "FLONE", "mcp"] }
  }
}
```

Replace `FLONE` with the absolute path printed by `install`. The configuration holds no token: `flone.py mcp` reads
the token file on every request. The tools (shown with a `flone_` prefix, such as `flone_phone_context`) appear in a
new session; keep using `call` until then.

## Finishing

When the user's whole task is done, finish once with
`python3 FLONE call phone_finish '{"outcome": "succeeded", "summary": "<one sentence>"}'` (`outcome` is
`succeeded` or `failed`). On a shared computer, then run `python3 FLONE disconnect`.

## Notes

- For a run without a person at the keyboard (`opencode run`), close its input (for example `< /dev/null`);
  otherwise it waits for more input.
- Starting OpenCode inside a very large git repository can take a long time. A small working directory is enough.

Tested in the test period (2026-11-26, Linux): OpenCode 1.19.6 read flone.ai/agents.md from a cold start,
downloaded and checked `flone.py`, connected, opened Settings, went back home, finished and disconnected (1 of 1
run). Registered as a stdio MCP server, it called `phone_context` correctly (1 of 1).
