chrome-devtools-mcp 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -21
- package/{build → out/Default/gen}/src/BrowserManager.js +49 -18
- package/out/Default/gen/src/LogpointManager.js +307 -0
- package/{build → out/Default/gen}/src/McpContext.js +439 -133
- package/{build → out/Default/gen}/src/McpPage.js +368 -59
- package/{build → out/Default/gen}/src/McpResponse.js +90 -47
- package/out/Default/gen/src/NetworkOverrideManager.js +419 -0
- package/{build → out/Default/gen}/src/TextSnapshot.js +37 -18
- package/out/Default/gen/src/ToolHandler.js +512 -0
- package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp-main.js +6 -4
- package/{build → out/Default/gen}/src/bin/chrome-devtools.js +4 -4
- package/{build → out/Default/gen}/src/collectors/PageCollector.js +28 -12
- package/{build → out/Default/gen}/src/collectors/ServiceWorkerCollector.js +2 -2
- package/out/Default/gen/src/collectors/constants.js +7 -0
- package/out/Default/gen/src/config/ConfigParser.js +162 -0
- package/{build → out/Default/gen}/src/config/ConfigWatcher.js +3 -2
- package/out/Default/gen/src/config/ServerConfig.js +251 -0
- package/{build → out/Default/gen}/src/config/browser-options.js +13 -4
- package/{build → out/Default/gen}/src/config/category-options.js +10 -0
- package/{build → out/Default/gen}/src/config/cli-options.js +223 -22
- package/{build → out/Default/gen}/src/config/mcp-options.js +62 -36
- package/{build → out/Default/gen}/src/config/puppeteer-options.js +4 -2
- package/{build → out/Default/gen}/src/daemon/client.js +3 -3
- package/{build → out/Default/gen}/src/daemon/daemon.js +7 -3
- package/{build → out/Default/gen}/src/daemon/utils.js +2 -1
- package/{build → out/Default/gen}/src/devtools/DevToolsCommentBridge.js +28 -5
- package/{build → out/Default/gen}/src/devtools/DevtoolsUtils.js +94 -20
- package/{build → out/Default/gen}/src/formatters/ConsoleFormatter.js +28 -1
- package/{build → out/Default/gen}/src/formatters/HeapSnapshotFormatter.js +14 -18
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/{build → out/Default/gen}/src/formatters/NetworkFormatter.js +70 -17
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +49 -0
- package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
- package/{build → out/Default/gen}/src/formatters/SnapshotFormatter.js +13 -3
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/out/Default/gen/src/index.js +435 -0
- package/out/Default/gen/src/processors/HeapSnapshotManager.js +569 -0
- package/{build → out/Default/gen}/src/telemetry/transformation.js +1 -1
- package/{build → out/Default/gen}/src/third_party/THIRD_PARTY_NOTICES +796 -712
- package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
- package/out/Default/gen/src/third_party/cli.js +9023 -0
- package/out/Default/gen/src/third_party/devtools-formatter-worker.js +31904 -0
- package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +26467 -0
- package/out/Default/gen/src/third_party/index.js +201574 -0
- package/out/Default/gen/src/third_party/lighthouse-devtools-mcp-bundle.js +60395 -0
- package/out/Default/gen/src/tools/ToolDefinition.js +180 -0
- package/{build → out/Default/gen}/src/tools/categories.js +4 -0
- package/{build → out/Default/gen}/src/tools/comments.js +46 -4
- package/{build → out/Default/gen}/src/tools/console.js +8 -6
- package/{build → out/Default/gen}/src/tools/css.js +1 -0
- package/{build → out/Default/gen}/src/tools/emulation.js +5 -4
- package/{build → out/Default/gen}/src/tools/extensions.js +6 -1
- package/{build → out/Default/gen}/src/tools/input.js +23 -28
- package/{build → out/Default/gen}/src/tools/lighthouse.js +30 -8
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/{build → out/Default/gen}/src/tools/memory.js +59 -53
- package/out/Default/gen/src/tools/network.js +260 -0
- package/{build → out/Default/gen}/src/tools/pages.js +48 -6
- package/{build → out/Default/gen}/src/tools/performance.js +33 -7
- package/{build → out/Default/gen}/src/tools/pwa.js +7 -0
- package/{build → out/Default/gen}/src/tools/screencast.js +3 -1
- package/{build → out/Default/gen}/src/tools/screenshot.js +23 -7
- package/{build → out/Default/gen}/src/tools/script.js +38 -6
- package/{build → out/Default/gen}/src/tools/slim/tools.js +21 -5
- package/{build → out/Default/gen}/src/tools/snapshot.js +29 -5
- package/{build → out/Default/gen}/src/tools/thirdPartyDeveloper.js +6 -20
- package/out/Default/gen/src/tools/toolNames.js +10 -0
- package/{build → out/Default/gen}/src/tools/tools.js +4 -0
- package/out/Default/gen/src/tools/webauthn.js +51 -0
- package/{build → out/Default/gen}/src/tools/webmcp.js +5 -19
- package/out/Default/gen/src/utils/TaskRunner.js +151 -0
- package/{build → out/Default/gen}/src/utils/WaitForHelper.js +16 -2
- package/{build → out/Default/gen}/src/utils/bytes.js +2 -12
- package/{build → out/Default/gen}/src/utils/check-for-updates.js +8 -2
- package/out/Default/gen/src/utils/disclaimers.js +27 -0
- package/{build → out/Default/gen}/src/utils/errorHandling.js +3 -0
- package/{build → out/Default/gen}/src/utils/keyboard.js +15 -5
- package/out/Default/gen/src/utils/logger.js +131 -0
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
- package/out/Default/gen/src/utils/resourceType.js +27 -0
- package/out/Default/gen/src/utils/text.js +44 -0
- package/out/Default/gen/src/utils/timeout.js +14 -0
- package/{build → out/Default/gen}/src/utils/url.js +73 -17
- package/{build → out/Default/gen}/src/version.js +1 -1
- package/package.json +26 -32
- package/skills/a11y-debugging/SKILL.md +3 -8
- package/skills/chrome-devtools/SKILL.md +2 -0
- package/skills/chrome-devtools-cli/SKILL.md +12 -1
- package/build/src/ToolHandler.js +0 -360
- package/build/src/config/ConfigParser.js +0 -264
- package/build/src/index.js +0 -282
- package/build/src/processors/HeapSnapshotManager.js +0 -307
- package/build/src/third_party/bundled-packages.json +0 -11
- package/build/src/third_party/devtools-formatter-worker.js +0 -16625
- package/build/src/third_party/devtools-heap-snapshot-worker.js +0 -12084
- package/build/src/third_party/index.js +0 -189603
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +0 -58435
- package/build/src/tools/ToolDefinition.js +0 -92
- package/build/src/tools/network.js +0 -128
- package/build/src/utils/logger.js +0 -62
- package/build/src/utils/text.js +0 -15
- /package/{build → out/Default/gen}/src/McpWorker.js +0 -0
- /package/{build → out/Default/gen}/src/SlimMcpResponse.js +0 -0
- /package/{build → out/Default/gen}/src/bin/check-latest-version.js +0 -0
- /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp.js +0 -0
- /package/{build → out/Default/gen}/src/config/ConfigLocator.js +0 -0
- /package/{build → out/Default/gen}/src/config/cli-commands.js +0 -0
- /package/{build → out/Default/gen}/src/config/tool-options.js +0 -0
- /package/{build → out/Default/gen}/src/daemon/types.js +0 -0
- /package/{build → out/Default/gen}/src/devtools/McpHostBindingAdapter.js +0 -0
- /package/{build → out/Default/gen}/src/devtools/issueDescriptions.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/CommentFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/CssFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/IssueFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/processors/ChunkedTraceParser.js +0 -0
- /package/{build → out/Default/gen}/src/processors/PerformanceTrace.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/ClearcutLogger.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/WatchdogClient.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/errors.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/flagUtils.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/metricsRegistry.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/persistence.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/types.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/watchdog/ClearcutSender.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/watchdog/main.js +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/LowTextContrast.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/bounceTrackingMitigations.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisabledScheme.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisallowedByMode.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsOriginMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspEvalViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspInlineViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspURLViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/deprecation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForNameError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/heavyAd.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/mixedContent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementLowContrast.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleIssue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedArrayBuffer.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetLateImport.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetRequestFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingId.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallNoManifest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +0 -0
- /package/{build → out/Default/gen}/src/types.js +0 -0
- /package/{build → out/Default/gen}/src/utils/files.js +0 -0
- /package/{build → out/Default/gen}/src/utils/id.js +0 -0
- /package/{build → out/Default/gen}/src/utils/pagination.js +0 -0
- /package/{build → out/Default/gen}/src/utils/polyfill.js +0 -0
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
var _a;
|
|
7
|
-
import { yargs, hideBin } from '../third_party/index.js';
|
|
8
|
-
import { readFileSync } from 'node:fs';
|
|
9
|
-
import { mcpOptions, getMcpOptionsForViaCli, CLI_EXAMPLES, CONFLICTING_ARGS, IMPLICATIONS, DEFAULT_FILESYSTEM_ROOT, isReloadableOption, withoutDefaults, } from './mcp-options.js';
|
|
10
|
-
import { getErrorMessage } from '../utils/errorHandling.js';
|
|
11
|
-
import { ConfigLocator } from './ConfigLocator.js';
|
|
12
|
-
function isPlainObject(value) {
|
|
13
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
14
|
-
}
|
|
15
|
-
function stripYargsPositionalArgs(parsed) {
|
|
16
|
-
const copy = { ...parsed };
|
|
17
|
-
delete copy._;
|
|
18
|
-
delete copy.$0;
|
|
19
|
-
return copy;
|
|
20
|
-
}
|
|
21
|
-
function isMcpOptionKey(key) {
|
|
22
|
-
return key in mcpOptions;
|
|
23
|
-
}
|
|
24
|
-
function copyOption(target, source, key) {
|
|
25
|
-
if (key in source) {
|
|
26
|
-
target[key] = source[key];
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
delete target[key];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const explicitArgsByParsed = new WeakMap();
|
|
33
|
-
export class ConfigParser {
|
|
34
|
-
version;
|
|
35
|
-
argv;
|
|
36
|
-
env;
|
|
37
|
-
exitProcess;
|
|
38
|
-
#configPath;
|
|
39
|
-
#usageStatisticsNoticeShown = false;
|
|
40
|
-
configLocator;
|
|
41
|
-
constructor(version, argv = process.argv, env = process.env, exitProcess = true, configLocator) {
|
|
42
|
-
this.version = version;
|
|
43
|
-
this.argv = argv;
|
|
44
|
-
this.env = env;
|
|
45
|
-
this.exitProcess = exitProcess;
|
|
46
|
-
this.configLocator = configLocator ?? new ConfigLocator();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The config file resolved by the last `parse()` call, if any.
|
|
50
|
-
*/
|
|
51
|
-
get configPath() {
|
|
52
|
-
return this.#configPath;
|
|
53
|
-
}
|
|
54
|
-
buildCliParser(options = mcpOptions) {
|
|
55
|
-
const yargsInstance = yargs(hideBin(this.argv));
|
|
56
|
-
return yargsInstance
|
|
57
|
-
.scriptName('npx chrome-devtools-mcp@latest')
|
|
58
|
-
.parserConfiguration({
|
|
59
|
-
'strip-aliased': true,
|
|
60
|
-
'strip-dashed': true,
|
|
61
|
-
})
|
|
62
|
-
.options(options)
|
|
63
|
-
.showHelpOnFail(false, 'Specify --help for available options')
|
|
64
|
-
.example(CLI_EXAMPLES)
|
|
65
|
-
.wrap(Math.min(120, yargsInstance.terminalWidth()))
|
|
66
|
-
.help()
|
|
67
|
-
.version(this.version);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Step 1: parses the CLI flags without applying defaults, so the result only
|
|
71
|
-
* contains what the user passed. `--help` and `--version` print and exit the
|
|
72
|
-
* process; parse errors throw.
|
|
73
|
-
*/
|
|
74
|
-
parseCliArgs() {
|
|
75
|
-
const parsed = this.buildCliParser(withoutDefaults(mcpOptions))
|
|
76
|
-
.fail(false)
|
|
77
|
-
.parseSync();
|
|
78
|
-
return stripYargsPositionalArgs(parsed);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Step 2: reads the JSON config file and runs it through yargs to reject
|
|
82
|
-
* unknown keys and apply coercions, without applying defaults.
|
|
83
|
-
*/
|
|
84
|
-
parseConfigFile(configPath) {
|
|
85
|
-
try {
|
|
86
|
-
const fileContent = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
87
|
-
if (!isPlainObject(fileContent)) {
|
|
88
|
-
throw new Error('Config must be a JSON object');
|
|
89
|
-
}
|
|
90
|
-
const parsed = yargs([])
|
|
91
|
-
.parserConfiguration({
|
|
92
|
-
'strip-aliased': true,
|
|
93
|
-
'camel-case-expansion': false,
|
|
94
|
-
})
|
|
95
|
-
.options(withoutDefaults(mcpOptions))
|
|
96
|
-
.config(fileContent)
|
|
97
|
-
.strict()
|
|
98
|
-
.fail(false)
|
|
99
|
-
.exitProcess(false)
|
|
100
|
-
.parseSync([]);
|
|
101
|
-
return stripYargsPositionalArgs(parsed);
|
|
102
|
-
}
|
|
103
|
-
catch (err) {
|
|
104
|
-
throw new Error(`Invalid JSON config file: ${getErrorMessage(err)}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
warnUnknownArgs(cliArgs) {
|
|
108
|
-
const allowedArgs = new Set(Object.keys(mcpOptions));
|
|
109
|
-
const unknownArgs = Object.keys(cliArgs).filter(arg => !allowedArgs.has(arg));
|
|
110
|
-
if (unknownArgs.length > 0) {
|
|
111
|
-
console.error(`Unknown arguments: ${unknownArgs.map(arg => `--${arg}`)}`);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Step 4: rejects mutually exclusive inputs. Only explicit inputs are checked,
|
|
116
|
-
* so defaults never conflict.
|
|
117
|
-
*/
|
|
118
|
-
static validateConflicts(explicitArgs) {
|
|
119
|
-
const activeArgs = new Set();
|
|
120
|
-
for (const [key, val] of Object.entries(explicitArgs)) {
|
|
121
|
-
if (val !== undefined && val !== false) {
|
|
122
|
-
activeArgs.add(key);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
for (const group of CONFLICTING_ARGS) {
|
|
126
|
-
const activeInGroup = group.filter(arg => activeArgs.has(arg));
|
|
127
|
-
if (activeInGroup.length > 1) {
|
|
128
|
-
const [arg1, arg2] = activeInGroup;
|
|
129
|
-
throw new Error(`Arguments ${String(arg1)} and ${String(arg2)} are mutually exclusive`);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
static validateImplications(explicitArgs) {
|
|
134
|
-
for (const [key, implied] of IMPLICATIONS) {
|
|
135
|
-
const isKeySet = explicitArgs[key] !== undefined && explicitArgs[key] !== false;
|
|
136
|
-
const isImpliedSet = explicitArgs[implied] !== undefined && explicitArgs[implied] !== false;
|
|
137
|
-
if (isKeySet && !isImpliedSet) {
|
|
138
|
-
throw new Error(`Implications failed:\n ${String(key)} -> ${String(implied)}`);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Step 5: fills in defaults for everything that was not set explicitly.
|
|
144
|
-
* `viaCli` is an explicit input like any other; it selects which defaults
|
|
145
|
-
* apply.
|
|
146
|
-
*/
|
|
147
|
-
applyDefaults(explicitArgs) {
|
|
148
|
-
const isViaCli = explicitArgs.viaCli === true;
|
|
149
|
-
const baseOptions = isViaCli ? getMcpOptionsForViaCli() : mcpOptions;
|
|
150
|
-
const resolvedArgs = { ...explicitArgs };
|
|
151
|
-
// `channel` only applies when Chrome is launched by channel. Leaving it
|
|
152
|
-
// unset otherwise keeps it out of telemetry (computeFlagUsage).
|
|
153
|
-
const launchesByChannel = !resolvedArgs.browserUrl &&
|
|
154
|
-
!resolvedArgs.wsEndpoint &&
|
|
155
|
-
!resolvedArgs.executablePath;
|
|
156
|
-
for (const [key, option] of Object.entries(baseOptions)) {
|
|
157
|
-
if (key === 'channel' && !launchesByChannel) {
|
|
158
|
-
continue;
|
|
159
|
-
}
|
|
160
|
-
if (resolvedArgs[key] === undefined &&
|
|
161
|
-
'default' in option) {
|
|
162
|
-
resolvedArgs[key] = option.default;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (isViaCli) {
|
|
166
|
-
if (resolvedArgs.filesystemRoot === DEFAULT_FILESYSTEM_ROOT &&
|
|
167
|
-
explicitArgs.allowUnrestrictedPaths !== false) {
|
|
168
|
-
resolvedArgs.allowUnrestrictedPaths = true;
|
|
169
|
-
resolvedArgs.filesystemRoot = undefined;
|
|
170
|
-
}
|
|
171
|
-
const connectsToExistingBrowser = resolvedArgs.autoConnect ||
|
|
172
|
-
resolvedArgs.browserUrl ||
|
|
173
|
-
resolvedArgs.wsEndpoint;
|
|
174
|
-
if (explicitArgs.isolated === undefined &&
|
|
175
|
-
resolvedArgs.userDataDir === undefined &&
|
|
176
|
-
!connectsToExistingBrowser) {
|
|
177
|
-
resolvedArgs.isolated = true;
|
|
178
|
-
}
|
|
179
|
-
if (resolvedArgs.categoryExtensions === undefined &&
|
|
180
|
-
!connectsToExistingBrowser) {
|
|
181
|
-
resolvedArgs.categoryExtensions = true;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
if (this.env['CI'] || this.env['CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS']) {
|
|
185
|
-
if (!this.#usageStatisticsNoticeShown) {
|
|
186
|
-
this.#usageStatisticsNoticeShown = true;
|
|
187
|
-
console.error("turning off usage statistics. process.env['CI'] || process.env['CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS'] is set.");
|
|
188
|
-
}
|
|
189
|
-
resolvedArgs.usageStatistics = false;
|
|
190
|
-
}
|
|
191
|
-
if (resolvedArgs.categoryExperimentalThirdParty === undefined &&
|
|
192
|
-
this.env['CHROME_DEVTOOLS_MCP_CATEGORY_EXPERIMENTAL_THIRD_PARTY']) {
|
|
193
|
-
resolvedArgs.categoryExperimentalThirdParty = true;
|
|
194
|
-
}
|
|
195
|
-
// The merge and the default loop lose the static type that yargs infers from
|
|
196
|
-
// `mcpOptions`. Every value was produced by the same option definitions (CLI
|
|
197
|
-
// parser, strict config-file parser, option defaults), so the shape matches.
|
|
198
|
-
const parsed = resolvedArgs;
|
|
199
|
-
explicitArgsByParsed.set(parsed, {
|
|
200
|
-
parser: this,
|
|
201
|
-
explicitArgs: { ...explicitArgs },
|
|
202
|
-
});
|
|
203
|
-
return parsed;
|
|
204
|
-
}
|
|
205
|
-
parse() {
|
|
206
|
-
try {
|
|
207
|
-
const cliArgs = this.parseCliArgs();
|
|
208
|
-
this.#configPath = cliArgs.config ?? this.configLocator.locate(this.env);
|
|
209
|
-
this.warnUnknownArgs(cliArgs);
|
|
210
|
-
return this.#resolve(cliArgs);
|
|
211
|
-
}
|
|
212
|
-
catch (error) {
|
|
213
|
-
if (this.exitProcess) {
|
|
214
|
-
console.error(getErrorMessage(error));
|
|
215
|
-
process.exit(1);
|
|
216
|
-
}
|
|
217
|
-
throw error;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Re-reads the config file resolved by `parse()` and merges it with the CLI
|
|
222
|
-
* arguments again. Unlike `parse()`, it does not discover a new config file
|
|
223
|
-
* and throws on invalid configuration instead of exiting the process.
|
|
224
|
-
*/
|
|
225
|
-
reload() {
|
|
226
|
-
return this.#resolve(this.parseCliArgs());
|
|
227
|
-
}
|
|
228
|
-
#resolve(cliArgs) {
|
|
229
|
-
const configPath = this.#configPath;
|
|
230
|
-
const configFileArgs = configPath ? this.parseConfigFile(configPath) : {};
|
|
231
|
-
// Step 3: merges the explicit inputs. The CLI wins over the config file.
|
|
232
|
-
const explicitArgs = {
|
|
233
|
-
...configFileArgs,
|
|
234
|
-
...cliArgs,
|
|
235
|
-
...(configPath ? { config: configPath } : {}),
|
|
236
|
-
};
|
|
237
|
-
_a.validateConflicts(explicitArgs);
|
|
238
|
-
_a.validateImplications(explicitArgs);
|
|
239
|
-
return this.applyDefaults(explicitArgs);
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Merges explicit inputs so that a running server continues with `next` for
|
|
243
|
-
* reloadable options and `previous` for everything else, then validates and
|
|
244
|
-
* applies defaults.
|
|
245
|
-
*/
|
|
246
|
-
static mergeReloadableOptions(previous, next) {
|
|
247
|
-
const previousEntry = explicitArgsByParsed.get(previous);
|
|
248
|
-
const nextEntry = explicitArgsByParsed.get(next);
|
|
249
|
-
const previousExplicit = previousEntry?.explicitArgs ?? previous;
|
|
250
|
-
const nextExplicit = nextEntry?.explicitArgs ?? next;
|
|
251
|
-
const merged = { ...previousExplicit };
|
|
252
|
-
for (const name of Object.keys(mcpOptions)) {
|
|
253
|
-
if (isMcpOptionKey(name) && isReloadableOption(name)) {
|
|
254
|
-
copyOption(merged, nextExplicit, name);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
_a.validateConflicts(merged);
|
|
258
|
-
_a.validateImplications(merged);
|
|
259
|
-
const parser = nextEntry?.parser ?? previousEntry?.parser ?? new _a('');
|
|
260
|
-
return parser.applyDefaults(merged);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
_a = ConfigParser;
|
|
264
|
-
//# sourceMappingURL=ConfigParser.js.map
|
package/build/src/index.js
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import path from 'node:path';
|
|
7
|
-
import { pathToFileURL } from 'node:url';
|
|
8
|
-
import { BrowserManager } from './BrowserManager.js';
|
|
9
|
-
import { loadIssueDescriptions } from './devtools/issueDescriptions.js';
|
|
10
|
-
import { McpContext } from './McpContext.js';
|
|
11
|
-
import { HeapSnapshotManager } from './processors/HeapSnapshotManager.js';
|
|
12
|
-
import { ClearcutLogger } from './telemetry/ClearcutLogger.js';
|
|
13
|
-
import { FilePersistence } from './telemetry/persistence.js';
|
|
14
|
-
import { McpServer as SdkMcpServer, Mutex, puppeteer, } from './third_party/index.js';
|
|
15
|
-
import { ToolHandler } from './ToolHandler.js';
|
|
16
|
-
import { isAvailableInMode, } from './tools/ToolDefinition.js';
|
|
17
|
-
import { createTools } from './tools/tools.js';
|
|
18
|
-
import { logger } from './utils/logger.js';
|
|
19
|
-
import { VERSION } from './version.js';
|
|
20
|
-
puppeteer.setFollowSymlinks(false);
|
|
21
|
-
/**
|
|
22
|
-
* Timeout for a `roots/list` that a tool call is waiting on, matching the 5s
|
|
23
|
-
* default used for page operations. `getContext()` awaits it while
|
|
24
|
-
* `ToolHandler` holds the tool mutex, so leaving it unbounded lets a client
|
|
25
|
-
* that negotiates `roots` but does not answer block every tool for the SDK's
|
|
26
|
-
* default of 60s. Background refreshes are not bounded by this, so roots a
|
|
27
|
-
* slow client sends late still land.
|
|
28
|
-
*/
|
|
29
|
-
const ROOTS_REQUEST_TIMEOUT = 5_000;
|
|
30
|
-
export class McpServer {
|
|
31
|
-
server;
|
|
32
|
-
#serverArgs;
|
|
33
|
-
#browserManager;
|
|
34
|
-
#context;
|
|
35
|
-
#heapSnapshotManager = new HeapSnapshotManager();
|
|
36
|
-
/**
|
|
37
|
-
* Client roots stay valid across browser reconnects and only the client can
|
|
38
|
-
* invalidate them through a `roots/list_changed` notification. CLI-configured
|
|
39
|
-
* roots are read from `#serverArgs` when combining roots.
|
|
40
|
-
*/
|
|
41
|
-
#lastClientRoots;
|
|
42
|
-
#toolMutex = new Mutex();
|
|
43
|
-
#tools = new Map();
|
|
44
|
-
constructor(serverArgs, options) {
|
|
45
|
-
this.#serverArgs = serverArgs;
|
|
46
|
-
this.#browserManager = options.browserManager;
|
|
47
|
-
if (this.#serverArgs.usageStatistics) {
|
|
48
|
-
ClearcutLogger.initialize({
|
|
49
|
-
persistence: new FilePersistence(),
|
|
50
|
-
logFile: this.#serverArgs.logFile,
|
|
51
|
-
appVersion: VERSION,
|
|
52
|
-
clearcutEndpoint: this.#serverArgs.clearcutEndpoint,
|
|
53
|
-
clearcutForceFlushIntervalMs: this.#serverArgs.clearcutForceFlushIntervalMs,
|
|
54
|
-
clearcutIncludePidHeader: this.#serverArgs.clearcutIncludePidHeader,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
this.server = new SdkMcpServer({
|
|
58
|
-
name: 'chrome_devtools',
|
|
59
|
-
title: 'Chrome DevTools MCP server',
|
|
60
|
-
version: VERSION,
|
|
61
|
-
}, {
|
|
62
|
-
capabilities: { logging: {}, tools: { listChanged: true } },
|
|
63
|
-
// Enabling or updating many tools at once sends a single notification.
|
|
64
|
-
debouncedNotificationMethods: ['notifications/tools/list_changed'],
|
|
65
|
-
});
|
|
66
|
-
this.server.server.setRequestHandler('logging/setLevel', () => {
|
|
67
|
-
return {};
|
|
68
|
-
});
|
|
69
|
-
this.server.server.oninitialized = () => {
|
|
70
|
-
const clientName = this.server.server.getClientVersion()?.name;
|
|
71
|
-
if (clientName) {
|
|
72
|
-
ClearcutLogger.get()?.setClientName(clientName);
|
|
73
|
-
}
|
|
74
|
-
if (this.server.server.getClientCapabilities()?.roots) {
|
|
75
|
-
void this.#updateRoots();
|
|
76
|
-
this.server.server.setNotificationHandler('notifications/roots/list_changed', () => {
|
|
77
|
-
void this.#updateRoots();
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
else if (!this.#serverArgs.allowUnrestrictedPaths &&
|
|
81
|
-
(this.#serverArgs.filesystemRoot ?? []).length === 0) {
|
|
82
|
-
console.warn('[chrome-devtools-mcp] The connecting client did not negotiate the MCP roots ' +
|
|
83
|
-
'capability. Tools that read or write local files will be restricted to the OS temp directory. ' +
|
|
84
|
-
'To restore the previous unrestricted behavior, start the server with ' +
|
|
85
|
-
'--allow-unrestricted-paths.');
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
async connect(transport) {
|
|
90
|
-
return await this.server.connect(transport);
|
|
91
|
-
}
|
|
92
|
-
async callTool(name, args = {}) {
|
|
93
|
-
const toolHandler = this.#tools.get(name)?.handler;
|
|
94
|
-
if (!toolHandler) {
|
|
95
|
-
return {
|
|
96
|
-
content: [
|
|
97
|
-
{
|
|
98
|
-
type: 'text',
|
|
99
|
-
text: `Tool ${name} not found`,
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
isError: true,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
const parseResult = await toolHandler.registeredInputSchema.safeParseAsync(args);
|
|
106
|
-
if (!parseResult.success) {
|
|
107
|
-
return {
|
|
108
|
-
content: [
|
|
109
|
-
{
|
|
110
|
-
type: 'text',
|
|
111
|
-
text: `Input validation error: Invalid arguments for tool ${name}: ${parseResult.error.issues
|
|
112
|
-
.map(issue => `${issue.path.length > 0 ? `${issue.path.join('.')}: ` : ''}${issue.message}`)
|
|
113
|
-
.join(', ')}`,
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
isError: true,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
return await toolHandler.handle(parseResult.data);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Closes the MCP connection and disposes internal context/listeners.
|
|
123
|
-
*/
|
|
124
|
-
async close() {
|
|
125
|
-
try {
|
|
126
|
-
this.#context?.dispose();
|
|
127
|
-
}
|
|
128
|
-
catch (err) {
|
|
129
|
-
logger?.('Failed to dispose context', err);
|
|
130
|
-
}
|
|
131
|
-
finally {
|
|
132
|
-
this.#context = undefined;
|
|
133
|
-
}
|
|
134
|
-
this.#heapSnapshotManager.dispose();
|
|
135
|
-
await Promise.allSettled([
|
|
136
|
-
this.#browserManager.close(),
|
|
137
|
-
this.server.close(),
|
|
138
|
-
]);
|
|
139
|
-
}
|
|
140
|
-
[Symbol.dispose]() {
|
|
141
|
-
this.close().catch(err => {
|
|
142
|
-
logger?.('Failed to dispose McpServer', err);
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
async [Symbol.asyncDispose]() {
|
|
146
|
-
await this.close();
|
|
147
|
-
}
|
|
148
|
-
static async from(serverArgs, options) {
|
|
149
|
-
const server = new McpServer(serverArgs, options);
|
|
150
|
-
await server.#init();
|
|
151
|
-
return server;
|
|
152
|
-
}
|
|
153
|
-
async #init() {
|
|
154
|
-
for (const tool of createTools(this.#serverArgs)) {
|
|
155
|
-
// Slim and regular tools may share names, only register the current mode.
|
|
156
|
-
if (isAvailableInMode(tool, this.#serverArgs)) {
|
|
157
|
-
this.#registerTool(tool);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
await loadIssueDescriptions();
|
|
161
|
-
}
|
|
162
|
-
#combinedRoots() {
|
|
163
|
-
const configuredRoots = (this.#serverArgs.allowUnrestrictedPaths
|
|
164
|
-
? []
|
|
165
|
-
: (this.#serverArgs.filesystemRoot ?? [])).map(root => {
|
|
166
|
-
const rootPath = path.resolve(root);
|
|
167
|
-
return {
|
|
168
|
-
uri: pathToFileURL(rootPath).href,
|
|
169
|
-
name: path.basename(rootPath) || rootPath,
|
|
170
|
-
};
|
|
171
|
-
});
|
|
172
|
-
if (configuredRoots.length === 0 && this.#lastClientRoots === undefined) {
|
|
173
|
-
return undefined;
|
|
174
|
-
}
|
|
175
|
-
return [...configuredRoots, ...(this.#lastClientRoots ?? [])];
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* `timeout` is only passed where a tool call is waiting on the result – the
|
|
179
|
-
* background refreshes below block nobody, so bounding them would just discard
|
|
180
|
-
* roots a slow client was about to send
|
|
181
|
-
*/
|
|
182
|
-
async #updateRoots(timeout) {
|
|
183
|
-
if (!this.server.server.getClientCapabilities()?.roots) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
try {
|
|
187
|
-
const result = await this.server.server.request({ method: 'roots/list' }, timeout === undefined ? undefined : { timeout });
|
|
188
|
-
this.#lastClientRoots = result.roots;
|
|
189
|
-
this.#context?.setRoots(this.#combinedRoots());
|
|
190
|
-
}
|
|
191
|
-
catch (e) {
|
|
192
|
-
logger?.('Failed to list roots', e);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
async #getContext() {
|
|
196
|
-
const browser = await this.#browserManager.ensureBrowser();
|
|
197
|
-
if (this.#context?.browser !== browser) {
|
|
198
|
-
this.#context?.dispose();
|
|
199
|
-
this.#context = await McpContext.from(browser, logger, {
|
|
200
|
-
experimentalDevToolsDebugging: this.#serverArgs.experimentalDevtools ?? false,
|
|
201
|
-
experimentalIncludeAllPages: this.#serverArgs.experimentalIncludeAllPages,
|
|
202
|
-
performanceCrux: this.#serverArgs.performanceCrux,
|
|
203
|
-
sourceMaps: this.#serverArgs.sourceMaps,
|
|
204
|
-
allowlist: this.#serverArgs.allowedUrlPattern,
|
|
205
|
-
blocklist: this.#serverArgs.blockedUrlPattern,
|
|
206
|
-
allowUnrestrictedPaths: this.#serverArgs.allowUnrestrictedPaths,
|
|
207
|
-
// Surfaces a one-time note in the next response after a reconnect.
|
|
208
|
-
reconnected: this.#context !== undefined,
|
|
209
|
-
categoryExtensions: this.#serverArgs.categoryExtensions,
|
|
210
|
-
heapSnapshotManager: this.#heapSnapshotManager,
|
|
211
|
-
onNotification: (message) => {
|
|
212
|
-
void this.server
|
|
213
|
-
.sendLoggingMessage({
|
|
214
|
-
level: 'info',
|
|
215
|
-
data: message,
|
|
216
|
-
})
|
|
217
|
-
.catch(e => {
|
|
218
|
-
logger?.('Failed to send MCP notification', e);
|
|
219
|
-
});
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
this.#context.setRoots(this.#combinedRoots());
|
|
223
|
-
if (this.#lastClientRoots === undefined) {
|
|
224
|
-
// Nothing listed yet, so this call has to wait – bounded, since it is
|
|
225
|
-
// holding the tool mutex, and a later background refresh still lands
|
|
226
|
-
await this.#updateRoots(ROOTS_REQUEST_TIMEOUT);
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
// Carry the known roots over and refresh out of band, so a reconnect
|
|
230
|
-
// never pays for a client round-trip
|
|
231
|
-
void this.#updateRoots();
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return this.#context;
|
|
235
|
-
}
|
|
236
|
-
#createToolHandler(tool) {
|
|
237
|
-
return new ToolHandler(tool, this.#serverArgs, () => this.#getContext(), this.#toolMutex, () => this.#browserManager.abandonPendingAttempt());
|
|
238
|
-
}
|
|
239
|
-
#registerTool(tool) {
|
|
240
|
-
const handler = this.#createToolHandler(tool);
|
|
241
|
-
const registeredTool = this.server.registerTool(tool.name, {
|
|
242
|
-
description: tool.description,
|
|
243
|
-
inputSchema: handler.registeredInputSchema,
|
|
244
|
-
annotations: tool.annotations,
|
|
245
|
-
}, handler.handle);
|
|
246
|
-
if (handler.disabled) {
|
|
247
|
-
registeredTool.disable();
|
|
248
|
-
}
|
|
249
|
-
this.#tools.set(tool.name, { handler, registeredTool });
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Creates and initializes a Chrome DevTools MCP server instance.
|
|
254
|
-
*
|
|
255
|
-
* Maintained as a public API for backwards compatibility because external
|
|
256
|
-
* consumers and integrations rely on `createMcpServer()`. For new code,
|
|
257
|
-
* prefer using `McpServer.from(serverArgs, options)`.
|
|
258
|
-
*/
|
|
259
|
-
export async function createMcpServer(serverArgs, options) {
|
|
260
|
-
const browserManager = new BrowserManager(serverArgs, {
|
|
261
|
-
logFile: options.logFile,
|
|
262
|
-
});
|
|
263
|
-
const server = await McpServer.from(serverArgs, {
|
|
264
|
-
browserManager,
|
|
265
|
-
...options,
|
|
266
|
-
});
|
|
267
|
-
return { server: server.server };
|
|
268
|
-
}
|
|
269
|
-
export const logDisclaimers = (args) => {
|
|
270
|
-
console.error(`chrome-devtools-mcp exposes content of the browser instance to the MCP clients allowing them to inspect,
|
|
271
|
-
debug, and modify any data in the browser or DevTools.
|
|
272
|
-
Avoid sharing sensitive or personal information that you do not want to share with MCP clients.`);
|
|
273
|
-
if (!args.slim && args.performanceCrux) {
|
|
274
|
-
console.error(`Performance tools may send trace URLs to the Google CrUX API to fetch real-user experience data. To disable, run with --no-performance-crux.`);
|
|
275
|
-
}
|
|
276
|
-
if (!args.slim && args.usageStatistics) {
|
|
277
|
-
console.error(`
|
|
278
|
-
Google collects usage statistics to improve Chrome DevTools MCP. To opt-out, run with --no-usage-statistics.
|
|
279
|
-
For more details, visit: https://github.com/ChromeDevTools/chrome-devtools-mcp#usage-statistics`);
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
//# sourceMappingURL=index.js.map
|