devtool-mcp-server
v0.18.0A 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
App_getGlobalSwitch
Get global switch state for one key.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
key * | string | Global switch key. Use `App_listGlobalSwitch` to inspect all keys. |
App_setGlobalSwitch
Set global switch state for one key.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
key * | string | Global switch key. Use `App_listGlobalSwitch` to inspect all keys. |
switch * | boolean | Switch value (true/false). |
CSS_getBackgroundColors
Returns background color information for the node.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
CSS_getStyleSheetText
Returns the text content of the stylesheet.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
styleSheetId * | string | Style 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
scriptId * | string | Identifier of the script. Use `Debugger_listScripts` to get the script IDs of a session. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
saveToTmp | boolean | Whether 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
Device_closePage
Close the current page
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target 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
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
Device_openPage
Open a page
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
url * | string | The URL of the page |
DOM_describeNode
Describe a DOM node, optionally including descendants.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
backendNodeId | number | Backend node identifier. |
depth | number | Depth of child nodes to retrieve |
nodeId | number | Identifier of the node. Unique DOM node identifier. |
pierce | boolean | Whether to pierce through shadow DOM |
DOM_getAttributes
Get all attributes of the specified node.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
DOM_getBoxModel
Get the box model of an element.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
DOM_getDocument
Get the document tree of the page.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
depth | number | Depth of child nodes to retrieve |
DOM_getDocumentWithBoxModel
Get the document tree of the Lynx page with box model information.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
DOM_getNodeForLocation
Get the node at the specified coordinates.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
x * | number | X coordinate |
y * | number | Y coordinate |
DOM_getOriginalNodeIndex
Get the original index of the node in its parent.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
DOM_getSearchResults
Get search results for the specified range.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
fromIndex * | number | Start index for search results |
searchId * | number | string | Search identifier returned by `DOM.performSearch`. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
toIndex * | number | End index for search results |
DOM_innerText
Get the visible text content of the node.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
DOM_performSearch
Search for nodes in the DOM tree.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
query * | string | Search query string |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
includeUserAgentShadowDOM | boolean | Whether to include user agent shadow DOM in search |
DOM_pushNodesByBackendIdsToFrontend
Push backend node IDs to the frontend for inspection.
| Parameter | Type | Description |
|---|---|---|
backendNodeIds * | array | Array of backend node IDs |
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
DOM_querySelector
Find the first element matching the CSS selector.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
selector * | string | CSS selector string |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
nodeId | number | Identifier of the node. Unique DOM node identifier. Defaults to root node if not specified. |
DOM_querySelectorAll
Find all elements matching the CSS selector.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
selector * | string | CSS selector string |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
nodeId | number | Identifier of the node. Unique DOM node identifier. Defaults to root node if not specified. |
DOM_requestChildNodes
Request child nodes for a given parent node.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
depth | number | Depth of child nodes to retrieve |
pierce | boolean | Whether to pierce through shadow DOM |
DOM_scrollIntoViewIfNeeded
Scrolls the specified rect of the given node into view if not already visible.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
rect | object | The 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
nodeId * | number | Identifier of the node. Unique DOM node identifier. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
text * | string | Attribute text, for example `style='color: pink;'`. |
name | string | Optional attribute name to replace. |
Page_getResourceTree
Return the page resource tree for the selected session.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
frameId | string | Frame id returned by Page_getResourceTree, when present. |
nodeId | number | Lynx node id for engines that resolve resource content by node. |
url | string | Resource URL returned by Page_getResourceTree. |
Page_reload
Reload the current page.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
ignoreCache | boolean | Whether to ignore the cache when reloading the page. Defaults to `true` |
url | string | The URL to reload, if different from the current page. Optional. |
Page_takeScreenshot
Take a screenshot of the current page.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
screenshotMode | string | Mode 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target 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.
| Parameter | Type | Description |
|---|---|---|
button * | string | Mouse button |
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
timestamp * | number | Event timestamp in milliseconds since the Unix epoch, as returned by Date.now(). |
type * | string | Gesture phase: mousePressed starts a touch, mouseMoved moves a pressed touch, and mouseReleased ends it. |
x * | number | Horizontal coordinate in CDP logical units, in the same coordinate space as DOM_getBoxModel and DOM_getNodeForLocation. Screenshot pixels are not interchangeable. |
y * | number | Vertical coordinate in CDP logical units, in the same coordinate space as DOM_getBoxModel and DOM_getNodeForLocation. Screenshot pixels are not interchangeable. |
deltaX | number | Horizontal scroll delta (optional) |
deltaY | number | Vertical scroll delta (optional) |
Memory_getAllMemoryUsage
Get global Lynx-attributed memory usage across live registered Lynx instances.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId | integer | CDP session ID. Defaults to -1 for the global DevTool handler. Override only for platform-specific routing. |
timeoutMs | integer | Optional 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
expression * | string | JavaScript expression to evaluate. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
awaitPromise | boolean | Await the resulting promise when supported by the engine. |
contextId | integer | Execution context id to evaluate in. |
generatePreview | boolean | Whether to generate a preview for the result. |
includeCommandLineAPI | boolean | Expose command line API during evaluation when supported. |
objectGroup | string | Symbolic group name for released remote objects. |
returnByValue | boolean | Return the result by value when supported by the engine. |
silent | boolean | Do not report or pause on exceptions during evaluation. |
thread | string | Lynx 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. |
throwOnSideEffect | boolean | Throw if side effects cannot be ruled out. |
Runtime_getProperties
Return properties for a Runtime remote object.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
objectId * | string | Remote object id returned by Runtime.evaluate or console output. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
accessorPropertiesOnly | boolean | Return accessor properties only when supported. |
generatePreview | boolean | Whether to generate previews for property values. |
nonIndexedPropertiesOnly | boolean | Return non-indexed properties only when supported. |
ownProperties | boolean | Return only properties owned by the object. |
thread | string | Lynx 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
includeStackTraces | boolean | By default, only error messages would contain stack traces. Set this to true to include stack traces for all messages in the output. |
level | array | The log level to filter messages. Defaults to ['info', 'log', 'warning', 'error'] |
limit | number | The maximum number of console messages to return. |
offset | number | The number of console messages to skip before returning results. |
thread | array | VM thread to target: background or main. Defaults to both. |
Runtime_getHeapUsage
Returns the JavaScript heap usage for the given session.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
thread | string | Lynx 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)
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |
thread | string | Lynx 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.
| Parameter | Type | Description |
|---|---|---|
clientId * | string | Target client ID returned by Device_listClients. Pass it through unchanged. |
sessionId * | number | Target session_id returned by Device_listSessions for the selected clientId. Pass it through unchanged. |