About Sncro
Sncro is an open-source relay and browser middleware for coding assistants that need to inspect a running web app. It relays live DOM and console data, with plugins for FastAPI and Flask.
Key features
- 01Live DOM and console data
- 02On-demand page and element queries
- 03FastAPI and Flask middleware
- 04Debug-mode activation
Use cases
- 01Inspect a live page while debugging
- 02Find browser console errors
- 03Query page elements without screenshots
MCP support
The relay exposes an MCP server with tools such as `create_session` and browser-query operations. An injected browser script sends data to the relay, which returns results to MCP clients.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://relay.sncro.net/tools/mcpclaude mcp add --transport http sncro-relay https://relay.sncro.net/tools/mcp{"mcpServers":{"sncro-relay":{"type":"http","url":"https://relay.sncro.net/tools/mcp"}}}Open in Cursor{"servers":{"sncro-relay":{"type":"http","url":"https://relay.sncro.net/tools/mcp"}}}Open in VS Code{"mcpServers":{"sncro-relay":{"type":"http","url":"https://relay.sncro.net/tools/mcp"}}}{"mcpServers":{"sncro-relay":{"serverUrl":"https://relay.sncro.net/tools/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
11| Parameter | Type | Required | Description |
|---|---|---|---|
| brief | boolean | No | |
| git_user | string | No | |
| project_key | string | Yes |
Details
From the project READMEsncro-relay
Open-source components of sncro — the MCP relay, the browser-side agent, and the framework plugins that let AI coding assistants inspect a live browser.
What this repo contains
| Path | What |
|---|---|
relay/ | FastAPI app that exposes an MCP server plus long-poll endpoints for agent.js |
relay/static/agent.js | Browser-side script injected by the middleware; pushes console + DOM data to the relay |
middleware/sncro_middleware.py | FastAPI / Starlette plugin — drop-in middleware for FastAPI apps |
middleware/sncro_flask.py | Flask plugin — drop-in middleware for Flask apps |
trysncro/ | try.sncro.net — a deliberately-broken demo app for exercising sncro end-to-end |
How it works
┌──────────────┐ 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 calls
create_session(MCP tool) → relay returns a 9-digit session key + URL - User visits the URL in the browser where their app is running → confirms via "Allow sncro debugging?"
- The plugin drops a cookie, agent.js is injected into subsequent HTML responses on that origin
- agent.js pushes baseline data (console, errors) and long-polls for on-demand queries (
query_element,get_page_snapshot, etc.)
Using sncro
Most users don't need to run the relay yourself — the hosted version at relay.sncro.net is free-tier friendly. Register your project at sncro.net and grab your project key.
FastAPI: drop middleware/sncro_middleware.py into your project, then:
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: drop middleware/sncro_flask.py into your project, then:
from sncro_flask import init_sncro
app = Flask(__name__)
if app.debug:
init_sncro(app, relay_url="https://relay.sncro.net")
Both middlewares only activate in debug mode — zero overhead in production.
Contributing
We love new framework plugins. CONTRIBUTING.md has the full spec for what a plugin must do — cookies, routes, security headers — plus the test template. Django, Rails, Express, Next.js, ASP.NET, Go — all welcome.
Bug reports and security issues: see SECURITY.md.
License
MIT. See LICENSE.
The dashboard at sncro.net (project management, billing, admin) lives in a separate proprietary repo.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.