Skip to main content

Set up OpenCode for Kanera MCP

OpenCode connects to Kanera through the Model Context Protocol. It supports automatic OAuth discovery and dynamic client registration for remote MCP servers, so no pre-registered client or API key is required.

Add Kanera to your OpenCode configuration:

{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"kanera": {
"type": "remote",
"url": "https://mcp.kanera.app/mcp",
"enabled": true
}
}
}

OpenCode starts OAuth automatically when Kanera first needs authentication. You can also start the browser flow explicitly:

opencode mcp auth kanera

Sign in to Kanera, review the requested access, and choose Allow access. Run opencode mcp list to check the connection. If discovery or authentication fails, use opencode mcp debug kanera to inspect the flow.

See Connect an AI agent for scopes and disconnecting an agent.

Install the Kanera skill

The MCP connection gives OpenCode access to Kanera's tools. The optional Kanera agent skill teaches it to resolve names to stable IDs, read live state before reporting or changing work, distinguish completed work from creation activity, use idempotency keys, and handle permission or rate-limit failures safely.

Install the skill globally with the open Agent Skills installer:

npx -y skills add https://github.com/happendev/Kanera/tree/main/integrations/skills/kanera --yes --global

For a manual installation, download the complete kanera skill directory and place it in one of these locations:

  • ~/.agents/skills/kanera/ or ~/.config/opencode/skills/kanera/ for a personal skill available across projects.
  • .agents/skills/kanera/ or .opencode/skills/kanera/ in a repository to share the skill with that project.

OpenCode lists the skill to its agents and loads its full instructions when relevant. If you restrict tools or skills through OpenCode permissions, make sure the skill tool and the kanera_* MCP tools are not denied.

Connect with an API key

Use a static API key when OAuth is unavailable. Reference an environment variable instead of storing the key in the configuration:

{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"kanera": {
"type": "remote",
"url": "https://mcp.kanera.app/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:KANERA_API_KEY}"
}
}
}
}

Create a personal key in Profile settings -> API keys or a workspace key in Workspace settings -> API.