mcp-chromium-cdp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-chromium-cdpnavigate to example.com and get the page title"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-chromium-cdp
Model Context Protocol (MCP) server for controlling Chromium/Chrome via Chrome DevTools Protocol. Cross-platform with automatic reconnection support.
✨ Key Features
✅ Cross-platform: Works on macOS, Linux, and Windows
✅ Chromium-first: Detects and launches Chromium, falls back to Chrome
✅ Auto-reconnection: Automatically reconnects if browser crashes or restarts (up to 5 retries)
✅ Auto-launch: Launches browser automatically if not running
✅ Custom profiles: Support for custom browser profiles via environment variables
✅ Stdio transport: Native integration with Claude Desktop and Claude Code
Related MCP server: open_browser_use
Installation
Global Installation
npm install -g mcp-chromium-cdpLocal Installation
npm install mcp-chromium-cdpFrom Source
git clone https://github.com/duquesnay/mcp-chromium-cdp.git
cd mcp-chromium-cdp
npm install
npm run buildConfiguration
Claude Desktop (macOS)
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"chromium": {
"command": "npx",
"args": ["-y", "mcp-chromium-cdp"]
}
}
}Claude Code
claude mcp add chromium -- npx -y mcp-chromium-cdpOr with local build:
claude mcp add chromium -- node /path/to/mcp-chromium-cdp/build/index.jsEnvironment Variables
CHROMIUM_PATH
Override Chromium binary path:
CHROMIUM_PATH=/usr/bin/chromium-browser mcp-chromium-cdpCHROMIUM_USER_DATA_DIR
Use custom browser profile:
CHROMIUM_USER_DATA_DIR=~/.config/chromium-mcp mcp-chromium-cdpAvailable Tools
Tool | Description |
| Navigate to a specific URL |
| Get the current page URL |
| Get the page title |
| Get the page HTML content |
| Get visible text from the page |
| Execute JavaScript in the page |
| Click an element by CSS selector |
| Type text into an input field |
| Take a screenshot (base64) |
| Open a new tab |
| Close the current tab |
| List all open tabs |
| Reload the current page |
| Navigate back in history |
| Navigate forward in history |
Usage Examples
With Claude
Using chromium tools, navigate to https://example.com and get the page titleProgrammatic Usage
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
const transport = new StdioClientTransport({
command: 'npx',
args: ['-y', 'mcp-chromium-cdp']
});
const client = new Client({
name: 'my-client',
version: '1.0.0'
}, {
capabilities: {}
});
await client.connect(transport);
// Navigate to URL
await client.callTool({
name: 'chrome_navigate',
arguments: { url: 'https://example.com' }
});
// Get page title
const result = await client.callTool({
name: 'chrome_get_title',
arguments: {}
});
console.log(result.content[0].text);Auto-Reconnection
If Chromium crashes or is restarted, the server will automatically attempt to reconnect:
Max retries: 5 attempts
Retry delay: 2 seconds between attempts
Logs: Reconnection attempts logged to stderr
Example log output:
[Connection] Chromium disconnected
[Reconnect] Attempting to reconnect to Chromium...
[Reconnect] Successfully reconnected to ChromiumChromium Detection
The server automatically detects Chromium in standard locations:
macOS:
/Applications/Chromium.app/Contents/MacOS/Chromium~/Applications/Chromium.app/Contents/MacOS/Chromium
Linux:
/usr/bin/chromium/usr/bin/chromium-browser/snap/bin/chromium
Windows:
%LOCALAPPDATA%\Chromium\Application\chrome.exe%PROGRAMFILES%\Chromium\Application\chrome.exe%PROGRAMFILES(X86)%\Chromium\Application\chrome.exe
If Chromium is not found, the server falls back to Chrome via chrome-launcher.
Development
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run watchArchitecture
This project consists of two main components:
ChromeController (
src/chrome-controller.ts):Manages Chrome DevTools Protocol (CDP) connections
Implements browser automation methods
Handles auto-launch and reconnection logic
Cross-platform Chromium detection
MCP Server (
src/index.ts):Implements the Model Context Protocol server
Exposes Chrome control methods as MCP tools
Handles communication via stdio
Troubleshooting
Chromium/Chrome Not Found
If the server can't find Chromium:
Install Chromium from chromium.org
Or specify path manually:
CHROMIUM_PATH=/path/to/chromium mcp-chromium-cdp
Connection Issues
If the server can't connect:
Check if another process is using port 9222:
lsof -i :9222The server will auto-launch Chromium if not running
Check logs for reconnection attempts
MCP Server Not Showing in Claude
Verify configuration in Claude Desktop/Code
Check that
build/index.jsexistsLook at Claude logs for errors
Differences from chrome-mcp
This project is based on the original chrome-mcp package by @moe03 with the following enhancements:
✅ Chromium-first detection (instead of Chrome-only)
✅ Automatic reconnection on disconnection
✅ Cross-platform Chromium path detection
✅ Environment variable configuration
✅ TypeScript source code included
✅ Improved error handling and logging
Credits
Original code by @moe03 (chrome-mcp package).
Enhanced with auto-reconnection and cross-platform support by @duquesnay.
Built using:
@modelcontextprotocol/sdk - MCP SDK
chrome-launcher - Chrome launcher
chrome-remote-interface - Chrome DevTools Protocol client
License
MIT
Contributing
Contributions welcome! Please open an issue or PR on GitHub.
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/duquesnay/mcp-chromium-cdp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server