MCP
Start Lightpanda as a Model Context Protocol (MCP) server. Defaults to stdio; pass --port to serve over HTTP with an independent browsing session per client. See how to run the MCP server for practical documentation.
Options
usage: lightpanda mcp [OPTIONS] [COMMON_OPTIONS]
options:
--cdp-port <INT>
Also run a CDP (WebSocket) server on this port. Cannot be
combined with --port (they share one network listener).
Defaults to disabled.
--host <HOST>
Host to bind when --port is set (e.g. 0.0.0.0 for all interfaces).
Defaults to "127.0.0.1".
--http-session-timeout <INT>
Seconds before an idle HTTP session (--port) is closed. A later
request with its Mcp-Session-Id gets 404, so the client starts
a new session. The default session is never closed; only its
pages are, and it keeps its cookies.
Defaults to 0, which disables it (sessions live until closed).
--list-tools
Print every tool name, comma-separated as --tools takes them,
and exit.
--port <INT>
Serve MCP over HTTP on this port instead of stdio. Clients POST
JSON-RPC to /mcp; route requests to a session with the
Mcp-Session-Id header.
Defaults to stdio (no HTTP server).
--tools <NAME>
Expose only this tool. Can be passed multiple times, and each
value can be a comma-separated list, e.g. --tools goto,tree,click.
The others are neither listed nor callable, which keeps their
definitions out of the client's context. It is not a sandbox:
a listed tool keeps its full reach (run and waitForScript
execute scripts, markdown takes a url), and resources are
unaffected. See --list-tools for the names.
Defaults to every tool.The command also accepts the common options.
Find the available tools in the MCP tools reference.
Replies over HTTP
With --port, a client whose Accept header lists text/event-stream can get the reply as an event stream: once a call sends a notification, such as the console lines run prints, or runs longer than 15 seconds, the reply switches to text/event-stream, with keep-alive comments while the call runs.
To cancel a call in flight, POST a notifications/cancelled message with its requestId; the server answers with a 202.