codex-grok-mcp 0.2.0-beta.4 → 0.2.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +25 -29
- package/README.md +156 -148
- package/RELEASING.md +127 -0
- package/SECURITY.md +4 -2
- package/dist/bridge-companion.d.ts +6 -1
- package/dist/bridge-companion.js +166 -19
- package/dist/bridge-companion.js.map +1 -1
- package/dist/bridge-lifecycle.d.ts +44 -0
- package/dist/bridge-lifecycle.js +951 -0
- package/dist/bridge-lifecycle.js.map +1 -0
- package/dist/bridge-pairing.d.ts +5 -0
- package/dist/bridge-pairing.js +46 -4
- package/dist/bridge-pairing.js.map +1 -1
- package/dist/bridge-runtime.d.ts +30 -3
- package/dist/bridge-runtime.js +226 -19
- package/dist/bridge-runtime.js.map +1 -1
- package/dist/grok-bot-gateway.js +8 -2
- package/dist/grok-bot-gateway.js.map +1 -1
- package/dist/grok-cli.d.ts +5 -5
- package/dist/grok-cli.js +10 -11
- package/dist/grok-cli.js.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/relay-transport.js +13 -5
- package/dist/relay-transport.js.map +1 -1
- package/dist/schema.d.ts +5 -0
- package/dist/schema.js +3 -1
- package/dist/schema.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/relay/src/index.ts +11 -3
- package/relay/test/relay.test.ts +16 -0
- package/plugins/codex-grok-mcp/assets/icon.png +0 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -4,64 +4,60 @@ Thanks for helping keep this bridge small, safe, and dependable.
|
|
|
4
4
|
|
|
5
5
|
## Before opening a change
|
|
6
6
|
|
|
7
|
-
- Use
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- Never
|
|
7
|
+
- Use the [bug report form](https://github.com/Fato07/codex-grok-mcp/issues/new?template=bug-report.yml) for reproducible defects.
|
|
8
|
+
- Open a [feature request](https://github.com/Fato07/codex-grok-mcp/issues/new?template=feature-request.yml) before adding a tool, adapter, dependency, authentication path, or supported platform.
|
|
9
|
+
- Keep `grok_ask` isolated from persistent Bot support.
|
|
10
|
+
- Never commit credentials, authentication files, private prompts, responses, transcripts, or unredacted logs.
|
|
11
|
+
- Never scrape Grok Bot state, decrypt descriptors, read Keychain, or infer gateway credentials.
|
|
11
12
|
|
|
12
13
|
## Local setup
|
|
13
14
|
|
|
14
15
|
```bash
|
|
15
16
|
npm ci
|
|
16
|
-
npm
|
|
17
|
+
npm ci --prefix relay
|
|
17
18
|
npm run test:all
|
|
18
|
-
npm run build
|
|
19
|
-
npm run doctor
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
`npm run doctor` is optional and requires a local Grok CLI login. It checks setup without sending a model request. Live tests must use your own account and data you are allowed to share; automated tests must use mocks.
|
|
23
22
|
|
|
24
23
|
## Pull requests
|
|
25
24
|
|
|
26
25
|
Keep pull requests focused. Include:
|
|
27
26
|
|
|
28
|
-
- the user-visible problem
|
|
29
|
-
- the smallest
|
|
30
|
-
- one
|
|
31
|
-
- compatibility
|
|
32
|
-
- documentation
|
|
33
|
-
-
|
|
27
|
+
- the user-visible problem;
|
|
28
|
+
- the smallest complete fix;
|
|
29
|
+
- one regression test for non-trivial behavior;
|
|
30
|
+
- any compatibility or security-boundary change;
|
|
31
|
+
- documentation updates when commands or behavior change;
|
|
32
|
+
- attribution for adapted code.
|
|
34
33
|
|
|
35
34
|
Before requesting review, run:
|
|
36
35
|
|
|
37
36
|
```bash
|
|
38
|
-
npm run typecheck
|
|
39
37
|
npm run test:all
|
|
40
|
-
|
|
38
|
+
npm audit --omit=dev
|
|
39
|
+
npm audit --prefix relay
|
|
40
|
+
npm pack --dry-run
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Do not
|
|
43
|
+
Do not add postinstall scripts or telemetry. Version changes belong in release work, not ordinary feature pull requests.
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
For a stable release candidate, use the single maintainer checklist in [RELEASING.md](RELEASING.md).
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
## Compatibility claims
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Mocks are not platform proof. A new supported environment needs a redacted live result containing OS, architecture, Node, Codex, Grok CLI, selected model, and a successful response. Do not include response content.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
## Adapters and Bot tools
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
- an identified maintenance owner;
|
|
55
|
-
- a separate explicit configuration path;
|
|
56
|
-
- tests and threat-boundary documentation;
|
|
57
|
-
- no scraping, Keychain extraction, internal gateway credentials, or silent fallback.
|
|
53
|
+
New adapters need a documented upstream contract, operator-authorized credentials or pairing, a maintenance owner, tests, and a separate opt-in configuration path.
|
|
58
54
|
|
|
59
|
-
|
|
55
|
+
For persistent Bot changes, preserve exact-ID and non-group checks, bounded sanitized reads, explicit no-correlation and no-completion claims, and no automatic write retries. Bulk writes must keep the roster fingerprint, exact ordered IDs, and native confirmation. Ambiguous writes remain `outcome_unknown`; cancelled remaining recipients stay `not_attempted`.
|
|
60
56
|
|
|
61
|
-
|
|
57
|
+
Keep the legacy URL/token adapter out of the default plugin environment. Use mock gateways and relays in tests.
|
|
62
58
|
|
|
63
59
|
## Governance and license
|
|
64
60
|
|
|
65
61
|
Fato07 is the initial maintainer. Maintainer approval and passing checks are required to merge. There is no CLA or DCO at this stage.
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
Contributions are licensed under the repository's MIT License.
|
package/README.md
CHANGED
|
@@ -7,251 +7,258 @@
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://fato07.github.io/codex-grok-mcp/">Website</a> ·
|
|
9
9
|
<a href="https://www.npmjs.com/package/codex-grok-mcp">npm</a> ·
|
|
10
|
-
<a href="https://github.com/Fato07/codex-grok-mcp/releases/tag/v0.2.0-beta.
|
|
10
|
+
<a href="https://github.com/Fato07/codex-grok-mcp/releases/tag/v0.2.0-beta.6">v0.2.0-beta.6</a>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
|
-
An unofficial, local-first
|
|
13
|
+
An unofficial, local-first bridge that lets Codex ask Grok once or collaborate with named Grok Bots already running inside the Grok Bot app.
|
|
14
14
|
|
|
15
15
|
> [!IMPORTANT]
|
|
16
|
-
>
|
|
16
|
+
> `grok_ask` sends your prompt to xAI and consumes allowance from the signed-in Grok account. Persistent Bot reads may contain sensitive, untrusted text. Bot messages are external writes and are never retried automatically. This project is not affiliated with or endorsed by OpenAI or xAI.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
## Status
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
The default connector exposes `grok_ask` plus the read-only `grok_bridge_status`. The ask tool pins a Grok model, runs one turn without subagents, and always disables Grok web search. Status returns only local mode/version metadata until the bridge is paired.
|
|
29
|
-
|
|
30
|
-
`grok_ask` talks to **Grok CLI**, not a persistent named **Grok Bot**. It cannot enter a Bot conversation, use Bot memory, read Bot transcripts, or control the Grok Bot desktop app.
|
|
20
|
+
| Capability | Current status |
|
|
21
|
+
|---|---|
|
|
22
|
+
| Isolated Grok CLI call | Public beta; live-tested on macOS |
|
|
23
|
+
| Persistent Grok Bot collaboration: list, read, wait, and exact-ID send | Experimental; live operator smoke test passed |
|
|
24
|
+
| Companion lifecycle | Managed beta candidate; Linux CI passed, live Grok Bot VM validation pending |
|
|
25
|
+
| Linux isolated CLI path | Unverified |
|
|
26
|
+
| Windows, WSL, and Codex cloud | Unsupported or unverified |
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
The supported public beta is the exact npm package `codex-grok-mcp@0.2.0-beta.6` and its immutable GitHub prerelease.
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
## Quick start
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
You need:
|
|
37
33
|
|
|
38
|
-
|
|
34
|
+
- macOS;
|
|
35
|
+
- Node.js 20.19.2 or newer;
|
|
36
|
+
- Codex CLI or desktop.
|
|
39
37
|
|
|
40
|
-
-
|
|
41
|
-
- Node.js 20.19.2 or newer.
|
|
42
|
-
- Codex CLI/desktop.
|
|
43
|
-
- Grok CLI installed and signed in. Confirm with `grok --version` and `grok models`.
|
|
38
|
+
For one-off `grok_ask` calls, install and sign in to Grok CLI (`grok --version` and `grok models`). Persistent Bot collaboration instead uses Grok Bot and the companion setup below.
|
|
44
39
|
|
|
45
|
-
Install the
|
|
40
|
+
Install the immutable marketplace release and plugin:
|
|
46
41
|
|
|
47
42
|
```bash
|
|
48
|
-
codex plugin marketplace add Fato07/codex-grok-mcp --ref v0.2.0-beta.
|
|
43
|
+
codex plugin marketplace add Fato07/codex-grok-mcp --ref v0.2.0-beta.6
|
|
49
44
|
codex plugin add codex-grok-mcp@codex-grok
|
|
50
45
|
```
|
|
51
46
|
|
|
52
|
-
Start a new Codex task
|
|
47
|
+
Start a new Codex task, then try:
|
|
53
48
|
|
|
54
49
|
```text
|
|
55
50
|
Ask Grok to challenge this architecture and return the three strongest objections.
|
|
56
51
|
```
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
That uses the one-off path. To work with Bots already running in Grok Bot, complete [the persistent Bot setup](#connect-codex-to-grok-bots).
|
|
59
54
|
|
|
60
|
-
|
|
55
|
+
The plugin runs only `codex-grok-mcp@0.2.0-beta.6` through `npx`. It does not change Grok authentication.
|
|
61
56
|
|
|
62
|
-
|
|
57
|
+
For direct MCP setup without the plugin wrapper:
|
|
63
58
|
|
|
64
59
|
```bash
|
|
65
|
-
codex mcp add grok -- npx --yes --package=codex-grok-mcp@0.2.0-beta.
|
|
60
|
+
codex mcp add grok -- npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-mcp
|
|
66
61
|
```
|
|
67
62
|
|
|
68
|
-
Start a new Codex task after adding the server
|
|
63
|
+
Start a new Codex task after adding the server.
|
|
69
64
|
|
|
70
|
-
##
|
|
71
|
-
|
|
72
|
-
Run after the local package installation:
|
|
65
|
+
## Check setup
|
|
73
66
|
|
|
74
67
|
```bash
|
|
75
|
-
npx --yes --package=codex-grok-mcp@0.2.0-beta.
|
|
68
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-mcp --doctor
|
|
76
69
|
```
|
|
77
70
|
|
|
78
|
-
Doctor checks local
|
|
79
|
-
|
|
80
|
-
## Pair persistent Grok Bots
|
|
71
|
+
Doctor checks the local executable, login, and selected model without sending a prompt. It must not print authentication material.
|
|
81
72
|
|
|
82
|
-
|
|
73
|
+
## Two ways to use it
|
|
83
74
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
npm ci
|
|
89
|
-
RELAY_TOKEN="$(node -e 'process.stdout.write(require("node:crypto").randomBytes(32).toString("base64url"))')"
|
|
90
|
-
printf 'RELAY_ACCESS_TOKEN=%s\n' "$RELAY_TOKEN" | npx wrangler deploy --secrets-file /dev/stdin
|
|
91
|
-
|
|
92
|
-
cd ..
|
|
93
|
-
CODEX_GROK_RELAY_TOKEN="$RELAY_TOKEN" npx --yes --package=codex-grok-mcp@0.2.0-beta.4 -- codex-grok-mcp pair --relay-url wss://YOUR-WORKER.workers.dev/v1/connect
|
|
94
|
-
unset RELAY_TOKEN
|
|
75
|
+
```text
|
|
76
|
+
Codex -> local MCP server -> isolated Grok CLI -> xAI
|
|
77
|
+
-> encrypted relay <- companion in Grok Bot VM
|
|
78
|
+
-> loopback gateway -> named Bots
|
|
95
79
|
```
|
|
96
80
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npx --yes --package=codex-grok-mcp@0.2.0-beta.4 -- codex-grok-bridge probe
|
|
101
|
-
npx --yes --package=codex-grok-mcp@0.2.0-beta.4 -- codex-grok-bridge connect
|
|
102
|
-
```
|
|
81
|
+
`grok_ask` starts one constrained Grok CLI turn with a private temporary home. It cannot enter a persistent Bot conversation, use Bot memory, read files, run commands, use subagents, or search the web.
|
|
103
82
|
|
|
104
|
-
|
|
83
|
+
Each call may select one supported model. Omit `model` to use `GROK_MCP_MODEL`; provider, base URL, endpoint, and persistent Bot model settings are not accepted.
|
|
105
84
|
|
|
106
|
-
|
|
107
|
-
npx --yes --package=codex-grok-mcp@0.2.0-beta.4 -- codex-grok-bridge probe
|
|
108
|
-
npx --yes --package=codex-grok-mcp@0.2.0-beta.4 -- codex-grok-bridge run
|
|
109
|
-
```
|
|
85
|
+
The persistent path is the collaborative mode. Codex can list named non-group Bots running inside Grok Bot, inspect one, send it a task once, wait for its activity state, and read its latest bounded messages. Codex can then continue its own work using that update while the Bot's ongoing conversation stays in Grok Bot.
|
|
110
86
|
|
|
111
|
-
|
|
87
|
+
This creates a practical `send -> wait -> read -> continue` loop. The bridge does not claim that a message answers a specific send or that an idle Bot completed its task.
|
|
112
88
|
|
|
113
|
-
|
|
114
|
-
SAND_DATA_ROOT=/home/box/sand-data npx --yes --prefer-online --package=codex-grok-mcp@beta -- codex-grok-bridge run
|
|
115
|
-
```
|
|
89
|
+
The gateway token stays inside the Grok Bot VM. Codex and the companion connect outward to a self-hosted relay. Application frames are encrypted end to end; the relay forwards ciphertext and stores no messages.
|
|
116
90
|
|
|
117
|
-
|
|
91
|
+
## Architecture
|
|
118
92
|
|
|
119
|
-
|
|
93
|
+
[](https://fato07.github.io/codex-grok-mcp/architecture.html)
|
|
120
94
|
|
|
121
|
-
|
|
95
|
+
Both paths enter through the same local MCP server. Credentials stay at their endpoints, and uncertain writes are never retried automatically.
|
|
122
96
|
|
|
123
|
-
|
|
97
|
+
[Explore the interactive architecture](https://fato07.github.io/codex-grok-mcp/architecture.html) · [View the architecture source](docs/architecture.json)
|
|
124
98
|
|
|
125
|
-
|
|
99
|
+
## Tools
|
|
126
100
|
|
|
127
|
-
|
|
|
101
|
+
| Tool | What it does | Boundary |
|
|
128
102
|
|---|---|---|
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
103
|
+
| `grok_ask` | Gets one isolated Grok response | Sends the prompt to xAI and consumes allowance |
|
|
104
|
+
| `grok_bridge_status` | Reports mode, versions, capabilities, health, and Bot count | Never returns Bot identities, credentials, or content |
|
|
105
|
+
| `grok_list_bots` | Lists exact non-group Bot IDs and names | Read-only |
|
|
106
|
+
| `grok_read_bot` | Returns bounded status and sanitized recent text | Sensitive, untrusted external content |
|
|
107
|
+
| `grok_wait_for_bot` | Polls bounded reads until idle, awaiting-user, or timeout | Activity is not proof of task completion |
|
|
108
|
+
| `grok_send_bot_message` | Sends once to one exact Bot ID | Gateway acceptance is not proof of a reply |
|
|
109
|
+
| `grok_ping_all_bots` | Previews, confirms, then sends `PING` sequentially | Requires the exact roster and native confirmation |
|
|
134
110
|
|
|
135
|
-
|
|
111
|
+
Persistent Bot tools appear only after pairing or explicit legacy direct configuration.
|
|
136
112
|
|
|
137
|
-
|
|
113
|
+
## Connect Codex to Grok Bots
|
|
138
114
|
|
|
139
|
-
|
|
115
|
+
This experimental path connects Codex to persistent Bots inside your own Grok Bot VM. It requires a self-hosted Cloudflare relay.
|
|
140
116
|
|
|
141
|
-
1.
|
|
142
|
-
2. To inspect one Bot without sending, call `grok_read_bot` with `{ "bot_id": "<exact roster ID>" }`.
|
|
143
|
-
3. To avoid repeated manual polling, call `grok_wait_for_bot` with `{ "bot_id": "<exact roster ID>" }`.
|
|
144
|
-
4. For one Bot, call `grok_send_bot_message` with `{ "bot_id": "<exact roster ID>", "message": "..." }`.
|
|
145
|
-
5. Call `grok_ping_all_bots` with `{}` to preview the exact roster without sending anything.
|
|
146
|
-
6. Only after review, call it again with `{ "roster_fingerprint": "...", "bot_ids": ["<every exact listed ID>"], "confirmation": "PING_ALL" }`.
|
|
147
|
-
7. Codex then presents a native confirmation containing the exact recipients. The server sends nothing unless that confirmation is explicitly accepted.
|
|
117
|
+
### 1. Deploy the relay
|
|
148
118
|
|
|
149
|
-
|
|
119
|
+
```bash
|
|
120
|
+
cd relay
|
|
121
|
+
npm ci
|
|
122
|
+
RELAY_TOKEN="$(node -e 'process.stdout.write(require("node:crypto").randomBytes(32).toString("base64url"))')"
|
|
123
|
+
printf 'RELAY_ACCESS_TOKEN=%s\n' "$RELAY_TOKEN" | npx wrangler deploy --secrets-file /dev/stdin
|
|
124
|
+
```
|
|
150
125
|
|
|
151
|
-
|
|
126
|
+
The relay is intended for one operator, not as a shared public service. Keep the token out of files, URLs, logs, issues, and prompts.
|
|
152
127
|
|
|
153
|
-
|
|
128
|
+
### 2. Pair Codex
|
|
154
129
|
|
|
155
|
-
|
|
130
|
+
From the repository root on the Mac:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
CODEX_GROK_RELAY_TOKEN="$RELAY_TOKEN" \
|
|
134
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- \
|
|
135
|
+
codex-grok-mcp pair --relay-url wss://YOUR-WORKER.workers.dev/v1/connect
|
|
136
|
+
unset RELAY_TOKEN
|
|
137
|
+
```
|
|
156
138
|
|
|
157
|
-
The
|
|
139
|
+
The command prints a private pairing code only in the interactive terminal.
|
|
158
140
|
|
|
159
|
-
|
|
141
|
+
### 3. Start the VM companion
|
|
160
142
|
|
|
161
|
-
|
|
143
|
+
In **Grok Bot's Computer** terminal, not in a Bot chat, run:
|
|
162
144
|
|
|
163
|
-
|
|
145
|
+
```bash
|
|
146
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-bridge probe
|
|
147
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-bridge connect
|
|
148
|
+
```
|
|
164
149
|
|
|
165
|
-
|
|
150
|
+
Paste the pairing code into the no-echo prompt. Keep the terminal running while using Bot tools.
|
|
166
151
|
|
|
167
|
-
|
|
152
|
+
### Update or roll back
|
|
168
153
|
|
|
169
|
-
|
|
154
|
+
Stop the foreground companion with `Ctrl-C`, then run the chosen exact version:
|
|
170
155
|
|
|
171
|
-
|
|
156
|
+
```bash
|
|
157
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-bridge probe
|
|
158
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-bridge run
|
|
159
|
+
```
|
|
172
160
|
|
|
173
|
-
|
|
161
|
+
For automatic beta updates on each restart, with the reproducibility tradeoff made explicit:
|
|
174
162
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
| Windows / WSL | Unverified |
|
|
180
|
-
| Codex cloud | Unsupported; the connector needs a local Grok executable and login |
|
|
181
|
-
| Grok Bot VM gateway discovery and roster probe | Verified metadata-only on Node.js 20.19.2 |
|
|
182
|
-
| Paired bounded Bot reads | Experimental; live operator smoke test passed on the current private beta |
|
|
183
|
-
| Paired exact-ID Bot messaging | Experimental; gateway acceptance and later bounded transcript observation passed in a live operator smoke test |
|
|
184
|
-
| Background companion lifecycle | Unsupported; foreground operation only |
|
|
163
|
+
```bash
|
|
164
|
+
SAND_DATA_ROOT=/home/box/sand-data \
|
|
165
|
+
npx --yes --prefer-online --package=codex-grok-mcp@beta -- codex-grok-bridge run
|
|
166
|
+
```
|
|
185
167
|
|
|
186
|
-
|
|
168
|
+
This mutable command never edits pairing state or updates a running process. Prefer exact versions for audited or unattended environments. Roll back by stopping the companion and running a previously verified version.
|
|
187
169
|
|
|
188
|
-
|
|
170
|
+
### Managed lifecycle beta
|
|
189
171
|
|
|
190
|
-
|
|
172
|
+
`0.2.0-beta.6` introduces managed lifecycle commands. Linux CI covers the detached process path, while public support remains pending the redacted live Grok Bot VM gate.
|
|
191
173
|
|
|
192
|
-
|
|
174
|
+
After pairing, stop the old foreground companion once. Then install and start an exact lifecycle-capable release:
|
|
193
175
|
|
|
194
176
|
```bash
|
|
195
|
-
|
|
177
|
+
VERSION=<exact-version>
|
|
178
|
+
npx --yes --package "codex-grok-mcp@${VERSION}" -- codex-grok-bridge install
|
|
196
179
|
```
|
|
197
180
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
Run:
|
|
181
|
+
`status`, `start`, `stop`, and `ensure` are idempotent. `restart` intentionally performs a fresh cycle:
|
|
201
182
|
|
|
202
183
|
```bash
|
|
203
|
-
grok --
|
|
204
|
-
grok
|
|
184
|
+
npx --yes --package "codex-grok-mcp@${VERSION}" -- codex-grok-bridge status
|
|
185
|
+
npx --yes --package "codex-grok-mcp@${VERSION}" -- codex-grok-bridge start
|
|
186
|
+
npx --yes --package "codex-grok-mcp@${VERSION}" -- codex-grok-bridge stop
|
|
187
|
+
npx --yes --package "codex-grok-mcp@${VERSION}" -- codex-grok-bridge restart
|
|
188
|
+
npx --yes --package "codex-grok-mcp@${VERSION}" -- codex-grok-bridge ensure
|
|
205
189
|
```
|
|
206
190
|
|
|
207
|
-
|
|
191
|
+
An exact update stages and checks the replacement before the healthy process stops. The prior exact release stays available for one retry-safe rollback:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
NEXT_VERSION=<new-exact-version>
|
|
195
|
+
npx --yes --package "codex-grok-mcp@${NEXT_VERSION}" -- codex-grok-bridge update
|
|
196
|
+
npx --yes --package "codex-grok-mcp@${NEXT_VERSION}" -- codex-grok-bridge rollback
|
|
197
|
+
```
|
|
208
198
|
|
|
209
|
-
|
|
199
|
+
The rollback operation uses the retained release, and a repeated rollback is a no-op. Pairing is read and revalidated, never rewritten. For VM resume recovery, a Grok Bot routine may run the exact pinned `ensure` command. Routine creation remains an explicit operator action.
|
|
210
200
|
|
|
211
|
-
|
|
201
|
+
To opt into the mutable beta channel for one update, make the channel visible in that command:
|
|
212
202
|
|
|
213
|
-
|
|
203
|
+
```bash
|
|
204
|
+
npx --yes --prefer-online --package=codex-grok-mcp@beta -- codex-grok-bridge update
|
|
205
|
+
```
|
|
214
206
|
|
|
215
|
-
|
|
207
|
+
The resolved release is stored as an exact version. Later `start`, `restart`, `ensure`, and `rollback` operations do not resolve a mutable channel.
|
|
216
208
|
|
|
217
|
-
|
|
209
|
+
## Collaborating safely with persistent Bots
|
|
218
210
|
|
|
219
|
-
|
|
211
|
+
1. Call `grok_bridge_status`, then use `grok_list_bots` to choose one exact Bot ID.
|
|
212
|
+
2. Use `grok_read_bot` or `grok_wait_for_bot` for read-only inspection.
|
|
213
|
+
3. Use `grok_send_bot_message` once for one exact target.
|
|
214
|
+
4. For all-Bot `PING`, preview the roster and review the native confirmation before accepting it.
|
|
220
215
|
|
|
221
|
-
|
|
216
|
+
Reads return sanitized text only. Attachments and other non-text transcript entries are omitted. Reads do not prove that a message answered a particular send or that a task finished. A successful send receipt means only that the gateway accepted the request. Timeouts and interrupted sends remain `outcome_unknown`; do not retry them automatically.
|
|
222
217
|
|
|
223
|
-
|
|
218
|
+
## Configuration
|
|
224
219
|
|
|
225
|
-
|
|
220
|
+
| Variable | Default | Rule |
|
|
221
|
+
|---|---|---|
|
|
222
|
+
| `GROK_MCP_BIN` | `grok` | Override with an absolute path |
|
|
223
|
+
| `GROK_MCP_MODEL` | `grok-4.6` | `grok-4.6` or `grok-4.5` |
|
|
224
|
+
| `GROK_MCP_TIMEOUT_MS` | `180000` | Integer from `5000` to `600000` |
|
|
225
|
+
| `GROK_MCP_AUTH_PATH` | `~/.grok/auth.json` | Operator-owned auth file |
|
|
226
|
+
| `CODEX_GROK_RELAY_TOKEN` | none | Required only by the local `pair` command |
|
|
226
227
|
|
|
227
|
-
|
|
228
|
+
The plugin passes only these connector options. Pairing is stored in a private mode-`0600` local file and is never accepted as MCP tool input.
|
|
228
229
|
|
|
229
|
-
|
|
230
|
+
## Troubleshooting
|
|
230
231
|
|
|
231
|
-
|
|
232
|
+
- **Tool missing:** confirm the `codex-grok` marketplace and plugin are installed, then start a new Codex task. For direct setup, inspect `codex mcp list`.
|
|
233
|
+
- **CLI missing or signed out:** run `grok --version`, `grok models`, and the pinned doctor command. Complete normal Grok login outside Codex.
|
|
234
|
+
- **`UPGRADE_REQUIRED`:** stop and restart the VM companion with the same package version as the connector.
|
|
235
|
+
- **`DATA_ROOT_SYMLINK`:** set `SAND_DATA_ROOT` to the real Grok Bot data directory, not a symlink. The companion rejects symlinked descriptor parents.
|
|
236
|
+
- **`companion_lease_stale`:** a lifecycle-capable managed install can run the exact pinned `ensure` command, which clears only a revalidated dead managed lease. For a foreground install, verify the recorded PID is gone before removing only the adjacent `bridge.json.lock`.
|
|
237
|
+
- **Uncertain send:** inspect the Bot before considering any new action. A retry may duplicate a message.
|
|
232
238
|
|
|
233
|
-
|
|
239
|
+
When reporting a bug, include redacted OS, architecture, Node, Codex, Grok CLI, and connector versions. Never attach authentication files, pairing codes, gateway/relay tokens, prompts, responses, transcripts, or private paths.
|
|
234
240
|
|
|
235
241
|
## Uninstall
|
|
236
242
|
|
|
237
|
-
|
|
243
|
+
1. Stop the VM companion. Press `Ctrl-C` for a foreground process. For a managed beta.6 install, run:
|
|
238
244
|
|
|
239
|
-
```bash
|
|
240
|
-
|
|
241
|
-
```
|
|
245
|
+
```bash
|
|
246
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-bridge stop
|
|
247
|
+
```
|
|
242
248
|
|
|
243
|
-
|
|
249
|
+
2. In the VM terminal, remove its pairing:
|
|
244
250
|
|
|
245
|
-
```bash
|
|
246
|
-
codex
|
|
247
|
-
```
|
|
251
|
+
```bash
|
|
252
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-bridge unpair
|
|
253
|
+
```
|
|
248
254
|
|
|
249
|
-
|
|
255
|
+
3. On the Mac, remove the local pairing:
|
|
250
256
|
|
|
251
|
-
```bash
|
|
252
|
-
npx --yes --package=codex-grok-mcp@0.2.0-beta.
|
|
253
|
-
|
|
254
|
-
|
|
257
|
+
```bash
|
|
258
|
+
npx --yes --package=codex-grok-mcp@0.2.0-beta.6 -- codex-grok-mcp unpair
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
4. Uninstall **Codex Grok MCP** in Codex. If configured directly, run `codex mcp remove grok`. Then remove the marketplace with `codex plugin marketplace remove codex-grok`.
|
|
255
262
|
|
|
256
263
|
Uninstalling does not change or delete Grok CLI authentication or account data.
|
|
257
264
|
|
|
@@ -260,12 +267,13 @@ Uninstalling does not change or delete Grok CLI authentication or account data.
|
|
|
260
267
|
```bash
|
|
261
268
|
npm ci
|
|
262
269
|
npm ci --prefix relay
|
|
263
|
-
npm run typecheck
|
|
264
270
|
npm run test:all
|
|
271
|
+
npm audit --omit=dev
|
|
272
|
+
npm audit --prefix relay
|
|
265
273
|
```
|
|
266
274
|
|
|
267
275
|
See [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md) before opening a change.
|
|
268
276
|
|
|
269
277
|
## License and attribution
|
|
270
278
|
|
|
271
|
-
MIT. The process-runner design was informed by the MIT-licensed [`libraz/grok-mcp`](https://github.com/libraz/grok-mcp). The bounded Grok Bot gateway contract was cross-checked against the MIT-licensed [`Adam91holt/grokbot-sdk`](https://github.com/Adam91holt/grokbot-sdk).
|
|
279
|
+
MIT. The process-runner design was informed by the MIT-licensed [`libraz/grok-mcp`](https://github.com/libraz/grok-mcp). The bounded Grok Bot gateway contract was cross-checked against the MIT-licensed [`Adam91holt/grokbot-sdk`](https://github.com/Adam91holt/grokbot-sdk).
|