Skip to main content
Glama

Chrome DevTools MCP

Official
logger.ts854 B
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import fs from 'node:fs'; import debug from 'debug'; const mcpDebugNamespace = 'mcp:log'; const namespacesToEnable = [ mcpDebugNamespace, ...(process.env['DEBUG'] ? [process.env['DEBUG']] : []), ]; export function saveLogsToFile(fileName: string): fs.WriteStream { // Enable overrides everything so we need to add them debug.enable(namespacesToEnable.join(',')); const logFile = fs.createWriteStream(fileName, {flags: 'a'}); debug.log = function (...chunks: any[]) { logFile.write(`${chunks.join(' ')}\n`); }; logFile.on('error', function (error) { console.log(`Error when opening/writing to log file: ${error.message}`); logFile.end(); process.exit(1); }); return logFile; } export const logger = debug(mcpDebugNamespace);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ChromeDevTools/chrome-devtools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server