文件历史

提交图

14 次代码提交

作者 SHA1 备注 提交日期
Dominik Inführ 5d7b656050 feat: Add MCP tools for heap snapshot comparison (#2198)
This commit adds two MCP tools for comparing heap snapshots.
`compare_heapsnapshot_summary` compares two memory snapshot and returns
which classes have new/deleted objects.
`compare_heapsnapshot_class_nodes` can then be used to list the object
ids added and deleted for a specific class.

Co-authored-by: Dominik Inführ <dinfuehr@chromium.org>
2026-06-30 13:24:21 +00:00
Matt Van Horn cdbc66f160 chore: add ESLint guard against direct third-party imports bypassing bundle (#1189)
## Summary

- Adds a custom ESLint rule `@local/no-direct-third-party-imports` that
flags value imports of bundled third-party packages
(`@modelcontextprotocol/sdk`, `puppeteer-core`, `@puppeteer/browsers`,
`yargs`, `debug`, `zod`, `core-js`) when used outside of
`src/third_party/`
- Type-only imports (`import type`) are allowed since they are erased at
compile time and don't affect the bundle
- The rule is scoped to `src/**/*.ts` so development scripts and tests
are unaffected

This prevents the class of bugs where a direct npm import works during
development (devDependencies installed) but breaks in the published
package (only bundled code ships). PR #1111 was an example of this exact
issue caught through manual `npm pack` testing.

Closes #1123

## Test plan

- [x] Verified `npx eslint --no-cache src/` passes with no violations on
the current codebase
- [x] Verified the rule correctly catches a test file with `import
{Client} from '@modelcontextprotocol/sdk/client/index.js'`
- [x] Verified the rule allows `import type {Flags} from 'lighthouse'`
(type-only import)
- [x] Verified the rule does not fire inside `src/third_party/index.ts`
(the barrel itself)
- [x] Verified scripts/ and tests/ are unaffected (rule scoped to
`src/**/*.ts`)

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-04-01 07:59:11 +00:00
Matt Van Horn 2e1eabac02 chore: add eslint rule to validate tool schema patterns (#1191)
## Summary

- Add `@local/no-zod-nullable-object` ESLint rule that disallows
`.nullable()` and `.object()` usage in tool schema files
(`src/tools/**/*.ts`)
- Fix the existing `zod.object()` violation in `fill_form` by converting
the elements array from objects to `"uid=value"` formatted strings
- Remove the TODO from CONTRIBUTING.md and link the rule name to the
documented restriction

## Context

Per the [PR #1073
review](https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/1073#discussion_r2872188785)
and the CONTRIBUTING.md guidelines, tool schemas should not use
`.nullable()` or `.object()` types. Complex objects should be
represented as short formatted strings instead.

The rule catches:
- `zod.object({...})` / `z.object({...})` - flags direct zod object
schema usage
- `.nullable()` - flags nullable schema usage on any expression

Closes #1076

## Test plan

- [ ] `npx eslint src/tools/` passes with no violations
- [ ] Creating a test file with `zod.object()` or `.nullable()` in
`src/tools/` triggers the rule
- [ ] TypeScript compilation passes (`npx tsc --noEmit`)
- [ ] Existing `fill_form` test updated to use new string format

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-04-01 07:40:32 +00:00
Ewa d19a2350f9 feat: add a skill for detecting memory leaks using take_memory_snapshot tool (#1162)
This PR add a new skill for detecting and removing memory leaks using
take_memory_snapshot tool.

Skill was based on authoritative material from own sources:
* https://developer.chrome.com/docs/devtools/memory-problems
* https://web.dev/articles/effectivemanagement
as well as examples of memory leaks from public domain.

It can be tested with https://github.com/devnook/mem-leak-example.
Example prompt
* A page running at localhost:3000 has memory issues when you click from
home to contact tab and back. Can you fix it?

The skill prefers using comparison tools like memlab instead of custom
evaluate_script snippets to avoid directly reading of .heapsnpashot
files to save context space and tokens.

Fixes #1056

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Yusheng <113574546+yshngg@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
2026-03-24 13:03:05 +00:00
Alex Rudenko dfdac2648e feat: integrate Lighthouse audits (#831)
This PR adds tool to perform navigation and snapshot audits using
Lighthouse for Accessibility, SEO and Best practices. For performance
audits existing tools can be used.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/473
2026-02-26 12:30:45 +00:00
Nicholas Roscino 1a4eaba95b chore: list service workers (#1035)
This PR adds the extension service workers to the output of listPages.
This is available only behind "--category-extensions" flag
2026-02-25 13:49:37 +00:00
Alex Rudenko b204ad7009 build: update verify server.json (#759)
move download to the script, run script without deleting server.json
2026-01-13 10:10:19 +00:00
Nikolay Vitkov 2fd4cc9ac6 chore: restrict DevTools imports (#547) 2025-11-12 10:15:11 +00:00
Alex Rudenko f74ddad29c chore: remove no-restricted-imports rule (#546) 2025-11-12 08:49:53 +00:00
Nikolay Vitkov 04deff21a4 test: add Puppeteer config (#479)
Effectively this means we won't download chrome-headless-shell by
default
2025-10-27 12:41:04 +00:00
Alex Rudenko ad307f6c2d chore: restrict imports outside of the mcp.js (#456) 2025-10-22 14:02:35 +00:00
zyzyzyryxy 6c8432b6b6 refactor: bundle modelcontextprotocol-sdk (#409)
Improve installation time.

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2025-10-17 13:13:15 +00:00
Nikolay Vitkov 15277541d8 chore: add additional EsLint rule (#147) 2025-09-25 17:20:01 +02:00
Alex Rudenko 31a0bdce26 feat: initial version 2025-09-11 12:46:05 +02:00