chromium-mcp
MCP server for web fetching and automation using Chromium headless browser. Enables fetching pages as markdown, taking screenshots, automating interactions, and extracting data via CSS selectors.
README
Chromium MCP
MCP server for web fetching and automation using Chromium headless browser.
Reason behind this repository
I didn't wanna waste my "limited" tokens on Z.ai coding plan, therefore I made my own MCP to interact with the web, feel free to propose enhancements or new features.
Features
- fetch_page: Fetch web pages and convert to markdown/HTML
- screenshot: Take screenshots of web pages or specific elements
- interact: Automate browser interactions (click, fill, scroll, wait)
- extract_data: Extract structured data using CSS selectors
- get_link: Get link information and follow redirects
Installation
From Git Repository
# Clone the repository
git clone https://github.com/gzigurella/chromium-mcp.git
cd chromium-mcp
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the package
pip install -e .
# Install Chromium browser (required)
playwright install chromium
With uv (recommended)
# Clone and enter directory
git clone https://github.com/gzigurella/chromium-mcp.git
cd chromium-mcp
# Install with uv
uv pip install -e .
# Install Chromium
playwright install chromium
Integration
OpenCode
Add to your ~/.config/opencode/opencode.json:
{
"mcpServers": {
"chromium-fetch": {
"type": "local",
"command": [
"/path/to/chromium-mcp/venv/bin/python",
"-m",
"chromium_mcp"
],
"enabled": true
}
}
}
Claude Desktop
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"chromium-fetch": {
"command": "/path/to/chromium-mcp/venv/bin/python",
"args": ["-m", "chromium_mcp"]
}
}
}
Generic MCP Client
For any MCP-compatible client:
# Start the server directly
/path/to/venv/bin/python -m chromium_mcp
The server communicates via stdio using the MCP protocol.
Tools
fetch_page
Fetch a web page and return content as markdown or HTML.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | Yes | - | URL to fetch |
| format | string | No | "markdown" | Output format: "markdown" or "html" |
| timeout | integer | No | 30 | Timeout in seconds |
| wait_for | string | No | null | CSS selector to wait for |
{
"url": "https://example.com",
"format": "markdown",
"timeout": 30,
"wait_for": ".main-content"
}
screenshot
Take a screenshot of a web page.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | Yes | - | URL to screenshot |
| format | string | No | "png" | Image format: "png" or "jpeg" |
| quality | integer | No | 80 | JPEG quality (1-100) |
| full_page | boolean | No | false | Capture full page |
| selector | string | No | null | CSS selector for element |
| timeout | integer | No | 30 | Timeout in seconds |
{
"url": "https://example.com",
"format": "png",
"full_page": true
}
interact
Interact with web page elements sequentially.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | Yes | - | URL to interact with |
| actions | array | Yes | - | List of actions |
| timeout | integer | No | 30 | Timeout in seconds |
Action Types:
click: Click element by selectorfill: Fill input fieldselect: Select dropdown optionscroll: Scroll pagewait: Wait for element
{
"url": "https://example.com/search",
"actions": [
{"type": "fill", "selector": "input[name='q']", "value": "test search"},
{"type": "click", "selector": "button[type='submit']"},
{"type": "wait", "selector": ".results", "milliseconds": 2000}
]
}
extract_data
Extract structured data using CSS selectors.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | Yes | - | URL to extract from |
| selectors | array | Yes | - | List of extraction rules |
| timeout | integer | No | 30 | Timeout in seconds |
{
"url": "https://example.com/products",
"selectors": [
{"name": "titles", "selector": "h2.product-title", "multiple": true},
{"name": "prices", "selector": ".price", "multiple": true},
{"name": "links", "selector": "a.product-link", "attribute": "href", "multiple": true}
]
}
get_link
Get link href and text, optionally following navigation.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | Yes | - | URL of page containing link |
| selector | string | Yes | - | CSS selector for anchor |
| click | boolean | No | false | Follow the link |
| timeout | integer | No | 30 | Timeout in seconds |
{
"url": "https://example.com",
"selector": "a.download",
"click": true
}
Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
| CHROMIUM_PATH | auto | Path to Chromium executable |
| HEADLESS | true | Run browser in headless mode |
| TIMEOUT | 30 | Default operation timeout |
| DEBUG | false | Enable debug logging |
# Example
export TIMEOUT=60
export HEADLESS=false
python -m chromium_mcp
Development
Running Tests
source venv/bin/activate
pytest
# With coverage
pytest --cov=src --cov-report=html
Project Structure
chromium-mcp/
├── src/chromium_mcp/
│ ├── __init__.py
│ ├── __main__.py
│ ├── server.py
│ └── tools/
│ ├── __init__.py
│ ├── fetch_page.py
│ ├── screenshot.py
│ ├── interact.py
│ ├── extract_data.py
│ └── get_link.py
├── tests/
├── pyproject.toml
└── README.md
Troubleshooting
Browser Not Found
playwright install chromium
Permission Issues (Linux)
sudo sysctl -w kernel.shmmax=268435456
Timeout Errors
export TIMEOUT=60
Security
file://URLs are blocked- Credentials are never logged
- Browser processes are always cleaned up
- All operations have configurable timeouts
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.