Connect OpenCode to Grok
Set up in minutes
Choose where it runs
On your computer through your own OpenCode, or hosted in the cloud. The rest of setup adapts to your choice:
Pick what it can do in Grok
A preset of real Grok operations. Each one becomes a tool the agent can call, and it can't touch anything outside the list.
Connect Grok
One sign-in. The agent acts through your account, scoped to the operations you picked.
Add your personal MCP link
The last step mints a private MCP URL for this agent and walks you through exactly this, with your real link filled in. The page flips to Connected the moment your OpenCode first calls in. opencode mcp add only saves the config. OpenCode connects when it starts — run opencode, or restart a running one.
1. Run this in your terminal
2. Choose Remote and paste your server URL
3. Choose No when asked about OAuth authentication — the link itself is the key
<your-link> is your personal server URL — setup mints it for you.
Tools OpenCode gets
Grok
20 toolsRead the authenticated user's ID, team and zero data retention status.
List the models available to this key, including pricing metadata.
List chat and image-understanding model modalities and aliases.
Retrieve a model's information and pricing.
Generate a non-streaming chat completion from text messages.
Generate a stored text response, optionally continuing an existing response.
Retrieve a response created with storage enabled.
Permanently delete a stored response.
Read one page of a stored response's input items; use last_id as after.
Embed one or more texts, returning numeric vectors.
Generate images as URLs. Enable deferred to obtain a request ID to poll.
Poll one deferred image job; HTTP 202 means it is still pending.
Start text-to-video generation; poll the returned request_id separately.
Poll one video job; surface pending and failed jobs without retrying.
Count and inspect a model's tokens for text.
Read one team file page. A full page may have more; pass pagination_token.
Retrieve metadata for one team file.
Permanently delete a team file and its attachment availability.
Publish an unauthenticated URL for a file; anyone with it can read it.
Revoke the file's public URL while retaining its authenticated content.
About OpenCode
Frequently asked questions
More ways to connect
Open your OpenCode agent in one click.
NoClick runs OpenCode for you with Grok wired in as tools. Connect your account and run.