Self-hosted coding agent server. Send tasks, get code. With auto-review, auto-PR, and thinking-level routing.
After completing a task, the agent automatically reviews its own work โ checks for syntax errors, runs tests, and fixes issues. Toggle on/off per request.
One-shot: prompt โ code โ review โ commit โ pull request. The agent generates the commit message and opens the PR via GitHub CLI.
Automatically selects thinking level based on prompt complexity. Simple tasks get no thinking overhead, complex tasks get deeper reasoning.
Works with any MCP client โ OpenClaw, Claude Code, Cursor, Windsurf. Install the standalone package or use the REST API directly.
Browse repos, search public repos, fork, clone, branch, and push โ all from the web UI. Agent works directly in cloned repos.
Zero public ports. CF Tunnel for HTTPS. Bearer token auth. GitHub token server-side only. Path traversal protection.
Generate a random token for authentication:
openssl rand -hex 32
OpenClaw (openclaw.json):
{
"mcp": {
"servers": {
"agent-hive": {
"command": "npx",
"args": ["github:stansz/hive-mcp"],
"env": {
"HIVE_URL": "https://hive.ogsapps.cc",
"HIVE_TOKEN": "your-token-here"
}
}
}
}
}
Claude Code (.claude/settings.json):
{
"mcpServers": {
"agent-hive": {
"command": "npx",
"args": ["github:stansz/hive-mcp"],
"env": {
"HIVE_URL": "https://hive.ogsapps.cc",
"HIVE_TOKEN": "your-token-here"
}
}
}
}
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"agent-hive": {
"command": "npx",
"args": ["github:stansz/hive-mcp"],
"env": {
"HIVE_URL": "https://hive.ogsapps.cc",
"HIVE_TOKEN": "your-token-here"
}
}
}
}
Use the tools from any connected client:
// Simple task โ thinking auto-detected as "off"
hive_snippet(prompt="rename variable 'foo' to 'bar'", code="let foo = 1;")
// Complex task โ thinking auto-detected as "low"
hive_prompt(prompt="Implement JWT authentication with refresh tokens")
// Full pipeline โ code + review + PR
hive_prompt_pr(prompt="Add rate limiting middleware", branch="feat/rate-limit")
| Tool | Description | Key Params |
|---|---|---|
hive_prompt |
Start a coding task. Auto-review on by default. | prompt, model?, autoReview?, autoPR? |
hive_prompt_pr |
Full pipeline: prompt โ review โ commit โ PR | prompt, branch, baseBranch?, prTitle? |
hive_snippet |
Quick code task without a repo | prompt, code, language? |
hive_status |
Check session state (running/done) | sessionId |
hive_messages |
Get full conversation history | sessionId |
hive_result |
Get session metadata | sessionId |
hive_abort |
Cancel a running session | sessionId |
When enabled (default), after the agent finishes its task, it receives a second prompt:
Review the changes you just made:
1. Check for syntax errors, broken imports, or unused variables
2. Run any available tests (npm test, pytest, go test, etc.)
3. Fix any issues you find
4. If everything looks good, say "LGTM"
This catches common mistakes without any human intervention. Disable it with autoReview: false.
When no explicit thinkingLevel is provided, the router analyzes the prompt:
| Level | When Used | Signals |
|---|---|---|
| off | Simple, quick tasks | Short prompt, simple keywords (rename, delete, format, explain) |
| minimal | Straightforward changes | Medium prompt, basic keywords (fix, update, add) |
| low | Feature work, refactoring | Longer prompt, implementation keywords (implement, integrate, refactor) |
| medium | Complex, multi-step tasks | Architecture, security, multi-file, debugging complex issues |
Always overridable: pass thinkingLevel: "high" explicitly to force deep reasoning.
All endpoints require Authorization: Bearer <token> unless noted.
| Method | Endpoint | Description |
|---|---|---|
POST | /prompt | Start a coding task |
POST | /prompt/pr | Full pipeline with auto-PR |
POST | /snippet | Quick code task |
GET | /status/:id | Session status |
GET | /messages/:id | Session messages |
POST | /abort/:id | Cancel session |
WS | /events/:id | Real-time streaming |
GET | /api/github/repos | List your repos |
GET | /api/github/search?q=โฆ | Search public repos |
POST | /api/github/clone | Clone a repo |
POST | /api/github/fork | Fork + clone a repo |
POST | /api/github/push | Commit + push changes |
GET | /health | Health check no auth |
Agent Hive runs on any Linux VPS with Node.js 22+. Total cost: ~$2-8/mo.
# Clone and configure
git clone https://github.com/stansz/agent-hive.git
cd agent-hive
cp .env.example .env # Edit with your keys
npm install && npx -p typescript tsc
# Run
node dist/index.js
# Or install as a systemd service
sudo cp agent-hive.service /etc/systemd/system/
sudo systemctl enable --now agent-hive
See GitHub for the full setup guide including CF Tunnel, UFW, and security hardening.