create_sessionLABSCO SUMMARY
It reads your real session, not a fresh headless one.
Because the script is injected same-origin by your own middleware, it inherits the cookies you are already logged in with — which is exactly the state a bug usually lives in, and the state a headless browser has to be laboriously talked into. The trade is that it only works on apps you can add middleware to, and only in debug mode; there is no overhead in production because the plugin never loads there.
What it is
A relay that connects an MCP client to a live browser session on your own app. A small middleware injects a script into your pages in debug mode; the script pushes console output and DOM data to the relay, and the assistant reads it through MCP tools.
What you get
create_sessionreturns a 9-digit session key and a URL; you open it in the browser where your app is running and confirm the promptget_page_snapshotandquery_elementpull page state on demand, while console output and errors are pushed as baseline data- Drop-in middleware for FastAPI and Starlette, and a separate plugin for Flask
- The browser side runs inside your own origin, so it sees the page as your logged-in session sees it
Requirements
A hosted relay at https://relay.sncro.net/tools/mcp over streamable HTTP, at version 0.9.4 — most people never run the relay themselves. Register the project at sncro.net to get a project key. On the app side, add the middleware file to your project and enable it behind your debug flag: FastAPI takes SncroMiddleware plus sncro_routes, Flask calls init_sncro with the app and the relay URL. Both activate only in debug mode.
Setup effort
Follow the published steps
USE CASES
Debugging an error that only happens when logged in
Start a session in the tab you are already authenticated in and let the assistant read the console from there.
Asking what the page actually rendered
Pull a snapshot of the live DOM instead of describing the screen to the assistant by hand.
Checking one element's real state
Query a single element to see whether it exists, and what it holds, at this moment.
3 tools
Listed in project docs. Your client may show a different list.
query_elementget_page_snapshotBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
INSTALLATION
Connect your client
Server setup
Register your project at sncro.net and grab your project key (the hosted relay at relay.sncro.net is free-tier friendly, so you do not need to run the relay yourself)
FastAPI: drop middleware/sncro_middleware.py into your project, then in your app add: from middleware.sncro_middleware import SncroMiddleware, sncro_routes / app = FastAPI(debug=True) / if app.debug: app.include_router(sncro_routes); app.add_middleware(SncroMiddleware, relay_url="https://relay.sncro.net")
Flask alternative: 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")
Claude calls create_session (MCP tool); the relay returns a 9-digit session key + URL
Visit that URL in the browser where your app is running and confirm via "Allow sncro debugging?"