diff --git a/docs/slim-tool-reference.md b/docs/slim-tool-reference.md index b149cc0a5..46d064895 100644 --- a/docs/slim-tool-reference.md +++ b/docs/slim-tool-reference.md @@ -1,6 +1,6 @@ -# Chrome DevTools MCP Slim Tool Reference (~359 cl100k_base tokens) +# Chrome DevTools MCP Slim Tool Reference - **[Navigation automation](#navigation-automation)** (1 tools) - [`navigate`](#navigate) diff --git a/docs/tool-reference.md b/docs/tool-reference.md index c3f6b1c02..586359281 100644 --- a/docs/tool-reference.md +++ b/docs/tool-reference.md @@ -1,6 +1,6 @@ -# Chrome DevTools MCP Tool Reference (~7010 cl100k_base tokens) +# Chrome DevTools MCP Tool Reference - **[Input automation](#input-automation)** (10 tools) - [`click`](#click) diff --git a/package-lock.json b/package-lock.json index 5be433752..42f519edb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,6 @@ "rollup-plugin-license": "^3.6.0", "semver": "^7.7.4", "sinon": "^21.0.0", - "tiktoken": "^1.0.22", "typescript": "^6.0.2", "typescript-eslint": "^8.43.0", "urlpattern-polyfill": "^10.1.0", @@ -559,7 +558,6 @@ "integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", @@ -638,7 +636,6 @@ "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=8.0.0" } @@ -662,7 +659,6 @@ "integrity": "sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=14" }, @@ -676,7 +672,6 @@ "integrity": "sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/semantic-conventions": "1.28.0" }, @@ -703,7 +698,6 @@ "integrity": "sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/api-logs": "0.57.2", "@types/shimmer": "^1.2.0", @@ -1134,7 +1128,6 @@ "integrity": "sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/core": "1.30.1", "@opentelemetry/semantic-conventions": "1.28.0" @@ -1162,7 +1155,6 @@ "integrity": "sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/core": "1.30.1", "@opentelemetry/resources": "1.30.1", @@ -1191,7 +1183,6 @@ "integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=14" } @@ -2309,7 +2300,6 @@ "integrity": "sha512-HDQH9O/47Dxi1ceDhBXdaldtf/WV9yRYMjbjCuNk3qnaTD564qwv61Y7+gTxwxRKzSrgO5uhtw584igXVuuZkA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.59.1", "@typescript-eslint/types": "8.59.1", @@ -2836,7 +2826,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3894,8 +3883,7 @@ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1595872.tgz", "integrity": "sha512-kRfgp8vWVjBu/fbYCiVFiOqsCk3CrMKEo3WbgGT2NXK2dG7vawWPBljixajVgGK9II8rDO9G0oD0zLt3I1daRg==", "dev": true, - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/diff": { "version": "8.0.4", @@ -4266,7 +4254,6 @@ "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -4437,7 +4424,6 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -4708,7 +4694,6 @@ "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", @@ -5485,7 +5470,6 @@ "integrity": "sha512-am5zfg3yu6sqn5yjKBNqhnTX7Cv+m00ox+7jbaKkrLMRJ4rAdldd1xPd/JzbBWspqaQv6RSTrgFN95EsfhC+7w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=16.9.0" } @@ -7746,7 +7730,6 @@ "integrity": "sha512-J9qZyW++QK/09NyN/zeO0dG/1GdGfyp9lV8ajHnRVLfo/uFsbji5mHnDgn/qYdUHyCkM2N+8VyspgZclfAh0eQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/estree": "1.0.8" }, @@ -8676,13 +8659,6 @@ "dev": true, "license": "MIT" }, - "node_modules/tiktoken": { - "version": "1.0.22", - "resolved": "https://registry.npmjs.org/tiktoken/-/tiktoken-1.0.22.tgz", - "integrity": "sha512-PKvy1rVF1RibfF3JlXBSP0Jrcw2uq3yXdgcEXtKTYn3QJ/cBRBHDnrJ5jHky+MENZ6DIPwNUGWpkVx+7joCpNA==", - "dev": true, - "license": "MIT" - }, "node_modules/tinyglobby": { "version": "0.2.15", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", @@ -8902,7 +8878,6 @@ "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8978,7 +8953,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "napi-postinstall": "^0.3.0" }, @@ -9395,7 +9369,6 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 58b295fb8..522bae1af 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,6 @@ "rollup-plugin-license": "^3.6.0", "semver": "^7.7.4", "sinon": "^21.0.0", - "tiktoken": "^1.0.22", "typescript": "^6.0.2", "typescript-eslint": "^8.43.0", "urlpattern-polyfill": "^10.1.0", diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index 3c05c265e..77dc37b8c 100644 --- a/scripts/generate-docs.ts +++ b/scripts/generate-docs.ts @@ -6,10 +6,7 @@ import fs from 'node:fs'; -import {Client} from '@modelcontextprotocol/sdk/client/index.js'; -import {StdioClientTransport} from '@modelcontextprotocol/sdk/client/stdio.js'; import type {Tool} from '@modelcontextprotocol/sdk/types.js'; -import {get_encoding} from 'tiktoken'; import {cliOptions} from '../build/src/bin/chrome-devtools-mcp-cli-options.js'; import type {ParsedArguments} from '../build/src/bin/chrome-devtools-mcp-cli-options.js'; @@ -25,42 +22,6 @@ const OUTPUT_PATH = './docs/tool-reference.md'; const SLIM_OUTPUT_PATH = './docs/slim-tool-reference.md'; const README_PATH = './README.md'; -async function measureServer(args: string[]) { - // 1. Connect to your actual MCP server - const transport = new StdioClientTransport({ - command: 'node', - args: ['./build/src/bin/chrome-devtools-mcp.js', ...args], // Point to your built MCP server - }); - - const client = new Client( - {name: 'measurer', version: '1.0.0'}, - {capabilities: {}}, - ); - await client.connect(transport); - - // 2. Fetch all tools - const toolsList = await client.listTools(); - - // 3. Serialize exactly how an LLM would see it (JSON) - const jsonString = JSON.stringify(toolsList.tools, null, 2); - - // 4. Count tokens (using cl100k_base which is standard for GPT-4/Claude-3.5 approximation) - const enc = get_encoding('cl100k_base'); - const tokenCount = enc.encode(jsonString).length; - - console.log(`--- Measurement Results ---`); - console.log(`Total Tools: ${toolsList.tools.length}`); - console.log(`JSON Character Count: ${jsonString.length}`); - console.log(`Estimated Token Count: ~${tokenCount}`); - - // Clean up - enc.free(); - await client.close(); - return { - tokenCount, - }; -} - // Extend the MCP Tool type to include our annotations interface ToolWithAnnotations extends Tool { annotations?: { @@ -337,14 +298,13 @@ async function generateReference( toolsWithAnnotations: ToolWithAnnotations[], categories: Record, sortedCategories: string[], - serverArgs: string[], ) { console.log(`Found ${toolsWithAnnotations.length} tools`); // Generate markdown documentation let markdown = ` -# ${title} (~${(await measureServer(serverArgs)).tokenCount} cl100k_base tokens) +# ${title} `; // Generate table of contents @@ -567,7 +527,6 @@ async function generateToolDocumentation(): Promise { toolsWithAnnotations, categories, sortedCategories, - [], ); // Generate tools TOC and update README @@ -584,7 +543,6 @@ async function generateToolDocumentation(): Promise { toolsWithAnnotations, categories, sortedCategories, - ['--slim'], ); }