frameshot

frameshot

Enables AI agents to render and screenshot isolated UI components instantly across multiple browsers without a dev server or Storybook.

Category
访问服务器

README

frameshot

npm version npm downloads GitHub stars License: MIT

Give your AI agent eyes. Render any component — with real imports, Tailwind, and CSS Modules resolved via Vite — directly in your terminal or AI chat. No stories. No config. Just point at a file.

<p align="center"> <img src="docs/demo.gif" alt="frameshot demo" width="720" /> </p>

Claude Code

claude mcp add frameshot -- npx frameshot-mcp@latest

<details> <summary>Cursor · VS Code · Windsurf · Cline</summary>

{
  "mcpServers": {
    "frameshot": {
      "command": "npx",
      "args": ["frameshot-mcp@latest"]
    }
  }
}

</details>


Using with Claude

Once installed, just tell Claude what you want:

"Render src/components/PricingCard.tsx and check the layout looks right"
"Refactor the dashboard to use CSS grid — render it before and after and make sure nothing broke"
"Show me all components in src/components/ as screenshots"

Claude will automatically call render_file, diff_component, or render_catalog as needed. No manual tool calls required.


Render

Point to a file. Get a screenshot. All imports resolved.

render_file("src/components/Dashboard.tsx")

<p align="center"> <img src="docs/example-output.png" alt="Rendered PricingCard with full Tailwind styling" width="280" /> </p>

Real Tailwind. Real CSS Modules. Real dependencies — not a CDN polyfill.


Visual diff

Catch regressions before you ship. Before / after / changed pixels — all at once.

<p align="center"> <img src="docs/diff-before.png" alt="Before" width="210" />   <img src="docs/diff-after.png" alt="After" width="210" />   <img src="docs/diff-result.png" alt="Diff" width="210" /> </p>

diff_component("src/components/MetricCard.tsx")
→ 0.7% changed

Tools

Tool What it does
render_file Render a file via Vite — full dep resolution, props support
render_component Render a self-contained snippet (React / Vue / Svelte / HTML)
screenshot_url Screenshot any URL — localhost, staging, prod
diff_component Pixel diff before/after with % changed
render_responsive Mobile + tablet + desktop in one call
render_theme Light + dark mode side by side
audit_a11y axe-core accessibility audit (WCAG)
render_catalog Render every component in a directory

<details> <summary>All 18 tools</summary>

Tool What it does
render_file Render a project file with full Vite dependency resolution
render_component Render a self-contained snippet → screenshot
screenshot_url Screenshot any URL with retry and network idle wait
render_responsive Mobile + tablet + desktop in one call
render_variants Multiple prop/state variants at once
render_theme Light + dark mode side by side
render_interaction Simulate click/hover/type, then screenshot
render_grid Multiple snippets in a labeled grid
render_matrix Viewport × theme matrix in one call
capture_animation Multi-frame CSS animation capture
diff_component Before/after pixel diff with % changed
diff_reference Compare render against a reference image (Figma QA)
audit_a11y axe-core accessibility audit
perf_audit DOM count, depth, render timing
render_catalog Render all components in a directory
snapshot_save Save a render as named baseline
snapshot_check Compare current render against saved baseline
snapshot_list List all saved snapshots

</details>


CLI

No AI client required. Use frameshot standalone:

npx frameshot render src/components/Button.tsx
npx frameshot render src/Card.tsx --props '{"title":"Hello"}'
npx frameshot catalog src/components/ --recursive
npx frameshot diff src/components/Header.tsx

Images display inline in iTerm2, Kitty, and Sixel terminals. Saved to .frameshot/ by default.


GitHub Action

Free Chromatic alternative. Auto-posts before/after screenshots with diff on every PR:

# .github/workflows/visual-preview.yml
name: Visual Preview
on: [pull_request]
jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: kamegoro/frameshot@main
        with:
          paths: "./src/components/*.tsx"

Performance

Typical measured times (varies by machine and project size):

Scenario Time
Warm render (Vite server cached) ~200–500ms
CDN fallback (no Vite) ~120ms
Cold start (first render) ~1–3s
Subsequent renders (same session) ~200ms

Vite server is cached per project root. Browser pool stays warm between MCP calls.


vs. alternatives

Storybook Chromatic Browser MCP frameshot
Setup Stories + config SaaS signup Browser install npx — done
Speed Dev server startup Cloud round-trip 2–5s ~200ms warm
Cost Free (labor cost) $149–800+/mo Free Free forever
Stories needed Yes Yes No No
Real imports Via Storybook Via Storybook No Via Vite
Works offline Yes No Yes Yes
AI-native (MCP) No No Full-page only Component-level

Development

git clone https://github.com/kamegoro/frameshot.git
cd frameshot && npm install
npx playwright install chromium
npm run build && npm test

See CONTRIBUTING.md for architecture details.


MIT © kamegoro

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选