Skip to content

Commit 876f4d1

Browse files
authored
Merge branch 'main' into rename-third-party-developer-tools
2 parents d426575 + 14938ac commit 876f4d1

5 files changed

Lines changed: 3 additions & 54 deletions

File tree

docs/slim-tool-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->
22

3-
# Chrome DevTools MCP Slim Tool Reference (~359 cl100k_base tokens)
3+
# Chrome DevTools MCP Slim Tool Reference
44

55
- **[Navigation automation](#navigation-automation)** (1 tools)
66
- [`navigate`](#navigate)

docs/tool-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->
22

3-
# Chrome DevTools MCP Tool Reference (~7010 cl100k_base tokens)
3+
# Chrome DevTools MCP Tool Reference
44

55
- **[Input automation](#input-automation)** (10 tools)
66
- [`click`](#click)

package-lock.json

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
"rollup-plugin-license": "^3.6.0",
7878
"semver": "^7.7.4",
7979
"sinon": "^21.0.0",
80-
"tiktoken": "^1.0.22",
8180
"typescript": "^6.0.2",
8281
"typescript-eslint": "^8.43.0",
8382
"urlpattern-polyfill": "^10.1.0",

scripts/generate-docs.ts

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66

77
import fs from 'node:fs';
88

9-
import {Client} from '@modelcontextprotocol/sdk/client/index.js';
10-
import {StdioClientTransport} from '@modelcontextprotocol/sdk/client/stdio.js';
119
import type {Tool} from '@modelcontextprotocol/sdk/types.js';
12-
import {get_encoding} from 'tiktoken';
1310

1411
import {cliOptions} from '../build/src/bin/chrome-devtools-mcp-cli-options.js';
1512
import type {ParsedArguments} from '../build/src/bin/chrome-devtools-mcp-cli-options.js';
@@ -25,42 +22,6 @@ const OUTPUT_PATH = './docs/tool-reference.md';
2522
const SLIM_OUTPUT_PATH = './docs/slim-tool-reference.md';
2623
const README_PATH = './README.md';
2724

28-
async function measureServer(args: string[]) {
29-
// 1. Connect to your actual MCP server
30-
const transport = new StdioClientTransport({
31-
command: 'node',
32-
args: ['./build/src/bin/chrome-devtools-mcp.js', ...args], // Point to your built MCP server
33-
});
34-
35-
const client = new Client(
36-
{name: 'measurer', version: '1.0.0'},
37-
{capabilities: {}},
38-
);
39-
await client.connect(transport);
40-
41-
// 2. Fetch all tools
42-
const toolsList = await client.listTools();
43-
44-
// 3. Serialize exactly how an LLM would see it (JSON)
45-
const jsonString = JSON.stringify(toolsList.tools, null, 2);
46-
47-
// 4. Count tokens (using cl100k_base which is standard for GPT-4/Claude-3.5 approximation)
48-
const enc = get_encoding('cl100k_base');
49-
const tokenCount = enc.encode(jsonString).length;
50-
51-
console.log(`--- Measurement Results ---`);
52-
console.log(`Total Tools: ${toolsList.tools.length}`);
53-
console.log(`JSON Character Count: ${jsonString.length}`);
54-
console.log(`Estimated Token Count: ~${tokenCount}`);
55-
56-
// Clean up
57-
enc.free();
58-
await client.close();
59-
return {
60-
tokenCount,
61-
};
62-
}
63-
6425
// Extend the MCP Tool type to include our annotations
6526
interface ToolWithAnnotations extends Tool {
6627
annotations?: {
@@ -337,14 +298,13 @@ async function generateReference(
337298
toolsWithAnnotations: ToolWithAnnotations[],
338299
categories: Record<string, ToolWithAnnotations[]>,
339300
sortedCategories: string[],
340-
serverArgs: string[],
341301
) {
342302
console.log(`Found ${toolsWithAnnotations.length} tools`);
343303

344304
// Generate markdown documentation
345305
let markdown = `<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->
346306
347-
# ${title} (~${(await measureServer(serverArgs)).tokenCount} cl100k_base tokens)
307+
# ${title}
348308
349309
`;
350310
// Generate table of contents
@@ -567,7 +527,6 @@ async function generateToolDocumentation(): Promise<void> {
567527
toolsWithAnnotations,
568528
categories,
569529
sortedCategories,
570-
[],
571530
);
572531

573532
// Generate tools TOC and update README
@@ -584,7 +543,6 @@ async function generateToolDocumentation(): Promise<void> {
584543
toolsWithAnnotations,
585544
categories,
586545
sortedCategories,
587-
['--slim'],
588546
);
589547
}
590548

0 commit comments

Comments
 (0)