Connect opencode
opencode connects to khive over HTTP and signs in with OAuth. Its configuration names opencode's own published client details, so there is no key to copy.
You need a khive account (see the Quickstart). These steps were tested with opencode 1.19.5.
1. Add khive to opencode.json
Put this in opencode.json at your project's root:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"khive": {
"type": "remote",
"url": "https://khive.ai/v1/mcp",
"oauth": { "clientId": "https://opencode.ai/oauth/opencode/client.json" }
}
}
}The clientId is the address of opencode's published client details. khive reads them to learn which application is asking and where it may return, so there is no client ID or secret to register.
The oauth line is required. Without it, opencode tries to register a new client, which khive does not offer, and opencode mcp list reports:
Incompatible auth server: does not support dynamic client registration
2. Sign in to khive
opencode mcp auth khive
opencode opens khive's sign-in page in your browser, or prints the link after Authorize in your browser: for you to open, then waits. On the sign-in page, enter your email and click Send sign-in link. The email carries a link and a six-digit code. Enter the code on the Check your email page, so the sign-in finishes in the window opencode is waiting on.
If your account does not hold a plan yet, khive shows one Stripe checkout screen for the Plus plan before it continues. An account that has never held a plan starts with the Plus trial there.
3. Approve access
khive names the application asking for access and the host it returns to. Click Approve. opencode prints Done when it holds its token.
4. Check the connection
opencode mcp list
khive should be listed as connected:
khive connected (OAuth)
If it does not connect, opencode mcp debug khive shows what khive answered and the client id opencode sent.
5. See your usage
Calls from opencode count against your plan like calls from any other client. https://khive.ai/dashboard/usage shows Requests this month, Included usage (the share of your plan used this period) and Top verbs.
Disconnect
opencode mcp logout khive
This removes the credentials opencode stored for khive, and deleting the khive entry from opencode.json stops opencode from loading it. Neither ends khive's grant to opencode. To end it, sign in at https://auth.khive.ai/account, which lists your connected applications, and click Revoke access next to opencode. Its refresh token stops working at once; an access token it already holds expires within 15 minutes.
Questions: contact@khive.ai.