refactor: finish the AgentHub rename and drop the MCP server
Two leftovers from the rebrand, done together because they touch the same docs and manifests. **Data directory.** `agent-dashboard` could not simply be renamed in the source: it names a real directory holding the live SQLite database. Startup now moves it once, via `migrateLegacyDataDir()` in `server/lib/claude-home.js` — a same-filesystem rename, so it is instant even at multiple gigabytes and cannot leave two divergent copies. `getDataDir()` stays PURE and resolves to the legacy path until the move happens; the first version of this put the rename inside the getter, which meant `npm run test:server` relocated the developer's real database as a side effect. The call sits behind `require.main === module` and ahead of the router requires, because those pull in db.js, which opens SQLite at module load. A failed rename is silent and the old directory keeps being used: an unfashionable directory name beats a blank database beside an unreachable one. Same treatment for the port-discovery file (`.agent-dashboard.json` → `.agenthub.json`, old one dropped on write). Not renamed on purpose: the Sagi localStorage keys (renaming silently resets everyone's prefs) and the PWA manifest `id` (changing it orphans an installed app). **MCP server.** 4 tool calls in 46 days across 577,132 events, against 4,556 lines of TypeScript, a 2 MB committed build artifact, and a pre-commit guard that had already blocked commits twice. Deleted: `mcp/`, the maintainer skills and `mcp-reviewer` agent, the build check, `plugins/agenthub/.mcp.json`, `docs/MCP.md`, 12 npm scripts, 5 Makefile targets, and every doc section describing it. Kept, because they are unrelated things sharing the name: the Config Explorer's MCP tab and its API, per-lane Playwright MCP, the agenthub-config plugin's MCP audit, and the historical `mcp__plugin_agenthub_*` events that analytics must keep attributing. Verified: server 1432/1432, client 459/459, tsc clean, prettier clean. Both directions of the migration proven — a sandbox-HOME test run leaves the legacy directory untouched, and a real boot moves it with its contents intact.
This commit is contained in:
+5
-46
@@ -12,7 +12,7 @@ If all you want is a working dashboard, skip every step below. From Claude Code:
|
||||
```
|
||||
|
||||
The next session start installs the hooks, boots the server, puts the `agenthub` CLI
|
||||
on PATH and connects the MCP tools — no clone, no `npm run setup`, no
|
||||
on PATH — no clone, no `npm run setup`, no
|
||||
`npm run install-hooks`, no manual `npm start`. Run `/agenthub-doctor` to check the
|
||||
result and `/agenthub-open` to build the UI and get the URL.
|
||||
|
||||
@@ -61,7 +61,7 @@ npm install
|
||||
|
||||
`npm run setup` additionally installs the VS Code extension and links the `agenthub` CLI. (If you install with `--ignore-scripts`, the `postinstall` hook is skipped — run `cd client && npm install` manually in that case.)
|
||||
|
||||
Or via Makefile (also installs MCP dependencies):
|
||||
Or via Makefile:
|
||||
|
||||
```bash
|
||||
make setup
|
||||
@@ -204,47 +204,6 @@ and, for plugin installs, [`docs/PLUGINS.md` → Auto-start on boot](docs/PLUGIN
|
||||
|
||||
---
|
||||
|
||||
## Optional: Local MCP server
|
||||
|
||||
If you want AI agents to call dashboard functionality through MCP tools, run the local MCP server in `mcp/`:
|
||||
|
||||
```bash
|
||||
npm run mcp:install
|
||||
npm run mcp:build
|
||||
npm run mcp:start # stdio (for MCP host integration)
|
||||
npm run mcp:start:http # HTTP + SSE server on port 8819
|
||||
npm run mcp:start:repl # interactive CLI with tab completion
|
||||
```
|
||||
|
||||
The MCP server supports three transport modes:
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
HOST["MCP Host<br/>(Claude Code / Desktop)"] -->|"stdin/stdout"| STDIO["stdio mode<br/>mcp:start"]
|
||||
RC["Remote Client"] -->|"POST /mcp<br/>GET /sse"| HTTP["HTTP mode<br/>mcp:start:http<br/>:8819"]
|
||||
OP["Operator"] -->|"interactive CLI"| REPL["REPL mode<br/>mcp:start:repl"]
|
||||
|
||||
STDIO --> API["Dashboard API<br/>http://127.0.0.1:4820/api/*"]
|
||||
HTTP --> API
|
||||
REPL --> API
|
||||
|
||||
style STDIO fill:#6366f1,stroke:#818cf8,color:#fff
|
||||
style HTTP fill:#f59e0b,stroke:#fbbf24,color:#000
|
||||
style REPL fill:#a855f7,stroke:#c084fc,color:#fff
|
||||
```
|
||||
|
||||
See [mcp/README.md](./mcp/README.md) for host config, tool catalog, and safety flags.
|
||||
|
||||
To build the MCP server as a container image instead:
|
||||
|
||||
```bash
|
||||
npm run mcp:docker:build
|
||||
# or
|
||||
npm run mcp:podman:build
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Optional: Agent extension packs
|
||||
|
||||
This repository includes extension packs for both Claude Code and Codex.
|
||||
@@ -329,7 +288,7 @@ podman build -t agent-monitor .
|
||||
podman run -d --name agent-monitor \
|
||||
-p 127.0.0.1:4820:4820 \
|
||||
-v "$HOME/.claude:/root/.claude:ro" \
|
||||
-v "$HOME/.claude/agent-dashboard:/app/data" \
|
||||
-v "$HOME/.claude/agenthub:/app/data" \
|
||||
agent-monitor
|
||||
```
|
||||
|
||||
@@ -338,10 +297,10 @@ podman run -d --name agent-monitor \
|
||||
| Mount | Purpose |
|
||||
|---|---|
|
||||
| `~/.claude:/root/.claude:ro` | Lets the server import legacy Claude session history |
|
||||
| `~/.claude/agent-dashboard:/app/data` | **Canonical SQLite database** (shared with native installs) |
|
||||
| `~/.claude/agenthub:/app/data` | **Canonical SQLite database** (shared with native installs) |
|
||||
|
||||
> [!NOTE]
|
||||
> The image sets `DASHBOARD_HOST=0.0.0.0` and `DASHBOARD_DATA_DIR=/app/data` internally (baked into the `Dockerfile`). The `0.0.0.0` bind is required because a container's loopback is a separate namespace the published port cannot reach; `/app/data` is bind-mounted to `~/.claude/agent-dashboard` on the host so Docker uses the same database as `npm start`. The trust boundary is the **host** port publish — the examples use `-p 127.0.0.1:4820:4820`, so the dashboard is local-only. To expose it on a LAN, publish on `0.0.0.0` (`-p 4820:4820`) **and** set `DASHBOARD_TOKEN`.
|
||||
> The image sets `DASHBOARD_HOST=0.0.0.0` and `DASHBOARD_DATA_DIR=/app/data` internally (baked into the `Dockerfile`). The `0.0.0.0` bind is required because a container's loopback is a separate namespace the published port cannot reach; `/app/data` is bind-mounted to `~/.claude/agenthub` on the host so Docker uses the same database as `npm start`. The trust boundary is the **host** port publish — the examples use `-p 127.0.0.1:4820:4820`, so the dashboard is local-only. To expose it on a LAN, publish on `0.0.0.0` (`-p 4820:4820`) **and** set `DASHBOARD_TOKEN`.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Claude Code hooks run on the host, not inside the container. After the container is healthy on `http://localhost:4820`, run `npm run install-hooks` on the host so Claude Code posts hook events back to the containerized server. The installer refuses to run inside a container (issue #193) to avoid writing a container-internal handler path into a bind-mounted `~/.claude`; use `AGENTHUB_ALLOW_CONTAINER_HOOKS=1` only if you run Claude Code inside the same container.
|
||||
|
||||
Reference in New Issue
Block a user