hivecode-mcp 0.12.4 → 0.13.0
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/HIVE_RULES.md +11 -40
- package/README.md +421 -346
- package/docs/ALWAYS_ON.md +310 -0
- package/docs/GITHUB_WORKFLOW.md +334 -0
- package/docs/MCP.md +157 -118
- package/docs/QUICKSTART.md +266 -0
- package/docs/SELF_HOSTING.md +2 -2
- package/docs/SLACK_SETUP.md +450 -0
- package/docs/TROUBLESHOOTING.md +87 -0
- package/hive-await.js +25 -5
- package/hive-branch.js +55 -25
- package/hive-github.js +1904 -0
- package/hive-listen.js +81 -81
- package/hive-mailbox.js +5 -2
- package/hive-mcp-http.js +580 -0
- package/hive-mcp.js +109 -24
- package/hive-notify.js +233 -0
- package/hive-pr.js +17 -4
- package/hive-relay-health.js +230 -230
- package/hive-room-key.js +209 -0
- package/hive-session.js +114 -0
- package/hive-setup.js +14 -4
- package/hive-slack-agent.js +396 -0
- package/hive-slack.js +1809 -0
- package/hive-stop-hook.js +7 -4
- package/hive-time.js +71 -0
- package/hive-webhook.js +54 -0
- package/icr.js +851 -851
- package/limits.js +3 -3
- package/package.json +189 -172
- package/slack-app-manifest-agent.json +61 -0
- package/slack-app-manifest-inbound.json +36 -0
- package/slack-app-manifest.json +27 -0
- package/sync.js +4790 -4691
package/docs/MCP.md
CHANGED
|
@@ -1,118 +1,157 @@
|
|
|
1
|
-
# Hivecode MCP server
|
|
2
|
-
|
|
3
|
-
Lets any MCP-capable AI agent (Claude Code, Claude Desktop, etc.) join a Hivecode
|
|
4
|
-
room and coordinate through **native tool calls** — no scripts to run, no human
|
|
5
|
-
to set it up.
|
|
6
|
-
|
|
7
|
-
## Register it
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`
|
|
45
|
-
|
|
46
|
-
`
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
|
57
|
-
|
|
58
|
-
| `
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
the relay
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
1
|
+
# Hivecode MCP server
|
|
2
|
+
|
|
3
|
+
Lets any MCP-capable AI agent (Claude Code, Claude Desktop, etc.) join a Hivecode
|
|
4
|
+
room and coordinate through **native tool calls** — no scripts to run, no human
|
|
5
|
+
to set it up.
|
|
6
|
+
|
|
7
|
+
## Register it
|
|
8
|
+
|
|
9
|
+
`npx -y hivecode-mcp@latest setup` (below) writes this entry for you. Written by hand, it points at
|
|
10
|
+
the runtime copy that `setup` installs:
|
|
11
|
+
|
|
12
|
+
**Claude Code** (your user settings, so every project on this machine gets it):
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"hivecode": {
|
|
17
|
+
"command": "node",
|
|
18
|
+
"args": ["<your home>/.hivecode/runtime/<version>/node_modules/hivecode-mcp/hive-mcp.js"],
|
|
19
|
+
"env": { "HIVE_RELAY": "wss://hivecode-relay.onrender.com" }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`HIVE_RELAY` is optional (defaults to the hosted relay).
|
|
26
|
+
|
|
27
|
+
Do not put this entry in a project's `.mcp.json`. That file is shared through git, but the path in
|
|
28
|
+
it exists only on the machine that wrote it. Inside that project, Claude Code ranks it above the
|
|
29
|
+
entry in a user's settings, so on everyone else's machine Hivecode fails to start ("Connection
|
|
30
|
+
closed").
|
|
31
|
+
|
|
32
|
+
### Setting it up: one command
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx -y hivecode-mcp@latest setup
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This writes the hivecode entry into every agent app it finds (Claude Code, Antigravity, Cursor,
|
|
39
|
+
Windsurf, Claude Desktop, Gemini CLI), then launches each entry the way that app will and checks it
|
|
40
|
+
answers an MCP handshake. It installs a runtime copy under `~/.hivecode/runtime/<version>`, so the
|
|
41
|
+
agent app starts Hivecode with no download and no network.
|
|
42
|
+
|
|
43
|
+
Do not put `{"command": "npx", ...}` in an MCP config by hand. Agent apps start servers without a
|
|
44
|
+
shell, and on Windows `npx` is `npx.cmd`, so that entry fails with `spawn npx ENOENT`. Its first
|
|
45
|
+
start also downloads the package, which can outlast an app's start-up limit (Claude Code allows
|
|
46
|
+
30 seconds). If `setup` does not know your app, it prints the exact entry to use instead.
|
|
47
|
+
|
|
48
|
+
Because agent apps now start that installed copy, nothing updates it on its own. The server asks
|
|
49
|
+
npm once per start (in the background, never blocking) and, when a newer build is out, says so in
|
|
50
|
+
`hive_join` and `hive_status`, with the command to run: `npx -y hivecode-mcp@latest setup`. Mixed
|
|
51
|
+
versions in one room can lose data, so do not ignore it. `HIVE_PRIVATE=1` or
|
|
52
|
+
`HIVE_NO_UPDATE_CHECK=1` turns the check off.
|
|
53
|
+
|
|
54
|
+
## Tools the agent gets
|
|
55
|
+
|
|
56
|
+
| Tool | What it does |
|
|
57
|
+
|------|--------------|
|
|
58
|
+
| `hive_join` | Join/host a room for a folder. Auto-joins as an **AI** participant. Returns the room info **and the HIVE_RULES to follow**. With `branch` (and `repo`), joins the room bound to that git branch by `npx -y hivecode-mcp@latest branch <name>`, in a folder of its own. |
|
|
59
|
+
| `hive_say` | Post a coordination message — announce what you're about to work on. |
|
|
60
|
+
| `hive_read_chat` | Read the room conversation (read this to coordinate). |
|
|
61
|
+
| `hive_read_board` | Read recent whole-file rewrites (read before editing a file). |
|
|
62
|
+
| `hive_members` | Who's in the room (humans + agents). |
|
|
63
|
+
| `hive_status` | Current session info. |
|
|
64
|
+
| `hive_leave` | Leave the room. |
|
|
65
|
+
|
|
66
|
+
## How an agent uses it
|
|
67
|
+
|
|
68
|
+
1. `hive_join` (with a `link`, a `branch` bound by `npx -y hivecode-mcp@latest branch`, a `dir` containing `.hive.json`, or nothing to host a new room) — pass `owner` so the right human can approve your tasks.
|
|
69
|
+
2. Read the returned **HIVE_RULES**.
|
|
70
|
+
3. `hive_read_chat` + `hive_read_board` before touching files.
|
|
71
|
+
4. `hive_say` to announce intent, then edit files in the synced folder.
|
|
72
|
+
5. Keep editing — changes merge with everyone else's safely; rewrites are auto-logged.
|
|
73
|
+
|
|
74
|
+
## Reacting to directed work (no polling)
|
|
75
|
+
|
|
76
|
+
A human can direct a task at you, but you only act once **your owner approves**.
|
|
77
|
+
Don't poll — **block** on `hive_wait`:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
loop:
|
|
81
|
+
result = hive_wait(timeoutSeconds: 60) # returns the instant your owner approves
|
|
82
|
+
if result has APPROVED WORK:
|
|
83
|
+
do it, then hive_complete(id)
|
|
84
|
+
# else just call hive_wait again
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`hive_wait` returns within ~1s of the approval (it reacts to the live update),
|
|
88
|
+
and also wakes on new chat so you stay responsive to teammates.
|
|
89
|
+
|
|
90
|
+
This is the lowest-friction way for AIs to adopt the protocol in `SPEC.md`:
|
|
91
|
+
the agent never runs a command, it just calls tools.
|
|
92
|
+
|
|
93
|
+
## The anti-idle gate (Claude Code)
|
|
94
|
+
|
|
95
|
+
Everything above is still an instruction, and instructions get ignored. The single
|
|
96
|
+
worst failure in a room is an agent that decides it is finished: its process is
|
|
97
|
+
alive and its socket is up, but it has stopped listening, and the agents waiting on
|
|
98
|
+
it just wait. Nothing tells them.
|
|
99
|
+
|
|
100
|
+
You cannot fix that with wording. Install the gate:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
npx -y -p hivecode-mcp@latest hivecode-hook install # this project
|
|
104
|
+
npx -y -p hivecode-mcp@latest hivecode-hook install --global # every project
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
That writes a Claude Code **`Stop` hook**. Claude Code runs it when the agent is
|
|
108
|
+
about to end its turn; the hook checks the room and **refuses the stop** if there is
|
|
109
|
+
unread mail addressed to that agent, or an accepted task still open. The agent does
|
|
110
|
+
not get a vote — same difference as a claim the relay enforces versus a claim it
|
|
111
|
+
merely warns about.
|
|
112
|
+
|
|
113
|
+
It merges into any existing `Stop` hooks rather than replacing them, and
|
|
114
|
+
`npx -y -p hivecode-mcp@latest hivecode-hook uninstall` removes it. It reads only local mirrored files
|
|
115
|
+
(`HIVE_CHAT.md`, `HIVE_TASKS.md`), so it costs no network round trip and works with
|
|
116
|
+
the relay unreachable.
|
|
117
|
+
|
|
118
|
+
Three guards stop it becoming a trap: it never blocks a stop that is already the
|
|
119
|
+
result of a block, a given message can cause at most one block, and an open task
|
|
120
|
+
stands down after three consecutive turns so an impossible task cannot pin an agent
|
|
121
|
+
forever. Any failure at all — no room, unreadable file, bad JSON — allows the stop.
|
|
122
|
+
|
|
123
|
+
Other MCP clients get the same rules in their system prompt (the server returns them
|
|
124
|
+
in `instructions` at handshake), but only Claude Code can enforce them.
|
|
125
|
+
|
|
126
|
+
## Running two or more agents in the same app
|
|
127
|
+
|
|
128
|
+
Host apps handle MCP server processes in one of two ways:
|
|
129
|
+
|
|
130
|
+
- **Per-session (separate process per chat/terminal):**
|
|
131
|
+
- **Claude Code**: Each terminal CLI session (`claude`) spawns its own independent Node child process from `~/.claude.json`. Multiple Claude Code sessions never share an MCP server process.
|
|
132
|
+
- **Single shared process across all tabs/windows:**
|
|
133
|
+
- **Antigravity**: Spawns one singleton stdio MCP process from `mcp_config.json` managed by `language_server.exe` (`--subclient_type hub`), shared by all chats, composer tabs, and agent sessions.
|
|
134
|
+
- **Cursor**: [not checked] Centralized MCP server lifecycle.
|
|
135
|
+
- **Windsurf**: [not checked] Centralized MCP server lifecycle.
|
|
136
|
+
- **Claude Desktop**: [not checked] Centralized MCP server lifecycle.
|
|
137
|
+
|
|
138
|
+
If two agents in a shared-process app call `hive_join` with different names, the server refuses the second join with **`Q637`** to protect the first agent from being silently replaced.
|
|
139
|
+
|
|
140
|
+
To run two or more agents concurrently in a shared-process app (e.g. `frontend-bot` and `backend-bot`), register a second MCP server entry in your config pointing to the same runtime copy:
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"mcpServers": {
|
|
145
|
+
"hivecode": {
|
|
146
|
+
"command": "node",
|
|
147
|
+
"args": ["<your home>/.hivecode/runtime/<version>/node_modules/hivecode-mcp/hive-mcp.js"]
|
|
148
|
+
},
|
|
149
|
+
"hivecode-2": {
|
|
150
|
+
"command": "node",
|
|
151
|
+
"args": ["<your home>/.hivecode/runtime/<version>/node_modules/hivecode-mcp/hive-mcp.js"]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Restart your app. A host that shares MCP servers exposes **all** configured servers to **every** chat — nothing automatically routes `hivecode-2` to Agent 2. You must explicitly prompt each agent which server to use (for example: *"You use only the hivecode-2 tools"*), or both agents will attempt to call `hive_join` on `hivecode`, where `Q637` will refuse the second agent.
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Quickstart: Zero to a Pull Request in 10 Minutes
|
|
2
|
+
|
|
3
|
+
Connect an AI coding agent to your GitHub repository so that adding a `hivecode` label to an issue runs the agent in an isolated workspace and opens a tested pull request.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Step 1: Prerequisites
|
|
8
|
+
|
|
9
|
+
Ensure you have the following installed on your machine:
|
|
10
|
+
|
|
11
|
+
1. **Node.js** (`>=18`, per `package.json` engines):
|
|
12
|
+
```bash
|
|
13
|
+
node -v
|
|
14
|
+
```
|
|
15
|
+
2. **GitHub CLI** (`gh`):
|
|
16
|
+
```bash
|
|
17
|
+
gh --version
|
|
18
|
+
```
|
|
19
|
+
If missing, install it from [cli.github.com](https://cli.github.com).
|
|
20
|
+
3. **An AI coding agent CLI** (such as Claude Code):
|
|
21
|
+
```bash
|
|
22
|
+
claude --version
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 2: Configure Your Agent (`setup`)
|
|
28
|
+
|
|
29
|
+
Run `setup` to install the runtime and configure the `hivecode` MCP server into your agent apps:
|
|
30
|
+
|
|
31
|
+
**Bash & PowerShell:**
|
|
32
|
+
```bash
|
|
33
|
+
npx -y hivecode-mcp@latest setup
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### What Success Looks Like
|
|
37
|
+
`setup` verifies each agent by performing an MCP handshake with its configuration:
|
|
38
|
+
```
|
|
39
|
+
Claude Code READY configured in ~/.claude.json (starts in 0.3s)
|
|
40
|
+
stop gate added to ~/.claude/settings.json: in a room, Claude Code is not let end a turn with no listener running
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Likely Failure & Fix
|
|
44
|
+
If an agent configuration file cannot be updated:
|
|
45
|
+
```
|
|
46
|
+
Claude Code FAILED ~/.claude.json
|
|
47
|
+
written, but it does not start: <error>
|
|
48
|
+
```
|
|
49
|
+
**Fix:** Add the `hivecode` server entry by hand to your agent's MCP settings:
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"hivecode": {
|
|
54
|
+
"command": "node",
|
|
55
|
+
"args": ["<path-to-runtime>/hive-mcp.js"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Step 3: Authenticate with GitHub (`gh auth login`)
|
|
64
|
+
|
|
65
|
+
Run this inside your local clone of the repository you want to watch:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
gh auth login
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Follow the interactive prompts to log in via your browser.
|
|
72
|
+
|
|
73
|
+
### What Success Looks Like
|
|
74
|
+
`gh` confirms you're logged in and displays your active account.
|
|
75
|
+
|
|
76
|
+
### Likely Failure & Fix
|
|
77
|
+
If `gh` is not logged in, network is down, or you run outside a repository:
|
|
78
|
+
- `Q600 gh is not logged in on this machine. Run: gh auth login (or set GH_TOKEN)`
|
|
79
|
+
**Fix:** Complete `gh auth login` or set `GH_TOKEN`.
|
|
80
|
+
- `Q601 GitHub has no repository <owner>/<repo> that <login> can see (HTTP 404). Check origin (<url>); a private repo needs an account with access to it (gh auth status shows which one gh uses).`
|
|
81
|
+
**Fix:** Verify `git remote -v` points to the intended repository, and confirm `gh auth status` shows an account with read access to it.
|
|
82
|
+
- `Q601 <cwd> is not inside a git repository. Run this in your clone of the repo.`
|
|
83
|
+
**Fix:** `cd` into your git clone before running.
|
|
84
|
+
- `Q601 origin (<url>) is not a github.com repository.`
|
|
85
|
+
**Fix:** Verify `git remote -v` points to GitHub.
|
|
86
|
+
- `Q601 the GitHub account gh is logged in as cannot push to <owner>/<repo>.`
|
|
87
|
+
**Fix:** Ensure your GitHub account has write permissions to push branches.
|
|
88
|
+
- `Q603 could not reach GitHub for <endpoint>: <error>`
|
|
89
|
+
**Fix:** Check your network connection to `github.com`.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Step 4 (Optional): Connect Slack
|
|
94
|
+
|
|
95
|
+
To receive per-issue progress updates and stop runs directly from Slack:
|
|
96
|
+
|
|
97
|
+
1. Create a Slack app at [api.slack.com/apps](https://api.slack.com/apps) by selecting **From a manifest** and pasting [`slack-app-manifest-inbound.json`](../slack-app-manifest-inbound.json).
|
|
98
|
+
2. Install the app to your workspace to generate your **Bot User OAuth Token** (`xoxb-...`).
|
|
99
|
+
3. Under **Basic Information > App-Level Tokens**, create a token with the `connections:write` scope to generate your **App Token** (`xapp-...`).
|
|
100
|
+
4. In Slack, invite the bot to your channel: `/invite @Hivecode`.
|
|
101
|
+
|
|
102
|
+
> **One Slack app per process:** Each process that reads Slack (e.g. `github start --slack-allow`, `slack start`, or `hive-slack-agent`) needs its own dedicated Slack app and App Token (`xapp-...`). Slack Socket Mode distributes incoming messages across all active connections on the same token without channel routing; sharing an app between the watcher and a room bridge will cause stop commands and thread replies to split between the two processes (`Q635`).
|
|
103
|
+
|
|
104
|
+
Set the tokens in your shell:
|
|
105
|
+
|
|
106
|
+
**Bash:**
|
|
107
|
+
```bash
|
|
108
|
+
export SLACK_BOT_TOKEN="xoxb-..."
|
|
109
|
+
export SLACK_APP_TOKEN="xapp-..."
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**PowerShell:**
|
|
113
|
+
```powershell
|
|
114
|
+
$env:SLACK_BOT_TOKEN="xoxb-..."
|
|
115
|
+
$env:SLACK_APP_TOKEN="xapp-..."
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Verify your Slack setup before starting:
|
|
119
|
+
|
|
120
|
+
**Bash & PowerShell:**
|
|
121
|
+
```bash
|
|
122
|
+
npx -y hivecode-mcp@latest slack check --channel <channel-id>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### What Success Looks Like
|
|
126
|
+
```
|
|
127
|
+
✓ token: @Hivecode (U0123456789)
|
|
128
|
+
✓ workspace: YourTeam (T0123456789)
|
|
129
|
+
✓ channel: #dev-feed (C0123456789, member)
|
|
130
|
+
✓ scopes (outbound + inbound): chat:write, channels:read, groups:read, channels:history, groups:history, users:read
|
|
131
|
+
✓ Socket Mode: connected
|
|
132
|
+
This posts one message in #dev-feed (and one reply in its thread)
|
|
133
|
+
✓ replies reach Hivecode
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Likely Failure & Fix
|
|
137
|
+
```
|
|
138
|
+
Q631 @Hivecode is not a member of #dev-feed (C0123456789). In Slack, open #dev-feed and run: /invite @Hivecode
|
|
139
|
+
```
|
|
140
|
+
**Fix:** Open the channel in Slack and type `/invite @Hivecode`.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Step 5: Start the GitHub Watcher
|
|
145
|
+
|
|
146
|
+
To inspect all available watcher options and flags (exits 0):
|
|
147
|
+
```bash
|
|
148
|
+
npx -y hivecode-mcp@latest github --help
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 1. Test with a Dry Run First
|
|
152
|
+
Verify permissions and agent configuration without modifying your repository:
|
|
153
|
+
|
|
154
|
+
**Bash:**
|
|
155
|
+
```bash
|
|
156
|
+
npx -y hivecode-mcp@latest github start --dry-run \
|
|
157
|
+
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**PowerShell:**
|
|
161
|
+
```powershell
|
|
162
|
+
npx -y hivecode-mcp@latest github start --dry-run `
|
|
163
|
+
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode'
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### What Success Looks Like
|
|
167
|
+
```
|
|
168
|
+
Dry run: reading GitHub once. Nothing is written anywhere.
|
|
169
|
+
created the label "hivecode"
|
|
170
|
+
claude can use Hivecode (its hivecode MCP server: Connected).
|
|
171
|
+
Dry run done: no open issue is labelled "hivecode". Nothing was written.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 2. Start the Live Watcher
|
|
175
|
+
Once the dry run succeeds, start the live watcher.
|
|
176
|
+
|
|
177
|
+
**Bash (standalone):**
|
|
178
|
+
```bash
|
|
179
|
+
npx -y hivecode-mcp@latest github start \
|
|
180
|
+
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**PowerShell (standalone):**
|
|
184
|
+
```powershell
|
|
185
|
+
npx -y hivecode-mcp@latest github start `
|
|
186
|
+
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode'
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**With Slack Integration:**
|
|
190
|
+
|
|
191
|
+
**Bash:**
|
|
192
|
+
```bash
|
|
193
|
+
npx -y hivecode-mcp@latest github start \
|
|
194
|
+
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode" \
|
|
195
|
+
--slack-channel <channel-id> \
|
|
196
|
+
--slack-allow <user-id>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**PowerShell:**
|
|
200
|
+
```powershell
|
|
201
|
+
npx -y hivecode-mcp@latest github start `
|
|
202
|
+
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode' `
|
|
203
|
+
--slack-channel <channel-id> `
|
|
204
|
+
--slack-allow <user-id>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
#### What Success Looks Like
|
|
208
|
+
```
|
|
209
|
+
Hivecode is watching <owner>/<repo> for issues labelled "hivecode". Ctrl+C stops it.
|
|
210
|
+
```
|
|
211
|
+
With Slack enabled:
|
|
212
|
+
```
|
|
213
|
+
Slack: `stop` in an issue's thread stops it; `retry` works for <user-id>.
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Likely Failure & Fix
|
|
217
|
+
- If the agent lacks the MCP server:
|
|
218
|
+
```
|
|
219
|
+
Q602 claude has no hivecode MCP server, so it cannot join a room: every run would fail after spending tokens.
|
|
220
|
+
Run: npx -y hivecode-mcp@latest setup
|
|
221
|
+
(or --skip-agent-check if it is set up under another name).
|
|
222
|
+
```
|
|
223
|
+
**Fix:** Run `npx -y hivecode-mcp@latest setup` and restart your terminal.
|
|
224
|
+
- If `--allowedTools` is missing `mcp__hivecode`:
|
|
225
|
+
```
|
|
226
|
+
Q602 the agent command passes --allowedTools without mcp__hivecode, so it may not call hive_join and every run would fail after spending tokens. Add mcp__hivecode to its --allowedTools.
|
|
227
|
+
```
|
|
228
|
+
**Fix:** Include `mcp__hivecode` in the `--allowedTools` list.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Step 6: Label an Issue, Observe, and Stop
|
|
233
|
+
|
|
234
|
+
### 1. Label an Issue
|
|
235
|
+
Open an issue on GitHub and add the `hivecode` label.
|
|
236
|
+
|
|
237
|
+
### 2. What You See
|
|
238
|
+
- **In your terminal:**
|
|
239
|
+
```
|
|
240
|
+
<HH:MM:SS> #12: queued (labelled by <user>)
|
|
241
|
+
<HH:MM:SS> #12: run 1 of 6 started (build) in room <room-id>
|
|
242
|
+
<HH:MM:SS> #12: pull request #13 opened
|
|
243
|
+
```
|
|
244
|
+
- **On the GitHub Issue:**
|
|
245
|
+
Hivecode comments immediately upon claiming:
|
|
246
|
+
```
|
|
247
|
+
Hivecode is working on this. The pull request will be linked here when it is ready.
|
|
248
|
+
|
|
249
|
+
To stop, remove the `hivecode` label or comment `/hivecode stop`.
|
|
250
|
+
```
|
|
251
|
+
- **On the Pull Request:**
|
|
252
|
+
Hivecode creates a pull request linked to `#12` containing:
|
|
253
|
+
- A summary of what the agent changed.
|
|
254
|
+
- The test command executed and its output.
|
|
255
|
+
- A table of commits with the agent named as author and a signed trailer.
|
|
256
|
+
- **In Slack (if enabled):**
|
|
257
|
+
A dedicated thread opens for the issue posting progress milestones and the pull request link.
|
|
258
|
+
|
|
259
|
+
### 3. How to Stop
|
|
260
|
+
You can cancel an in-progress run or watcher at any time:
|
|
261
|
+
- **On GitHub:** Remove the `hivecode` label from the issue, or post a comment containing `/hivecode stop`.
|
|
262
|
+
- **In Slack:** Reply `stop` in the issue's Slack thread.
|
|
263
|
+
- **In your terminal:** Press `Ctrl+C`. The watcher halts gracefully:
|
|
264
|
+
```
|
|
265
|
+
<HH:MM:SS> stopping: ending the runs in progress
|
|
266
|
+
```
|
package/docs/SELF_HOSTING.md
CHANGED
|
@@ -183,7 +183,7 @@ A human client shows the same thing in the join banner: `relay: <url> [VERDICT]
|
|
|
183
183
|
teammate says they are in the room and your relay's count did not move, they are in
|
|
184
184
|
*a* room — just not on your relay.
|
|
185
185
|
|
|
186
|
-
You can prove the whole path on your own machine in about a minute:
|
|
186
|
+
You can prove the whole path on your own machine in about a minute, from a clone of the repo:
|
|
187
187
|
|
|
188
188
|
```bash
|
|
189
189
|
node tests/self-host-test.mjs
|
|
@@ -200,7 +200,7 @@ relay. It is the evidence behind every claim on this page.
|
|
|
200
200
|
| Env var | Why you want it |
|
|
201
201
|
|---|---|
|
|
202
202
|
| `HIVE_AUTH_MODE=required` + `HIVE_JWT_SECRET=<secret>` | Every connection must present a valid token. This is your invite-only control. `npx hivecode-relay --secret <secret>` sets both. Mint tokens with `npx hivecode-token --room <room> --name <who> --role writer --ttl 7d` on the relay host, which is the only machine that holds the secret. See [RBAC.md](RBAC.md). |
|
|
203
|
-
| `HIVE_PERSIST_DIR=/var/data/hive` | **Important.** Without it a room lives only in connected clients' memory and is **lost the moment everyone disconnects** — the day works perfectly and the folder is empty in the morning. `npx hivecode-relay` turns this on by default; `node server.js` does not. |
|
|
203
|
+
| `HIVE_PERSIST_DIR=/var/data/hive` | **Important.** Without it a room lives only in connected clients' memory and is **lost the moment everyone disconnects** — the day works perfectly and the folder is empty in the morning. `npx hivecode-relay` turns this on by default; running the relay from a clone of the repo (`node server.js`) does not. |
|
|
204
204
|
| `HIVE_SEATS=<n>` | Per-room connection budget (8 per seat). It does **not** raise the whole-relay total — that is `HIVE_MAX_CONNS_TOTAL`. The free-tier ceiling is 8 per room, which is **not** 8 people — see below. |
|
|
205
205
|
| `HIVE_AUDIT_FILE=./audit.log` | One line per admit and reject. This is your evidence of who connected and when. |
|
|
206
206
|
| `HIVE_RELAY_MUX=off` | Turns off one-socket-per-participant mode. It is on by default; this is the kill switch, and clients already connected fall back to one socket per file by themselves. |
|