10 KiB
Chrome MCP Server API Reference 📚
Complete reference for all available tools and their parameters.
📋 Table of Contents
- Browser Management
- Screenshots & Visual
- Network Monitoring
- Content Analysis
- Interaction
- Data Management
- Response Format
📊 Browser Management
get_windows_and_tabs
List all currently open browser windows and tabs.
Parameters: None
Response:
{
"windowCount": 2,
"tabCount": 5,
"windows": [
{
"windowId": 123,
"tabs": [
{
"tabId": 456,
"url": "https://example.com",
"title": "Example Page",
"active": true
}
]
}
]
}
chrome_navigate
Navigate to a URL with optional viewport control.
Parameters:
url
(string, required): URL to navigate tonewWindow
(boolean, optional): Create new window (default: false)backgroundPage
(boolean, optional): Open URL in background page using full-size window that gets minimized. Creates window with proper dimensions first, then minimizes for background operation while maintaining web automation compatibility (default: false)width
(number, optional): Viewport width in pixels (default: 1280)height
(number, optional): Viewport height in pixels (default: 720)
Example:
{
"url": "https://example.com",
"newWindow": true,
"width": 1920,
"height": 1080
}
Background Page Example:
{
"url": "https://example.com",
"backgroundPage": true
}
chrome_close_tabs
Close specific tabs or windows.
Parameters:
tabIds
(array, optional): Array of tab IDs to closewindowIds
(array, optional): Array of window IDs to close
Example:
{
"tabIds": [123, 456],
"windowIds": [789]
}
chrome_go_back_or_forward
Navigate browser history.
Parameters:
direction
(string, required): "back" or "forward"tabId
(number, optional): Specific tab ID (default: active tab)
Example:
{
"direction": "back",
"tabId": 123
}
📸 Screenshots & Visual
chrome_screenshot
Take advanced screenshots with various options.
Parameters:
name
(string, optional): Screenshot filenameselector
(string, optional): CSS selector for element screenshotwidth
(number, optional): Width in pixels (default: 800)height
(number, optional): Height in pixels (default: 600)storeBase64
(boolean, optional): Return base64 data (default: false)fullPage
(boolean, optional): Capture full page (default: true)
Example:
{
"selector": ".main-content",
"fullPage": true,
"storeBase64": true,
"width": 1920,
"height": 1080
}
Response:
{
"success": true,
"base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"dimensions": {
"width": 1920,
"height": 1080
}
}
🌐 Network Monitoring
chrome_network_capture_start
Start capturing network requests using webRequest API.
Parameters:
url
(string, optional): URL to navigate to and capturemaxCaptureTime
(number, optional): Maximum capture time in ms (default: 30000)inactivityTimeout
(number, optional): Stop after inactivity in ms (default: 3000)includeStatic
(boolean, optional): Include static resources (default: false)
Example:
{
"url": "https://api.example.com",
"maxCaptureTime": 60000,
"includeStatic": false
}
chrome_network_capture_stop
Stop network capture and return collected data.
Parameters: None
Response:
{
"success": true,
"capturedRequests": [
{
"url": "https://api.example.com/data",
"method": "GET",
"status": 200,
"requestHeaders": {...},
"responseHeaders": {...},
"responseTime": 150
}
],
"summary": {
"totalRequests": 15,
"captureTime": 5000
}
}
chrome_network_debugger_start
Start capturing with Chrome Debugger API (includes response bodies).
Parameters:
url
(string, optional): URL to navigate to and capture
chrome_network_debugger_stop
Stop debugger capture and return data with response bodies.
chrome_network_request
Send custom HTTP requests.
Parameters:
url
(string, required): Request URLmethod
(string, optional): HTTP method (default: "GET")headers
(object, optional): Request headersbody
(string, optional): Request body
Example:
{
"url": "https://api.example.com/data",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": "{\"key\": \"value\"}"
}
🔍 Content Analysis
search_tabs_content
AI-powered semantic search across browser tabs.
Parameters:
query
(string, required): Search query
Example:
{
"query": "machine learning tutorials"
}
Response:
{
"success": true,
"totalTabsSearched": 10,
"matchedTabsCount": 3,
"vectorSearchEnabled": true,
"indexStats": {
"totalDocuments": 150,
"totalTabs": 10,
"semanticEngineReady": true
},
"matchedTabs": [
{
"tabId": 123,
"url": "https://example.com/ml-tutorial",
"title": "Machine Learning Tutorial",
"semanticScore": 0.85,
"matchedSnippets": ["Introduction to machine learning..."],
"chunkSource": "content"
}
]
}
chrome_get_web_content
Extract HTML or text content from web pages.
Parameters:
format
(string, optional): "html" or "text" (default: "text")selector
(string, optional): CSS selector for specific elementstabId
(number, optional): Specific tab ID (default: active tab)
Example:
{
"format": "text",
"selector": ".article-content"
}
chrome_get_interactive_elements
Find clickable and interactive elements on the page.
Parameters:
tabId
(number, optional): Specific tab ID (default: active tab)
Response:
{
"elements": [
{
"selector": "#submit-button",
"type": "button",
"text": "Submit",
"visible": true,
"clickable": true
}
]
}
🎯 Interaction
chrome_click_element
Click elements using CSS selectors.
Parameters:
selector
(string, required): CSS selector for target elementtabId
(number, optional): Specific tab ID (default: active tab)
Example:
{
"selector": "#submit-button"
}
chrome_fill_or_select
Fill form fields or select options.
Parameters:
selector
(string, required): CSS selector for target elementvalue
(string, required): Value to fill or selecttabId
(number, optional): Specific tab ID (default: active tab)
Example:
{
"selector": "#email-input",
"value": "user@example.com"
}
chrome_keyboard
Simulate keyboard input and shortcuts.
Parameters:
keys
(string, required): Key combination (e.g., "Ctrl+C", "Enter")selector
(string, optional): Target element selectordelay
(number, optional): Delay between keystrokes in ms (default: 0)
Example:
{
"keys": "Ctrl+A",
"selector": "#text-input",
"delay": 100
}
📚 Data Management
chrome_history
Search browser history with filters.
Parameters:
text
(string, optional): Search text in URL/titlestartTime
(string, optional): Start date (ISO format)endTime
(string, optional): End date (ISO format)maxResults
(number, optional): Maximum results (default: 100)excludeCurrentTabs
(boolean, optional): Exclude current tabs (default: true)
Example:
{
"text": "github",
"startTime": "2024-01-01",
"maxResults": 50
}
chrome_bookmark_search
Search bookmarks by keywords.
Parameters:
query
(string, optional): Search keywordsmaxResults
(number, optional): Maximum results (default: 100)folderPath
(string, optional): Search within specific folder
Example:
{
"query": "documentation",
"maxResults": 20,
"folderPath": "Work/Resources"
}
chrome_bookmark_add
Add new bookmarks with folder support.
Parameters:
url
(string, optional): URL to bookmark (default: current tab)title
(string, optional): Bookmark title (default: page title)parentId
(string, optional): Parent folder ID or pathcreateFolder
(boolean, optional): Create folder if not exists (default: false)
Example:
{
"url": "https://example.com",
"title": "Example Site",
"parentId": "Work/Resources",
"createFolder": true
}
chrome_bookmark_delete
Delete bookmarks by ID or URL.
Parameters:
bookmarkId
(string, optional): Bookmark ID to deleteurl
(string, optional): URL to find and delete
Example:
{
"url": "https://example.com"
}
📋 Response Format
All tools return responses in the following format:
{
"content": [
{
"type": "text",
"text": "JSON string containing the actual response data"
}
],
"isError": false
}
For errors:
{
"content": [
{
"type": "text",
"text": "Error message describing what went wrong"
}
],
"isError": true
}
🔧 Usage Examples
Complete Workflow Example
// 1. Navigate to a page
await callTool('chrome_navigate', {
url: 'https://example.com',
});
// 2. Take a screenshot
const screenshot = await callTool('chrome_screenshot', {
fullPage: true,
storeBase64: true,
});
// 3. Start network monitoring
await callTool('chrome_network_capture_start', {
maxCaptureTime: 30000,
});
// 4. Interact with the page
await callTool('chrome_click_element', {
selector: '#load-data-button',
});
// 5. Search content semantically
const searchResults = await callTool('search_tabs_content', {
query: 'user data analysis',
});
// 6. Stop network capture
const networkData = await callTool('chrome_network_capture_stop');
// 7. Save bookmark
await callTool('chrome_bookmark_add', {
title: 'Data Analysis Page',
parentId: 'Work/Analytics',
});
This API provides comprehensive browser automation capabilities with AI-enhanced content analysis and semantic search features.