live-preview-mcp
Live Preview MCP Server
Version 1.1(红队加固后)——生产级 Model Context Protocol 服务器,允许任何支持 MCP 的 AI 助手启动、管理并在 iframe 中嵌入实时应用预览。
安全加固(v1.1)
无 shell 注入:Docker 和进程派生始终使用参数数组(
shell: false)。安全环境:仅传递显式的环境变量允许列表;危险键(
NODE_OPTIONS、LD_PRELOAD等)会被剔除。符号链接安全的路径检查:在允许列表验证之前调用
realpathSync。WebSocket 速率限制 + 每个预览的连接数上限。
进程存活就绪检查:就绪探针还会验证子进程是否仍然存活。
并发预览限制(默认 10)。
Docker:
CapDrop: ALL、no-new-privileges,尽可能使用非 root 用户,AutoRemove + 启动时孤儿进程回收器。更强的日志脱敏(JWT、AWS 密钥、GitHub/Slack/OpenAI 令牌等)。
令牌长度增加至 32 个随机字节。
Related MCP server: Dynamic Code Executor MCP Server
功能
MCP 工具:
start_preview、stop_preview、get_preview_status、get_preview_logs、list_previews、reload_preview、update_preview_config、share_preview、get_mobile_qr、set_auth_token框架自动检测:Vite、Next.js、CRA、Vue、Angular、Express、static、Expo、Flutter
HTTP 仪表盘 + 反向代理(已移除框架响应头)
可选的 Docker、Cloudflare/ngrok 隧道、移动端二维码、令牌认证、Cloud-IDE 感知
要求
Node.js ≥ 18
可选:Docker、
cloudflared、ngrok
安装与构建
cd live-preview-mcp
npm install
npm run build运行
node dist/index.jsMCP 客户端配置
{
"mcpServers": {
"live-preview": {
"command": "node",
"args": ["/absolute/path/to/live-preview-mcp/dist/index.js"],
"env": {
"PORT": "9000",
"ALLOWED_DIRS": "/path/to/projects"
}
}
}
}许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Build and publish web apps from your AI client: live preview, Postgres, storage, public URL.
Your AI Agent's Infrastructure Layer. Connect Claude, Copilot, Codex, or ChatGPT to 200+ managed open source services. Start databases, pipelines, and applications through natural language.
- PebbleOAuthcom.shippebble
Host the tools your AI builds — small internal tools in isolated microVMs, live for your team.
Host apps built with AI: deploy to a live HTTPS URL, custom domains, secrets and backups.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI assistants to securely execute Python and JavaScript code in sandboxed environments, with file management and package installation.738 npm-
- AlicenseAqualityCmaintenanceEnables AI assistants to execute code in isolated sandboxes with support for Python, JavaScript, and TypeScript, featuring intelligent caching and semantic search for code reuse.9MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to scaffold, edit, live-preview, and deploy full-stack apps with built-in database, email, and push notification capabilities through natural language.19MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to build, deploy, and inspect apps through a hosted backend service, including reading platform docs, deploying raw source, inspecting logs, verifying live pages in browsers, and managing project tasks.MIT