Cursor Delegate
# Grok Delegate
**Turn your coding agent into a council. Bring Composer and Grok into the conversation, then hand them the work.**
[](https://www.npmjs.com/package/grok-delegate-mcp)
[](https://www.npmjs.com/package/grok-delegate-mcp)
[](https://registry.modelcontextprotocol.io/v0.1/servers?search=grok-delegate&version=latest)
[](https://glama.ai/mcp/servers/andreilungeanu/grok-delegate-mcp)
[](https://nodejs.org)
[](LICENSE)
[](https://github.com/andreilungeanu/grok-delegate-mcp/actions/workflows/test.yml)
<img src="assets/logo-light.png" alt="Grok Delegate logo" width="105" align="left" hspace="15">
Grok Delegate is the MCP bridge to **the Grok Build CLI**. From Claude Code, ChatGPT/Codex, Copilot or any MCP client, your agent can ask Composer or Grok for a second opinion, put one question to several models at once, or hand Grok a plan to build, and get a structured result back from each call.
<br clear="left">

## ๐ง Get a second opinion
> Ask Grok what it thinks about moving the session store to SQLite.
Grok reads the repo and answers in `ask` mode, and your agent sets that answer beside its own. You see where the two disagree before you choose a direction.
Ask several at once, and your agent sends each the same brief in parallel, compares the answers, and checks the claims that matter:
> Ask Composer and Grok whether we should split this service, and tell me where they disagree.
With [Codex Delegate](https://github.com/andreilungeanu/codex-delegate-mcp) or [Antigravity Delegate](https://github.com/andreilungeanu/agy-delegate-mcp) installed too, the same prompt reaches GPT or Gemini models.
## ๐ ๏ธ Hand off the work
> Delegate to Grok: migrate src/api from callbacks to async/await and update the tests. Plan it first.
Your agent writes the brief, Grok edits the files, and your agent reads the diff and runs the tests before it reports back.
- ๐ **Plan, approve, build** โ `plan` mode returns Grok's plan; once you approve, the same session implements it.
- ๐ฌ **No stalled runs** โ when Grok needs a decision, it ends the turn and returns the question as a normal result. Your agent answers by resuming the same session.
- ๐งต **Resume, even on another model** โ follow up in the same session with `resumeSessionId`; `effectiveModel` tells you when a different model served the turn.

## Features
- ๐ฆ **Clean, named results** โ final answer and session id, plus the files the edit tools reported, and todo progress when work is left unfinished, returned as one compact JSON payload. Nothing to scrape.
- โณ **Runs in the background, with MCP Tasks** โ `delegate` serves the MCP Tasks extension (`io.modelcontextprotocol/tasks`), so a host that speaks it gets a task back once Grok has the prompt and the result when Grok finishes. In the main session of the interactive Claude Code CLI, you keep working and the result arrives as a task notification; calls from subagents wait for the result.
- ๐ผ๏ธ **Attach what prose can't point at** โ `contextFiles` sends screenshots, mockups and other files along with the brief.
- ๐ **Runs on Grok's usage pool** โ Grok models draw from your **Grok plan's weekly usage** ([plans and usage](https://docs.x.ai/x-subscription/usage-limits)), separate from your host's chat quota.
- ๐ค **Native plugins** โ install into Claude Code, ChatGPT/Codex, Google Antigravity, or GitHub Copilot CLI and just say *"ask Grok"* or *"delegate this to Grok"*. The shared skill teaches your agent to write the brief and review the result.
- ๐ฉบ **Self-diagnosing** โ a `doctor` tool that tells you exactly what's missing if setup isn't right.
- ๐ **Portable** โ plain stdio MCP, so it runs anywhere: VS Code, JetBrains, Windsurf, Visual Studio, OpenCode, Antigravity, and more.
`workspace` is the agent's working directory, not a limit, and the CLI narrows what `ask` and `plan` may do โ [Security](SECURITY.md) and the [delegate reference](skills/delegate/reference.md) spell out what the bridge enforces and what it reports back.

## Your agent and its peers
Each plugin works on its own, and they are built to work together. Install the ones your subscriptions cover, and the agent you already use can bring Gemini 4 Neon, Carbon or Hydrogen, GPT-6.2 Sol or Astra, and Grok 4.7 or Composer 2.5 into the same conversation as peers. One question goes to all of them in parallel, and your agent sets their answers beside its own.
> Ask Gemini Neon, Codex Sol and Grok 4.7 how they would restructure the auth module, then tell me where they agree.

- [Codex Delegate](https://github.com/andreilungeanu/codex-delegate-mcp) โ the OpenAI Codex CLI: GPT-6.2 Sol, GPT-6.2 Astra and the other Codex models
- **Grok Delegate** (this one) โ the Grok Build CLI: Grok 4.7, Composer 2.5
- [Antigravity Delegate](https://github.com/andreilungeanu/agy-delegate-mcp) โ Google Antigravity's CLI: Gemini 4 Neon, Carbon and Hydrogen
Model names are examples; each CLI offers what your account includes.
## Install
You need [Node.js 20+](https://nodejs.org/) and [Grok Build](https://docs.grok.com/build/whats-new), signed in (`grok login`).
### Claude Code
```shell
/plugin marketplace add andreilungeanu/grok-delegate-mcp
/plugin install grok-delegate@grok-delegate-mcp
```
Then just ask:
> Delegate to Grok: migrate src/api from callbacks to async/await and update the tests, then walk me through what changed.
That's the whole loop โ Claude writes the brief, Grok grinds through the files, Claude walks you through the diff.
### ChatGPT desktop / Codex
```shell
codex plugin marketplace add andreilungeanu/grok-delegate-mcp
codex plugin add grok-delegate@grok-delegate-mcp
```
### Google Antigravity
```shell
agy plugin install https://github.com/andreilungeanu/grok-delegate-mcp
```
Restart the Antigravity app to load it. If you added `grok-delegate` to `mcp_config.json` by hand, remove that entry.
Without the CLI, use the manual config under [Client-specific config locations](#client-specific-config-locations).
### GitHub Copilot CLI
```shell
copilot plugin marketplace add andreilungeanu/grok-delegate-mcp
copilot plugin install grok-delegate@grok-delegate-mcp
```
### Any other MCP client
```json
{
"mcpServers": {
"grok-delegate": {
"command": "npx",
"args": ["-y", "grok-delegate-mcp"]
}
}
}
```
### Client-specific config locations
<details>
<summary><strong>VS Code</strong> โ one-click install, or <code>.vscode/mcp.json</code></summary>
[](https://vscode.dev/redirect/mcp/install?name=grok-delegate&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22grok-delegate-mcp%22%5D%7D)
[](https://insiders.vscode.dev/redirect/mcp/install?name=grok-delegate&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22grok-delegate-mcp%22%5D%7D&quality=insiders)
Or add it manually:
```json
{
"servers": {
"grok-delegate": {
"type": "stdio",
"command": "npx",
"args": ["-y", "grok-delegate-mcp"]
}
}
}
```
Or run **Chat: Install Plugin From Source** with this repository's URL.
</details>
<details>
<summary><strong>JetBrains AI Assistant</strong> โ Settings โ Tools โ AI Assistant โ MCP</summary>
Under **Settings โ Tools โ AI Assistant โ Model Context Protocol (MCP)**, add a server with command `npx` and arguments `-y grok-delegate-mcp`.
</details>
<details>
<summary><strong>Windsurf</strong> โ <code>~/.codeium/windsurf/mcp_config.json</code></summary>
Same `mcpServers` block as the generic snippet above. Cascade caps you at 100 tools across all servers.
</details>
<details>
<summary><strong>Visual Studio 2022 / 2026</strong> โ <code>%USERPROFILE%\.mcp.json</code></summary>
Same `servers` + `type: "stdio"` shape as VS Code. Requires Visual Studio 2026, or 2022 17.14+. Note the top-level key is `servers`, not `mcpServers`. Visual Studio also discovers `.mcp.json` next to the solution, plus `.vscode/mcp.json`.
</details>
<details>
<summary><strong>OpenCode</strong> โ <code>~/.config/opencode/opencode.json</code> or project <code>opencode.json</code></summary>
OpenCode does **not** use `mcpServers`. Local servers go under `mcp`, with `type: "local"` and `command` as one array:
```json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"grok-delegate": {
"type": "local",
"command": ["npx", "-y", "grok-delegate-mcp"],
"enabled": true
}
}
}
```
</details>
<details>
<summary><strong>Google Antigravity</strong> (without the plugin) โ <code>~/.gemini/config/mcp_config.json</code> or workspace <code>.agents/mcp_config.json</code></summary>
```json
{
"mcpServers": {
"grok-delegate": {
"command": "npx",
"args": ["-y", "grok-delegate-mcp"],
"timeoutSeconds": 21660,
"tools": { "delegate": { "background": "always" } }
}
}
}
```
</details>
<details>
<summary><strong>Kiro</strong> โ <code>.kiro/settings/mcp.json</code> or <code>~/.kiro/settings/mcp.json</code></summary>
Same `mcpServers` block as the generic snippet above. Workspace file wins when both exist.
</details>
<details>
<summary><strong>Kilo Code</strong> โ <code>kilo.jsonc</code> (<code>mcp</code> key, not <code>mcpServers</code>)</summary>
Same shape as OpenCode: `type: "local"` and `command` as one array. In the VS Code extension: **Settings โ MCP โ Add Server โ Local (stdio)**. On Windows, if `npx` is not found, use command `cmd` with arguments `/c`, `npx`, `-y`, `grok-delegate-mcp`.
</details>
## License
MIT ยฉ [Andrei Lungeanu](https://github.com/andreilungeanu)
<sub>[Technical reference](TECHNICAL.md) ยท [Security](SECURITY.md) ยท [Privacy](PRIVACY.md) ยท [Terms](TERMS.md) ยท [Changelog](CHANGELOG.md)</sub>
TDQS
Scored across 3 tools
Each tool has a distinct purpose: delegate starts or resumes an external coding session, cancel stops an in-flight session, and doctor diagnoses the environment. There is no meaningful overlap between these actions, so an agent can select the right tool reliably.
The names delegate, cancel, and doctor are all concise single-word verbs/commands with a consistent style. They do not follow a verb_noun pattern, but there is no mixed naming convention or casing inconsistency.
Three tools are enough for the server's focused delegation purpose: one to start/resume work, one to cancel, and one to diagnose failures. Each tool earns its place, and there are no unnecessary additions.
The core delegation lifecycle is covered: start/resume via delegate, cancel via sessionId, and troubleshoot via doctor. A minor gap is the lack of a session listing or status-inspection tool beyond cancel outcomes, but most workflows can be handled with the existing surface.