NAME
mcp-sctl - ScriptCat and sctl Browser WebSocket bridge for MCP
SYNOPSIS
mcp-sctl --stdio
mcp-sctl
mcp-sctl --bind 127.0.0.1:9000
DESCRIPTION
Speak the native sctl WebSocket protocol directly to ScriptCat and sctl Browser. No sctl daemon or control proxy. Both extensions initiate their own connections to the same listener used for authenticated MCP HTTP. The listener defaults to 127.0.0.1:8643, matching ScriptCat's default URL. Keep this server running with --eager when started by mcp-multibroker.
Pair a browser once using the pair MCP tool, then enter the displayed eight-character code in that extension's External Access settings. The code expires after two minutes. Long-term keys are stored in a private JSON file under $XDG_CONFIG_HOME/anyevent-mcp/ (or ~/.config/anyevent-mcp/). A pairing code grants the extension access to the bridge; the MCP permissions independently control what an AI client may call.
list discovers connected instances and their advertised methods; search looks up methods and, when available, parameter/result schemas; call invokes a method with uninterpreted JSON input. Method permission is independent of instance permission. CDP uses the same call tool with debugger.send; there is no Playwright/CDP endpoint or high-level page automation here.
Protocol metadata is advisory, not an authorization source. It is cached under $XDG_CACHE_HOME/anyevent-mcp/ and refreshed over HTTPS as needed. Only methods advertised by the live extension can be invoked, even if a downloaded description lists more.
FIRST USE
With mcp-multibroker, add an eager child:
sctl --- mcp-sctl --- --eager
Stop any running sctl serve first; it normally owns that same port. Print both connection URLs:
mcp-sctl --print-urls
The output includes the ordinary authenticated http:// MCP URL and a credential-free ws://127.0.0.1:8643/ URL for the browser extensions. Only the latter goes into ScriptCat's External Access or sctl Browser. The extension authenticates separately with the pairing HMAC.
Call sctl.pair from your MCP client, then enable External Access in ScriptCat's options and enter the returned code. The extension connects to ws://127.0.0.1:8643/. Call sctl.list to confirm it is online, then sctl.search to find operations and sctl.call to invoke them.
Pair sctl Browser separately, using its popup, only when browser-wide debugging/control is desired. ScriptCat userscript management does not require sctl Browser.
LOGGING
The normal MCP operator log reports listener startup, pairing windows, authenticated instances, disconnects, tool requests and call outcomes. Calls include abbreviated arguments and elapsed time; script listings, source retrieval and searches report counts or ranges, never complete source bodies. Pairing codes and authentication keys are not logged. --quiet suppresses operator activity logging; ordinary debug/trace diagnostics use the configured AnyEvent::Log verbosity.
OPTIONS
Use the shared --bind option for both the extension WebSocket and MCP HTTP listener. --print-url prints both the authenticated MCP endpoint and the token-free extension WebSocket endpoint. The shared switches are documented in "COMMON COMMAND-LINE OPTIONS" in AnyEvent::MCP::Server::Simple.