Skip to main content
Glama
Myestery

Browser CDP MCP Server

by Myestery
README.md
# Browser CDP MCP Server

A minimal MCP (Model Context Protocol) server that provides direct access to the Chrome DevTools Protocol (CDP) for maximum flexibility browser control.

## Features

- **Raw CDP Access**: Call any Chrome DevTools Protocol method directly via `cdp_send`
- **Screenshot Capture**: Take screenshots in PNG or JPEG format
- **URL Retrieval**: Get the current page URL
- **Browser Management**: Launch and close browser instances

## Installation

```bash
npm install
```

## Usage

```bash
npm start
```

The server communicates over stdio using the MCP protocol.

## Tools

### `cdp_send`
Execute any CDP method. Reference: https://chromedevtools.github.io/devtools-protocol/

**Parameters:**
- `method` (string): CDP method name (e.g., `Page.navigate`, `DOM.getDocument`, `Runtime.evaluate`)
- `params` (object, optional): Parameters for the CDP method

**Example:**
```json
{
  "method": "Page.navigate",
  "params": { "url": "https://example.com" }
}
```

### `screenshot`
Capture a screenshot of the current page.

**Parameters:**
- `format` (string, optional): `"png"` or `"jpeg"` (default: `"png"`)
- `fullPage` (boolean, optional): Capture full scrollable page (default: `false`)

### `get_url`
Returns the current page URL.

### `close_browser`
Closes the browser instance and cleans up resources.

## MCP Configuration

Add to your MCP client configuration:

```bash
claude mcp add-json browser '{
  "type": "stdio",
  "command": "node",
  "args": ["path/to/browser-tool/server.js"]
}' --scope user
```

## Skill Integration
Add the browser skill to claude:

```bash
cp .path/to/browser-tool/.claude/skills/browser.md ~/.claude/skills/browser.md
```

## Dependencies

- `@modelcontextprotocol/sdk` - MCP SDK for server implementation
- `playwright` - Browser automation
- `zod` - Schema validation

## License

MIT

TDQS

D1.7/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: cdp_send appears to send commands to the Chrome DevTools Protocol, close_browser terminates the browser session, get_url retrieves the current URL, and screenshot captures a visual snapshot. There is no overlap in functionality between these tools.

Naming Consistency3/5

The naming is mixed: cdp_send uses a prefix-based convention, while close_browser, get_url, and screenshot follow a verb_noun pattern. This inconsistency reduces predictability, but all names are still readable and descriptive of their functions.

Tool Count3/5

With only 4 tools, the set feels thin for a browser automation server, lacking common operations like navigation, clicking, or input handling. However, the tools cover basic session management and inspection, making it borderline appropriate for minimal use cases.

Completeness2/5

The toolset is severely incomplete for browser automation: it lacks essential actions like navigate, click, type, or evaluate JavaScript, and there is no coverage for interacting with page elements or handling events. This will cause significant agent failures in typical browsing tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues