Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

serve

$ serve Official Med Risk
Vercel · Browser & Web · MIT · macos / linux / windows

Vercel's serve spins up a local HTTP server for static sites and single-page applications (serve -s dist -l 3000). Supports serve.json rewrites, CORS headers (--cors), and --no-clipboard / --no-port-switching flags for predictable local testing, while blocking as a foreground daemon.

FCRS-1.0 Score
77 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g serve
CLI vs MCP Decision CLI Only

Binds local TCP ports to serve project build directories (dist/) over HTTP for browser checks; MCP servers do not manage local static web servers.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 16 / 25

Accepts deterministic flags (--no-clipboard, --no-port-switching, -l) without prompts, but runs as a blocking foreground server with plain-text logs and no JSON mode.

  • Non-interactive flags (--no-clipboard, --no-port-switching, -l)
  • Foreground server process without structured JSON logging
Trust & Safety 19 / 25

Serves static files read-only without credentials, though bare serve binds all network interfaces and copies the URL to the clipboard unless restricted.

  • Read-only file serving; default listen address exposes LAN unless -l tcp://127.0.0.1:PORT is set
Setup & Portability 13 / 15

Cross-platform npm package (npm install -g serve or npx serve) requiring Node.js.

  • Runs on macOS, Linux, and Windows via Node.js (npm/npx)
Utility & Efficiency 12 / 15

Fast zero-config static and SPA preview server (-s rewrite) for browser and curl verification.

  • Single-command SPA routing (-s) and serve.json config support
Maintenance & Lineage 9 / 10

Official Vercel repository (vercel/serve) under MIT license.

  • Maintained under vercel/serve on GitHub
Docs & Verifiability 8 / 10

Clear README, serve --help, and serve-handler configuration documentation.

  • GitHub README and serve --help flag reference

Security, Auth & Guardrails

Auth Modes
No Auth Config File
Credential Storage

No authentication credentials required; optional routing, header, and rewrite rules live in serve.json.

Side Effects
Read-Only Local Write
Cost & Quotas

Free, MIT-licensed open-source Node.js package.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# serve Agent Rules
- Always bind explicitly to `-l tcp://127.0.0.1:<port>` instead of default `0.0.0.0` so local files are not exposed on the LAN.
- Pass `--no-clipboard --no-port-switching` and terminate the background `serve` process when verification finishes.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect serve CLI flags and version
serve --help && serve --version

Prints supported options (-s, -l, --cors, --no-clipboard) and installed version without binding any port.

Controlled Writes & Previews

Serve a build directory on localhost only
serve -s dist -l tcp://127.0.0.1:3000 --no-clipboard --no-port-switching

Starts an SPA static server bound strictly to 127.0.0.1:3000 without modifying the clipboard or silently picking another port.

Strengths for Agents

  • + One-command SPA fallback (-s) and serve.json routing with zero boilerplate.
  • + --no-clipboard and --no-port-switching prevent surprising side effects in automated runs.

Caveats & Pitfalls

  • ! Blocks indefinitely as a foreground daemon and emits human-oriented text banners instead of JSON.
  • ! Default bind exposes the served directory on LAN interfaces unless 127.0.0.1 is specified via -l.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI