MCP cdp_source_grep

Description

Searches the loaded source map's file contents for a regular expression pattern, across all files or one specific file.

Required parameters:

  • pattern (string): A JavaScript regular expression pattern.

Optional parameters:

  • file (string): Restrict the search to one file.
  • maxResults (integer): Maximum number of matches to return. Defaults to 100.
  • sessionId (string): Session id returned by cdp_session_create. Uses the active session when omitted.

See also

Parameters

additionalProperties: false

NameTypeRequiredValues
patternstringYes
filestringNo
maxResultsintegerNodefault: 100; minimum: 1
sessionIdstringNo

pattern

A JavaScript regular expression pattern

file

Restrict the search to one file: absolute, or relative to the session project root

maxResults

Maximum number of matches to return

sessionId

Session id returned by cdp_session_create. Uses the active session when omitted.


Did this page help you?