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

http-server

$ http-server Community Med Risk
http-party · Browser & Web · MIT · macos / linux / windows

http-server (http-party/http-server) serves any local directory over HTTP/HTTPS with minimal setup (http-server ./dist -p 8080 --cors). Supports disabling caching (-c-1), SPA/API proxy fallback (-P), basic auth, and silent logging (-s), making it a staple quick local preview daemon.

FCRS-1.0 Score
70 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
brew install http-server
CLI vs MCP Decision CLI Only

http-server binds a local TCP port to serve static files from disk during local build previews or browser tests.

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 14 / 25

Accepts clean non-interactive flags (-p, -a, -c-1, --cors, -s), but runs as an indefinite blocking daemon and emits unstructured log lines with no --json mode.

  • Long-running daemon process; must be backgrounded by the caller
  • No --json access log format
Trust & Safety 17 / 25

Read-only over HTTP, but binds 0.0.0.0 by default unless -a 127.0.0.1 is passed, which can expose the working directory on local networks.

  • Defaults to 0.0.0.0 unless -a 127.0.0.1 is explicitly passed
  • Serves directory listings unless -d false is set
Setup & Portability 14 / 15

Widely available via npx http-server, npm install -g http-server, and brew install http-server on macOS, Linux, and Windows.

  • Zero-install execution via npx http-server
Utility & Efficiency 11 / 15

Instant static file server with -c-1, --cors, TLS (-S), and -P proxy fallback for quick frontend previews.

  • Covers static hosting, CORS, TLS, basic auth, and simple proxying
Maintenance & Lineage 7 / 10

Long-standing MIT community package (http-party/http-server).

  • MIT-licensed http-party/http-server repository
Docs & Verifiability 7 / 10

Clear README flag table and --help output.

  • Documented CLI flags in repository README

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key
Credential Storage

Stateless; optional HTTP basic auth accepts --username and --password on launch.

Side Effects
Read-Only
Cost & Quotas

MIT open-source Node.js CLI; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# http-server Agent Rules
- Always run `http-server` as a background daemon (it blocks forever until killed).
- Bind `-a 127.0.0.1` instead of `0.0.0.0` so local files are not exposed on the LAN.
- Pass `-c-1` during development/testing so stale `Cache-Control` headers do not confuse checks.

Agent-Ready Command Recipes

Safe Read-Only Queries

Serve a build directory on localhost with CORS and no cache
http-server ./dist -a 127.0.0.1 -p 8080 -c-1 --cors -s

Starts a static server bound to 127.0.0.1:8080 with caching disabled (-c-1), CORS enabled, and quiet logs (-s).

Proxy unmatched routes to a backend API
http-server ./public -a 127.0.0.1 -p 8080 -P http://127.0.0.1:3000

Serves static assets from ./public and proxies missing paths to a local API server.

Strengths for Agents

  • + Zero-config static server (npx http-server) with -c-1, --cors, and -P proxy support.
  • + Available everywhere via npm and Homebrew.

Caveats & Pitfalls

  • ! Blocking server daemon: hangs synchronous agent shell calls unless launched in the background and cleaned up afterward.
  • ! Binds all interfaces (0.0.0.0) and enables directory indexing by default unless -a 127.0.0.1 and -d false are passed.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI