mcp-file-preview

mcp
Security Audit
Fail
Health Pass
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 24 GitHub stars
Code Fail
  • process.env — Environment variable access in src/index.ts
  • fs.rmSync — Destructive file system operation in test/smoke.mjs
  • process.env — Environment variable access in test/smoke.mjs
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

MCP server that lets a coding model screenshot and inspect local HTML files. Built Dec 2024, retired, kept working.

README.md

mcp-file-preview

An MCP server that lets a coding model see the HTML it writes. It renders a local HTML file in headless Chrome and returns a screenshot, so the model can look at the page and improve it before a person reviews it.

Status: built in December 2024, in under an hour for under $4, and retired once this kind of tooling became standard in model releases. Updated in November 2026 to run on the current MCP SDK, and kept working.

Tools

  • preview_file
    • Arguments: filePath (required), width (default 1280), height (default 800), fullPage (default true), and stylesheets, an optional list of CSS files to inject after the page loads.
    • Returns: the screenshot as a PNG image, the path it was saved to, and the rendered HTML.
  • analyze_content
    • Arguments: filePath (required).
    • Returns: counts of headings, paragraphs, images, and links, as JSON.

Only .html and .htm files are accepted. Relative paths resolve against the server's working directory, which the client chooses, so absolute paths are safer.

Screenshots are saved to mcp-file-preview/ in the system temp folder. Set MCP_FILE_PREVIEW_SCREENSHOT_DIR to save them somewhere else.

Install

Requires Node.js 22.12 or newer. npm install also downloads the Chrome build that Puppeteer uses.

git clone https://github.com/seanivore/mcp-file-preview.git
cd mcp-file-preview
npm install
npm run build
npm test

npm test builds the server, starts it over stdio, and calls both tools on a sample page.

Connect It

Claude Code:

claude mcp add file-preview -- node /absolute/path/to/mcp-file-preview/build/index.js

Claude Desktop, in claude_desktop_config.json:

{
  "mcpServers": {
    "file-preview": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-file-preview/build/index.js"]
    }
  }
}

Other MCP clients take the same command and argument.

Development

  • npm run dev runs the server from source with tsx.
  • npx @modelcontextprotocol/inspector node build/index.js opens the MCP Inspector against the built server.

License

MIT

Reviews (0)

No results found