preview-hub
AGENTS.md0 starsChanged 14 days agoMITView on GitHub
You are in preview-hub: permanent public links (<public-url>/<id>/) for local dev servers, files and folders, with a dashboard, snapshots, expiry, a CLI (preview) and an MCP server (preview-mcp, plus an HTTP endpoint for cloud bots). Run preview hub status (or node bin/preview.js hub status if the command is not on PATH yet).
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,196 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Run preview hub status (or node bin/preview.js hub status if the command is not on PATH yet).
- Very specific: line 33
Keep dependencies minimal: the hub uses only Node built-ins.
- Very specific: line 34
After changing hub code, run preview hub restart and check preview hub status.
- Very specific: line 35
Test MCP changes over stdio (node bin/preview-mcp.js) and over HTTP (http://127.0.0.1:7421/_hub/mcp, or the public URL with a token).
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
You are in preview-hub: permanent public links (<public-url>/<id>/) for local dev servers, files and folders, with a dashboard, snapshots, expiry, a CLI (preview) and an MCP server (preview-mcp, plus an HTTP endpoint for cloud bots).
First thing to do
Run preview hub status (or node bin/preview.js hub status if the command is not on PATH yet).
- Command not found, hub not running, or
public: not set→ the person probably wants it set up. Offer to onboard them, and if they agree follow ONBOARDING.md step by step. It covers install, keeping the hub running, Cloudflare Tunnel or ngrok (permanent URL, PM2), connecting agents and bots, and a closing tour of how to use it. public_check: ok→ it is set up. Help with what they ask: publishing something (preview add ...), MCP tokens (preview mcp token <bot>), or working on the code.
Layout
| Path | What |
src/hub.js | The hub: reverse proxy (HTTP and WebSocket), static files and viewers, snapshots, auth, process supervision, expiry, tunnel and public-URL probe, MCP HTTP endpoint |
src/mcp.js | MCP tools and JSON-RPC handling, shared by stdio and HTTP. Remote-safe limits live here. |
src/client.js | Hub client used by the CLI and the stdio MCP server; output shaping |
src/store.js | Data dir (~/.preview-hub, override PREVIEW_HUB_HOME), ports (7420 public, 7421 loopback; override PREVIEW_HUB_PUBLIC_PORT / PREVIEW_HUB_LOCAL_PORT), config and state files |
src/procs.js, src/cache.js, src/util.js | Process control, snapshot cache, helpers |
bin/preview.js | AXI-style CLI (preview). preview --help, preview <command> --help |
bin/preview-mcp.js | stdio MCP server |
ui/ | Dashboard, login page and viewer styles (plain HTML, CSS and JS) |
ecosystem.config.cjs | PM2 apps: preview-hub, preview-ngrok |
scripts/ | Windows logon task (preview hub install) |
skills/preview/SKILL.md | Agent skill that teaches the CLI; copied to ~/.claude/skills or ~/.agents/skills during onboarding |
Rules
- Secrets (passcode, session key, tunnel token, MCP token hashes) live in
~/.preview-hub/config.json. Never copy them into this repo, a commit, or chat output. Ask the person to run token commands themselves. - Port 7421 is trusted because it binds 127.0.0.1 only. Never expose it, tunnel it, or bind it elsewhere.
- Anything reachable from the public port must stay behind the passcode or an MCP token. The
/_hub/mcpremote path must keep its limits (no start commands, no secret or system folders). - Keep dependencies minimal: the hub uses only Node built-ins; the CLI adds
axi-sdk-jsandqrcode(forpreview mcp token <name> --qr). - After changing hub code, run
preview hub restartand checkpreview hub status. - Test MCP changes over stdio (
node bin/preview-mcp.js) and over HTTP (http://127.0.0.1:7421/_hub/mcp, or the public URL with a token).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

