devtool-mcp-server

v0.18.0
@lynx-js/devtool-mcp-server Checked 9 hours ago Published 4 days ago

A mcp server that lets coding agents to control, operate and preview Lynx pages.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

App_listGlobalSwitch

List all global switch states by querying each supported key.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.

App_getGlobalSwitch

Get global switch state for one key.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
key *stringGlobal switch key. Use `App_listGlobalSwitch` to inspect all keys.

App_setGlobalSwitch

Set global switch state for one key.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
key *stringGlobal switch key. Use `App_listGlobalSwitch` to inspect all keys.
switch *booleanSwitch value (true/false).

CSS_getBackgroundColors

Returns background color information for the node.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

CSS_getComputedStyleForNode

Returns the computed style for a DOM node identified by nodeId.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

CSS_getInlineStylesForNode

Returns inline style and style attribute for the node.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

CSS_getMatchedStylesForNode

Returns CSS rules matching the specified node. The matchedCSSRules in the result are ordered by priority from high to low. When selectors have the same specificity, rules that appear later (further down) have higher priority.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

CSS_getStyleSheetText

Returns the text content of the stylesheet.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
styleSheetId *stringStyle sheet identifier

Debugger_getScriptSource

Get the source code of a script identified by the given script identifier. Use `saveToTmp` if the response is too large.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
scriptId *stringIdentifier of the script. Use `Debugger_listScripts` to get the script IDs of a session.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
saveToTmpbooleanWhether to save the script source to a temporary file if it is large.

Debugger_listScripts

List all parsed scripts. If no scripts found, it means that the page is opened before the DevTool connected. Use `Page_reload` to reload the page and get the scripts again.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

Device_closePage

Close the current page

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.

Device_listClients

List all connected clients. This tool may timeout if no clients are connected or just started.

Device_listDevices

List all connected devices.

Device_listSessions

List all opened sessions

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.

Device_openPage

Open a page

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
url *stringThe URL of the page

DOM_describeNode

Describe a DOM node, optionally including descendants.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
backendNodeIdnumberBackend node identifier.
depthnumberDepth of child nodes to retrieve
nodeIdnumberIdentifier of the node. Unique DOM node identifier.
piercebooleanWhether to pierce through shadow DOM

DOM_getAttributes

Get all attributes of the specified node.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

DOM_getBoxModel

Get the box model of an element.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

DOM_getDocument

Get the document tree of the page.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
depthnumberDepth of child nodes to retrieve

DOM_getDocumentWithBoxModel

Get the document tree of the Lynx page with box model information.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

DOM_getNodeForLocation

Get the node at the specified coordinates.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
x *numberX coordinate
y *numberY coordinate

DOM_getOriginalNodeIndex

Get the original index of the node in its parent.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

DOM_getOriginalNodeSourceInfo

Get source info for an element node. When debug metadata is available, remap it and append repo, source, line, and column.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

DOM_getSearchResults

Get search results for the specified range.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
fromIndex *numberStart index for search results
searchId *number | stringSearch identifier returned by `DOM.performSearch`. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
toIndex *numberEnd index for search results

DOM_innerText

Get the visible text content of the node.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

DOM_performSearch

Search for nodes in the DOM tree.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
query *stringSearch query string
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
includeUserAgentShadowDOMbooleanWhether to include user agent shadow DOM in search

DOM_pushNodesByBackendIdsToFrontend

Push backend node IDs to the frontend for inspection.

ParameterTypeDescription
backendNodeIds *arrayArray of backend node IDs
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

DOM_querySelector

Find the first element matching the CSS selector.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
selector *stringCSS selector string
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
nodeIdnumberIdentifier of the node. Unique DOM node identifier. Defaults to root node if not specified.

DOM_querySelectorAll

Find all elements matching the CSS selector.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
selector *stringCSS selector string
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
nodeIdnumberIdentifier of the node. Unique DOM node identifier. Defaults to root node if not specified.

DOM_requestChildNodes

Request child nodes for a given parent node.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
depthnumberDepth of child nodes to retrieve
piercebooleanWhether to pierce through shadow DOM

DOM_scrollIntoViewIfNeeded

Scrolls the specified rect of the given node into view if not already visible.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
rectobjectThe rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used.

DOM_setAttributesAsText

Set node attributes from a text representation.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
nodeId *numberIdentifier of the node. Unique DOM node identifier.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
text *stringAttribute text, for example `style='color: pink;'`.
namestringOptional attribute name to replace.

Page_getResourceTree

Return the page resource tree for the selected session.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

Page_getResourceContent

Return the content of a page resource by URL or Lynx node id.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
frameIdstringFrame id returned by Page_getResourceTree, when present.
nodeIdnumberLynx node id for engines that resolve resource content by node.
urlstringResource URL returned by Page_getResourceTree.

Page_reload

Reload the current page.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
ignoreCachebooleanWhether to ignore the cache when reloading the page. Defaults to `true`
urlstringThe URL to reload, if different from the current page. Optional.

Page_takeScreenshot

Take a screenshot of the current page.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
screenshotModestringMode for screencast. `lynxview` captures only the viewable area of the page, while `fullscreen` captures the entire page.

Lynx_getVersion

Return the Lynx engine version for the selected session.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

Input_emulateTouchFromMouseEvent

Send one touch gesture event to a Lynx page. For a tap, send mousePressed then mouseReleased at the same coordinates with button left, using the same clientId and sessionId. For a drag, send mouseMoved events between press and release. Send events sequentially with nondecreasing timestamps; after a press, attempt release even if a later gesture step fails. Get coordinates from DOM_getBoxModel and validate the target with DOM_getNodeForLocation before pressing.

ParameterTypeDescription
button *stringMouse button
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
timestamp *numberEvent timestamp in milliseconds since the Unix epoch, as returned by Date.now().
type *stringGesture phase: mousePressed starts a touch, mouseMoved moves a pressed touch, and mouseReleased ends it.
x *numberHorizontal coordinate in CDP logical units, in the same coordinate space as DOM_getBoxModel and DOM_getNodeForLocation. Screenshot pixels are not interchangeable.
y *numberVertical coordinate in CDP logical units, in the same coordinate space as DOM_getBoxModel and DOM_getNodeForLocation. Screenshot pixels are not interchangeable.
deltaXnumberHorizontal scroll delta (optional)
deltaYnumberVertical scroll delta (optional)

Memory_getAllMemoryUsage

Get global Lynx-attributed memory usage across live registered Lynx instances.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionIdintegerCDP session ID. Defaults to -1 for the global DevTool handler. Override only for platform-specific routing.
timeoutMsintegerOptional query timeout in milliseconds. Must be between 0 and 300000.

Runtime_evaluate

Evaluate JavaScript in the selected Lynx VM. Background expressions can directly access lynx and nativeLynx; main-thread expressions are sent unchanged.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
expression *stringJavaScript expression to evaluate.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
awaitPromisebooleanAwait the resulting promise when supported by the engine.
contextIdintegerExecution context id to evaluate in.
generatePreviewbooleanWhether to generate a preview for the result.
includeCommandLineAPIbooleanExpose command line API during evaluation when supported.
objectGroupstringSymbolic group name for released remote objects.
returnByValuebooleanReturn the result by value when supported by the engine.
silentbooleanDo not report or pause on exceptions during evaluation.
threadstringLynx has two Runtime/VM each on a separate thread. Some operations may need to specify the thread. Defaults to 'background'. 'main' for the main thread, 'background' for the background thread.
throwOnSideEffectbooleanThrow if side effects cannot be ruled out.

Runtime_getProperties

Return properties for a Runtime remote object.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
objectId *stringRemote object id returned by Runtime.evaluate or console output.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
accessorPropertiesOnlybooleanReturn accessor properties only when supported.
generatePreviewbooleanWhether to generate previews for property values.
nonIndexedPropertiesOnlybooleanReturn non-indexed properties only when supported.
ownPropertiesbooleanReturn only properties owned by the object.
threadstringLynx has two Runtime/VM each on a separate thread. Some operations may need to specify the thread. Defaults to 'background'. 'main' for the main thread, 'background' for the background thread.

Runtime_listConsole

List console messages with UTC time, level, and VM thread.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
includeStackTracesbooleanBy default, only error messages would contain stack traces. Set this to true to include stack traces for all messages in the output.
levelarrayThe log level to filter messages. Defaults to ['info', 'log', 'warning', 'error']
limitnumberThe maximum number of console messages to return.
offsetnumberThe number of console messages to skip before returning results.
threadarrayVM thread to target: background or main. Defaults to both.

Runtime_getHeapUsage

Returns the JavaScript heap usage for the given session.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
threadstringLynx has two Runtime/VM each on a separate thread. Some operations may need to specify the thread. Defaults to 'background'. 'main' for the main thread, 'background' for the background thread.

Performance_getAllTimingInfo

Get all metric time durations(FR3 / PPE / FCP ..etc)

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

Performance_getAllPerformanceEntries

Get all cached PerformanceEntry objects from the current page.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.

HeapProfiler_takeHeapSnapshot

Take a heap snapshot and save it to a .heapsnapshot file.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.
threadstringLynx has two Runtime/VM each on a separate thread. Some operations may need to specify the thread. Defaults to 'background'. 'main' for the main thread, 'background' for the background thread.

UITree_getLynxUITree

Get the rendered Lynx UI tree with native UI metadata. The metadata fields tagName, nodeIndex, props, and label require Lynx 4.0 or newer.

ParameterTypeDescription
clientId *stringTarget client ID returned by Device_listClients. Pass it through unchanged.
sessionId *numberTarget session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged.