sncro
sncro-relay
sncro 的开源组件 — 包括 MCP 中继、浏览器端代理以及让 AI 编程助手能够检查实时浏览器的框架插件。
本仓库包含内容
路径 | 内容 |
| 提供 MCP 服务器以及 agent.js 长轮询端点的 FastAPI 应用 |
| 由中间件注入的浏览器端脚本;将控制台和 DOM 数据推送到中继 |
| FastAPI / Starlette 插件 — 适用于 FastAPI 应用的即插即用中间件 |
| Flask 插件 — 适用于 Flask 应用的即插即用中间件 |
|
|
Related MCP server: agnt
工作原理
┌──────────────┐ MCP ┌──────────┐ long-poll ┌─────────────┐
│ Claude Code │──tools────▶│ relay │◀──────────────│ agent.js │
│ (or other │ │ (relay/) │ snapshots │ (injected │
│ MCP client) │◀──results──│ │──────────────▶│ by plugin) │
└──────────────┘ └──────────┘ └─────────────┘
▲
│ same-origin
│ cookies
┌─────────────┐
│ your app │
│ (plugin is │
│ installed) │
└─────────────┘Claude 调用
create_session(MCP 工具) → 中继返回一个 9 位数的会话密钥和 URL用户在运行其应用的浏览器中访问该 URL → 通过“允许 sncro 调试?”进行确认
插件设置一个 cookie,agent.js 会被注入到该源后续的 HTML 响应中
agent.js 推送基准数据(控制台、错误)并长轮询按需查询(
query_element、get_page_snapshot等)
使用 sncro
大多数用户无需自行运行中继 — relay.sncro.net 上的托管版本对免费层级非常友好。在 sncro.net 注册您的项目并获取项目密钥。
FastAPI: 将 middleware/sncro_middleware.py 放入您的项目中,然后:
from middleware.sncro_middleware import SncroMiddleware, sncro_routes
app = FastAPI(debug=True) # sncro only loads when debug=True
if app.debug:
app.include_router(sncro_routes)
app.add_middleware(SncroMiddleware, relay_url="https://relay.sncro.net")Flask: 将 middleware/sncro_flask.py 放入您的项目中,然后:
from sncro_flask import init_sncro
app = Flask(__name__)
if app.debug:
init_sncro(app, relay_url="https://relay.sncro.net")两种中间件仅在调试模式下激活 — 在生产环境中零开销。
贡献
我们欢迎新的框架插件。CONTRIBUTING.md 包含了插件必须执行的操作的完整规范(cookie、路由、安全标头)以及测试模板。欢迎 Django、Rails、Express、Next.js、ASP.NET、Go 等各种框架。
错误报告和安全问题:请参阅 SECURITY.md。
许可证
MIT。请参阅 LICENSE。
位于 sncro.net 的仪表板(项目管理、计费、管理)位于一个单独的专有仓库中。
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
Monitoring + status pages set up by talking to Claude. Auto-detects 30+ SDKs and your URLs.
AI visibility & recommendation monitoring for ChatGPT, Claude, Gemini & Perplexity.
Screenshot, PDF and HTML-to-image rendering API so Claude and Cursor can see any web page.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to debug frontend applications by providing direct access to browser DevTools, React state, DOM inspection, and runtime debugging capabilities. Bridges the gap between AI and complex web applications for autonomous debugging and issue resolution.MIT
- AlicenseNot gradedqualityAmaintenanceBridges AI coding agents with the browser to provide visual debugging, real-time error capture, screenshot capabilities, DOM inspection, and interactive wireframing through a reverse proxy with injected developer tools.34 npm21Apache 2.0
- FlicenseNot gradedqualityCmaintenanceGives AI coding assistants live, structured access to running apps' state and UI elements, enabling real-time verification and interaction across web, mobile, and desktop.36-
- AlicenseNot gradedqualityDmaintenanceEnables AI coding agents to visually interact with frontend apps by taking screenshots, clicking elements, reading console logs, and performing visual diffs.12 npm3MIT