Skip to main content
Glama

Chrome DevTools MCP

Official
Mutex.ts996 B
/** * @license * Copyright 2025 Google Inc. * SPDX-License-Identifier: Apache-2.0 */ export class Mutex { static Guard = class Guard { #mutex: Mutex; #onRelease?: () => void; constructor(mutex: Mutex, onRelease?: () => void) { this.#mutex = mutex; this.#onRelease = onRelease; } dispose(): void { this.#onRelease?.(); return this.#mutex.release(); } }; #locked = false; #acquirers: Array<() => void> = []; // This is FIFO. async acquire( onRelease?: () => void, ): Promise<InstanceType<typeof Mutex.Guard>> { if (!this.#locked) { this.#locked = true; return new Mutex.Guard(this); } const {resolve, promise} = Promise.withResolvers<void>(); this.#acquirers.push(resolve); await promise; return new Mutex.Guard(this, onRelease); } release(): void { const resolve = this.#acquirers.shift(); if (!resolve) { this.#locked = false; return; } resolve(); } }

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