Skip to content

Commit 01b2c4b

Browse files
author
Test
committed
2 parents eded1ae + 3fc6c82 commit 01b2c4b

20 files changed

+656
-142
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.10.1"
2+
".": "0.10.2"
33
}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## [0.10.2](https://github.com/ChromeDevTools/chrome-devtools-mcp/compare/chrome-devtools-mcp-v0.10.1...chrome-devtools-mcp-v0.10.2) (2025-11-19)
4+
5+
6+
### 📄 Documentation
7+
8+
* add Factory CLI configuration to MCP clients ([#523](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/523)) ([016e2fd](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/016e2fd6ee57447103f7385285dd503b5576a860))
9+
10+
11+
### ♻️ Chores
12+
13+
* clear issue aggregator on page navigation ([#565](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/565)) ([c3784d1](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/c3784d1990a926f651951e4eef05520c5c448964))
14+
* disable issues in list_console_messages for now ([#575](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/575)) ([08e9a9f](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/08e9a9f42e6ff1a92c60b3e958b0817c7b785afc))
15+
* simplify issue management ([#564](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/564)) ([3b016f1](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/3b016f1a814b1a69750813548b3f35e79bfb6fef))
16+
317
## [0.10.1](https://github.com/ChromeDevTools/chrome-devtools-mcp/compare/chrome-devtools-mcp-v0.10.0...chrome-devtools-mcp-v0.10.1) (2025-11-07)
418

519

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chrome-devtools-mcp",
3-
"version": "0.10.1",
3+
"version": "0.10.2",
44
"description": "MCP server for Chrome DevTools",
55
"type": "module",
66
"bin": "./build/src/index.js",
@@ -52,7 +52,7 @@
5252
"@types/yargs": "^17.0.33",
5353
"@typescript-eslint/eslint-plugin": "^8.43.0",
5454
"@typescript-eslint/parser": "^8.43.0",
55-
"chrome-devtools-frontend": "1.0.1543472",
55+
"chrome-devtools-frontend": "1.0.1544076",
5656
"core-js": "3.46.0",
5757
"debug": "4.4.3",
5858
"eslint": "^9.35.0",

scripts/post-build.ts

Lines changed: 23 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -53,69 +53,22 @@ function main(): void {
5353

5454
// Create i18n mock
5555
const i18nDir = path.join(BUILD_DIR, devtoolsFrontEndCorePath, 'i18n');
56-
fs.mkdirSync(i18nDir, {recursive: true});
57-
const i18nFile = path.join(i18nDir, 'i18n.js');
58-
const i18nContent = `
59-
export const i18n = {
60-
registerUIStrings: () => {},
61-
getLocalizedString: (_, str) => {
62-
// So that the string passed in gets output verbatim.
63-
return str;
64-
},
65-
lockedLazyString: () => {},
66-
getLazilyComputedLocalizedString: () => {},
67-
};
68-
69-
// TODO(jacktfranklin): once the DocumentLatency insight does not depend on
70-
// this method, we can remove this stub.
71-
export const TimeUtilities = {
72-
millisToString(x) {
73-
const separator = '\xA0';
74-
const formatter = new Intl.NumberFormat('en-US', {
75-
style: 'unit',
76-
unitDisplay: 'narrow',
77-
minimumFractionDigits: 0,
78-
maximumFractionDigits: 1,
79-
unit: 'millisecond',
80-
});
81-
82-
const parts = formatter.formatToParts(x);
83-
for (const part of parts) {
84-
if (part.type === 'literal') {
85-
if (part.value === ' ') {
86-
part.value = separator;
87-
}
88-
}
89-
}
56+
const localesFile = path.join(i18nDir, 'locales.js');
57+
const localesContent = `
58+
export const LOCALES = [
59+
'en-US',
60+
];
9061
91-
return parts.map(part => part.value).join('');
92-
}
93-
};
94-
95-
// TODO(jacktfranklin): once the ImageDelivery insight does not depend on this method, we can remove this stub.
96-
export const ByteUtilities = {
97-
bytesToString(x) {
98-
const separator = '\xA0';
99-
const formatter = new Intl.NumberFormat('en-US', {
100-
style: 'unit',
101-
unit: 'kilobyte',
102-
unitDisplay: 'narrow',
103-
minimumFractionDigits: 1,
104-
maximumFractionDigits: 1,
105-
});
106-
const parts = formatter.formatToParts(x / 1000);
107-
for (const part of parts) {
108-
if (part.type === 'literal') {
109-
if (part.value === ' ') {
110-
part.value = separator;
111-
}
112-
}
113-
}
62+
export const BUNDLED_LOCALES = [
63+
'en-US',
64+
];
11465
115-
return parts.map(part => part.value).join('');
116-
}
117-
};`;
118-
writeFile(i18nFile, i18nContent);
66+
export const DEFAULT_LOCALE = 'en-US';
67+
68+
export const REMOTE_FETCH_PATTERN = '@HOST@/remote/serve_file/@VERSION@/core/i18n/locales/@[email protected]';
69+
70+
export const LOCAL_FETCH_PATTERN = './locales/@[email protected]';`;
71+
writeFile(localesFile, localesContent);
11972

12073
// Create codemirror.next mock.
12174
const codeMirrorDir = path.join(
@@ -169,6 +122,15 @@ export const hostConfig = {};
169122
fs.copyFileSync(devtoolsLicenseFileSource, devtoolsLicenseFileDestination);
170123

171124
copyThirdPartyLicenseFiles();
125+
copyDevToolsDescriptionFiles();
126+
}
127+
128+
function copyDevToolsDescriptionFiles() {
129+
const devtoolsIssuesDescriptionPath =
130+
'node_modules/chrome-devtools-frontend/front_end/models/issues_manager/descriptions';
131+
const sourceDir = path.join(process.cwd(), devtoolsIssuesDescriptionPath);
132+
const destDir = path.join(BUILD_DIR, devtoolsIssuesDescriptionPath);
133+
fs.cpSync(sourceDir, destDir, {recursive: true});
172134
}
173135

174136
main();

server.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
{
22
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
33
"name": "io.github.ChromeDevTools/chrome-devtools-mcp",
4+
"title": "Chrome DevTools MCP",
45
"description": "MCP server for Chrome DevTools",
56
"repository": {
67
"url": "https://github.com/ChromeDevTools/chrome-devtools-mcp",
78
"source": "github"
89
},
9-
"version": "0.10.1",
10+
"version": "0.10.2",
1011
"packages": [
1112
{
1213
"registryType": "npm",
1314
"registryBaseUrl": "https://registry.npmjs.org",
1415
"identifier": "chrome-devtools-mcp",
15-
"version": "0.10.1",
16+
"version": "0.10.2",
1617
"transport": {
1718
"type": "stdio"
1819
},

src/DevtoolsUtils.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
7+
import {
8+
type Issue,
9+
type IssuesManagerEventTypes,
10+
Common,
11+
I18n,
12+
} from '../node_modules/chrome-devtools-frontend/mcp/mcp.js';
13+
614
export function extractUrlLikeFromDevToolsTitle(
715
title: string,
816
): string | undefined {
@@ -49,3 +57,24 @@ function normalizeUrl(url: string): string {
4957

5058
return result;
5159
}
60+
61+
/**
62+
* A mock implementation of an issues manager that only implements the methods
63+
* that are actually used by the IssuesAggregator
64+
*/
65+
export class FakeIssuesManager extends Common.ObjectWrapper
66+
.ObjectWrapper<IssuesManagerEventTypes> {
67+
issues(): Issue[] {
68+
return [];
69+
}
70+
}
71+
72+
I18n.DevToolsLocale.DevToolsLocale.instance({
73+
create: true,
74+
data: {
75+
navigatorLanguage: 'en-US',
76+
settingLanguage: 'en-US',
77+
lookupClosestDevToolsLocale: l => l,
78+
},
79+
});
80+
I18n.i18n.registerLocaleDataForTest('en-US', {});

src/McpContext.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import fs from 'node:fs/promises';
77
import os from 'node:os';
88
import path from 'node:path';
99

10+
import {type AggregatedIssue} from '../node_modules/chrome-devtools-frontend/mcp/mcp.js';
11+
1012
import {extractUrlLikeFromDevToolsTitle, urlsEqual} from './DevtoolsUtils.js';
1113
import type {ListenerMap} from './PageCollector.js';
12-
import {NetworkCollector, PageCollector} from './PageCollector.js';
14+
import {NetworkCollector, ConsoleCollector} from './PageCollector.js';
1315
import {Locator} from './third_party/index.js';
1416
import type {
1517
Browser,
@@ -92,7 +94,7 @@ export class McpContext implements Context {
9294
// The most recent snapshot.
9395
#textSnapshot: TextSnapshot | null = null;
9496
#networkCollector: NetworkCollector;
95-
#consoleCollector: PageCollector<ConsoleMessage | Error>;
97+
#consoleCollector: ConsoleCollector;
9698

9799
#isRunningTrace = false;
98100
#networkConditionsMap = new WeakMap<Page, string>();
@@ -122,7 +124,7 @@ export class McpContext implements Context {
122124
this.#options.experimentalIncludeAllPages,
123125
);
124126

125-
this.#consoleCollector = new PageCollector(
127+
this.#consoleCollector = new ConsoleCollector(
126128
this.browser,
127129
collect => {
128130
return {
@@ -138,6 +140,9 @@ export class McpContext implements Context {
138140
collect(error);
139141
}
140142
},
143+
issue: event => {
144+
collect(event);
145+
},
141146
} as ListenerMap;
142147
},
143148
this.#options.experimentalIncludeAllPages,
@@ -150,6 +155,11 @@ export class McpContext implements Context {
150155
await this.#consoleCollector.init();
151156
}
152157

158+
dispose() {
159+
this.#networkCollector.dispose();
160+
this.#consoleCollector.dispose();
161+
}
162+
153163
static async from(
154164
browser: Browser,
155165
logger: Debugger,
@@ -205,16 +215,18 @@ export class McpContext implements Context {
205215

206216
getConsoleData(
207217
includePreservedMessages?: boolean,
208-
): Array<ConsoleMessage | Error> {
218+
): Array<ConsoleMessage | Error | AggregatedIssue> {
209219
const page = this.getSelectedPage();
210220
return this.#consoleCollector.getData(page, includePreservedMessages);
211221
}
212222

213-
getConsoleMessageStableId(message: ConsoleMessage | Error): number {
223+
getConsoleMessageStableId(
224+
message: ConsoleMessage | Error | AggregatedIssue,
225+
): number {
214226
return this.#consoleCollector.getIdForResource(message);
215227
}
216228

217-
getConsoleMessageById(id: number): ConsoleMessage | Error {
229+
getConsoleMessageById(id: number): ConsoleMessage | Error | AggregatedIssue {
218230
return this.#consoleCollector.getById(this.getSelectedPage(), id);
219231
}
220232

0 commit comments

Comments
 (0)