grok-delegate
Local stdio MCP bridge that delegates coding work to the Grok CLI agent via isolated git worktrees and typed receipts. Provides MCP tools for interacting with the Grok CLI across stdio, WebSocket, and legacy transports.
README
grok-delegate (MCP)
Version 0.4.1 — Local stdio MCP bridge that delegates coding work to the host Grok CLI agent with isolated git worktrees, typed receipts, and three explicit backend transports.
Security one-liner: this repository must never contain OAuth tokens, API keys, or WebSocket secrets. Model auth is the local Grok CLI session (
grok login→ machine-local auth store). MCP config must only list paths and non-secret policy env vars.
Install guides
| Language | Guide |
|---|---|
| English | docs/install/en.md |
| Русский | docs/install/ru.md |
| 简体中文 | docs/install/zh-CN.md |
| Español | docs/install/es.md |
Also: SECURITY · CONTRIBUTING · ACP transports · Client setup examples
What it does
| Capability | Detail |
|---|---|
| MCP surface | 8 typed grok_agent_* tools + 8 legacy grok_delegate* aliases |
| Host transport | stdio JSON-RPC MCP (what Claude / Cursor / Codex spawn) |
| Agent backends | legacy headless · ACP stdio · ACP loopback WebSocket |
| Isolation | External git worktree on grok/* branch — no push / no merge |
| Evidence | Diffstat, expected artifacts, independent bridge-verifier tests |
| Fail-closed roots | GROK_DELEGATE_ALLOWED_ROOTS required; empty allowlist rejects work |
WebSocket note: MCP clients still connect over stdio. WebSocket is the
optional ACP channel between this bridge and a local grok agent serve daemon
(loopback + ephemeral secret only).
Prerequisites
- Python 3.10+
- Grok CLI installed and authenticated (
grok login) - git available on
PATH
Quick install
cd <REPO_PATH>
python -m pip install -e ".[test]"
Configure allowlisted project roots (fail-closed):
export GROK_DELEGATE_ALLOWED_ROOTS="<PROJECT_ROOT>"
export GROK_DELEGATE_LANES_PARENT="<LANES_PARENT>" # outside the repo
export GROK_DELEGATE_JOBS_DIR="<JOBS_DIR>" # optional durable jobs
Quick run
# stdio MCP server (default entry for desktop hosts)
grok-delegate
# or:
python -m grok_delegate.server
# operator checks (no host restart needed)
python -m grok_delegate --self-test
python -m pytest -q
Connect clients
Copy a template from examples/ and replace placeholders only
(<REPO_PATH>, <PROJECT_ROOT>, …). Never put GROK_AGENT_SECRET, OAuth
tokens, or API keys in these files.
| Client | How |
|---|---|
| Claude Desktop | Merge examples/claude_desktop.mcp.json into claude_desktop_config.json |
| Claude Code | Project or user .mcp.json |
| Cursor | .cursor/mcp.json or Cursor MCP settings |
| Codex CLI | examples/codex.cli.example.sh → codex mcp add |
| VS Code / Continue | Same stdio command/args/env pattern as Claude |
| ChatGPT | Web ChatGPT expects a remote HTTPS MCP connector. This package is local stdio. Use Claude/Cursor/Codex locally, or put a trusted TLS reverse-proxy in front of a remote MCP bridge without shipping Grok OAuth or agent secrets to the public internet. |
Full steps: docs/install/en.md.
Minimal Claude Desktop fragment
{
"mcpServers": {
"grok-delegate": {
"command": "python",
"args": ["-m", "grok_delegate.server"],
"cwd": "<REPO_PATH>",
"env": {
"GROK_DELEGATE_ALLOWED_ROOTS": "<PROJECT_ROOT>",
"GROK_DELEGATE_LANES_PARENT": "<LANES_PARENT>"
}
}
}
}
First verification
python -m grok_delegate --self-test→ PASS table- From the host: call
grok_agent_status - Prefer
grok_agent_consultbefore anyexecuteon a real repo - For write roles, use a temporary git repository until receipts look correct
Transports (backend)
| Value | Meaning | Fallback |
|---|---|---|
stdio (default / auto) |
ACP v1 over grok agent stdio |
none |
websocket |
ACP v1 over managed loopback grok agent serve |
none |
legacy |
Headless grok --single compatibility path |
none |
Details: docs/ACP-TRANSPORTS.md.
Security boundary
- No credentials in git, examples, or receipts
- Local Grok CLI session only — bridge does not read
auth.jsoninto logs - WebSocket: loopback only, process-local secret, redacted from logs
- Deny-by-default tool permissions; no
--always-approve/bypassPermissions - Write work in external worktrees; operator merges after review
See SECURITY.md.
Development
python -m pip install -e ".[test]"
python -m pytest -q
python -m compileall -q grok_delegate tests
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。