Skip to content

Commit 74fcf9d

Browse files
committed
chore: fix linting/formatting for remote debugging example
1 parent bae0694 commit 74fcf9d

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

docs/troubleshooting.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ Point the MCP connection inside the VM to `http://127.0.0.1:9222`. This allows D
8989
If you want `chrome-devtools-mcp` to attach to an existing Chrome instance, start Chrome with remote debugging enabled, then pass `--browserUrl`.
9090

9191
1. Start Chrome with a remote debugging port:
92-
9392
- Linux:
93+
9494
```sh
9595
google-chrome --remote-debugging-port=9222
9696
```
@@ -101,7 +101,6 @@ If you want `chrome-devtools-mcp` to attach to an existing Chrome instance, star
101101
```
102102

103103
2. Verify the endpoint is reachable:
104-
105104
- `http://127.0.0.1:9222/json/version` should return JSON
106105

107106
3. Start the MCP server and point it at the debugging endpoint:

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default defineConfig([
3232
'puppeteer.config.cjs',
3333
'eslint.config.mjs',
3434
'rollup.config.mjs',
35+
'examples/remote-debugging-9222.mjs',
3536
],
3637
},
3738
},

examples/remote-debugging-9222.mjs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
17
// Example: connect to a Chrome instance that was started with a remote debugging port,
28
// using the official MCP TypeScript SDK.
39
//
@@ -15,8 +21,8 @@
1521
// For SDK details, see:
1622
// https://modelcontextprotocol.io/docs/develop/build-client#typescript
1723

18-
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
19-
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
24+
import {Client} from '@modelcontextprotocol/sdk/client/index.js';
25+
import {StdioClientTransport} from '@modelcontextprotocol/sdk/client/stdio.js';
2026

2127
const DEBUG_URL = process.env.CHROME_DEBUG_URL ?? 'http://127.0.0.1:9222';
2228

@@ -31,14 +37,14 @@ const transport = new StdioClientTransport({
3137
});
3238

3339
const client = new Client(
34-
{ name: 'remote-debugging-9222', version: '0.0.0' },
35-
{ capabilities: {} },
40+
{name: 'remote-debugging-9222', version: '0.0.0'},
41+
{capabilities: {}},
3642
);
3743

3844
try {
3945
await client.connect(transport);
4046

41-
const { tools } = await client.listTools();
47+
const {tools} = await client.listTools();
4248
console.log(`Connected to ${DEBUG_URL}. Found ${tools.length} tools.`);
4349

4450
for (const tool of tools.slice(0, 10)) {

0 commit comments

Comments
 (0)