Skip to main content
Connect opencode to Anchor’s hosted MCP server. opencode can then run web tasks in plain English, open cloud browser sessions and work inside accounts you have signed in to. Tested with opencode 1.19.6.

Quick setup

Add the server from the terminal:
Then sign in:
opencode prints a sign-in link and opens it in your browser. Choose Allow access on the Anchor page, and the terminal confirms:
You are now connected to your default Anchor project. Check the connection:

Use an API key instead

For CI, a remote machine, or a project other than your default, send an API key instead of signing in. Create one at API Keys, export it as ANCHORBROWSER_API_KEY, and add the server with a header:
Keep the single quotes so your shell passes {env:ANCHORBROWSER_API_KEY} through unchanged. opencode reads the variable each time it connects, so the key itself is never written to the config file.

Config file

The commands above write to ~/.config/opencode/opencode.json (opencode.jsonc on some installs). This is what the API key setup looks like there:
For sign-in, leave out the headers block. To share the server with a repository, put the same mcp block in an opencode.json at the project root.

Try it

Troubleshooting

  • Sign-in problems: run opencode mcp debug anchor. It shows the auth status and whether the server answers.
  • Sign-in on a remote machine: there is no browser to open. Use the API key setup.
  • 401 with an API key: confirm ANCHORBROWSER_API_KEY is exported in the shell that starts opencode.
  • failed in opencode mcp list: check that the URL is exactly https://api.anchorbrowser.io/v1/mcp.

Next steps