OpenCode Integration

Updated today

โ€ข

1 min read

Connect Perfect Wiki to OpenCode, and the agent reads your team's docs from the terminal and keeps them up to date.

How to connect

  1. Open ~/.config/opencode/opencode.json (or opencode.json in your project) and add the perfect-wiki entry. Prefer a wizard? Run opencode mcp add.
    {
      "mcp": {
        "perfect-wiki": {
          "type": "remote",
          "url": "https://api.perfectwiki.xyz/mcp"
        }
      }
    }
  2. Run opencode mcp auth perfect-wiki, or just start OpenCode, which begins the sign-in when the server asks for it.
  3. Sign in to Perfect Wiki in the browser, choose the knowledge bases and the access level, then click Allow access.
  4. Ask "What does our wiki say about feature flag cleanup?"

With an API token

{
  "mcp": {
    "perfect-wiki": {
      "type": "remote",
      "url": "https://api.perfectwiki.xyz/mcp",
      "enabled": true,
      "oauth": false,
      "headers": { "Authorization": "Bearer {env:PERFECT_WIKI_TOKEN}" }
    }
  }
}

Set "oauth": false so OpenCode doesn't try to sign in, and export PERFECT_WIKI_TOKEN in your shell. The token covers one knowledge base and has read & write access.

Tip: OpenCode can also move your old wiki or a docs folder into Perfect Wiki: ๐Ÿค– Import with an AI agent (ChatGPT, Claude, Codexโ€ฆ)

More: ๐Ÿ”Œ Perfect Wiki MCP Server ยท OpenCode MCP docs

Was this page helpful?