# MCP Server

An MCP server implementation that provides tools for controlling remote cloud browsers through CloudBrowser.ai with AI-powered automation capabilities.

## Features

* **Remote Browser Management**: Open, close, and control cloud browsers
* **Direct Browser Control**: Puppeteer-based automation via Chrome DevTools Protocol
* **Session Management**: Save and restore browser sessions with cookies/localStorage
* **Remote Desktop Access**: Integration for visual browser control
* **AI-Powered Automation**: Intelligent page content analysis and element interaction
* **Dual Transport**: Support for both stdio and HTTP communication

## Configuration

### Prerequisites

You need a CloudBrowser.ai API token. Get one from [cloudbrowser.ai](https://cloudbrowser.ai).

### Usage with OpenAI Agents, n8n, and Make (HTTP method)

For OpenAI Agents, n8n, and Make integrations, use the HTTP endpoint:

* **Endpoint**: `https://mcp.cloudbrowser.ai`
* **Authorization Header**: `Bearer your_api_token_here`

### Usage with Claude Desktop (STDIO method)

Add this to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "cloudbrowser": {
      "command": "npx",
      "args": ["@cloudbrowser/mcp-server"],
      "env": {
        "CLOUDBROWSER_API_TOKEN": "your_api_token_here"
      }
    }
  }
}
```

## MCP Tools list

### Browser Management

* `open_browser` - Opens a new remote browser instance in the cloud
* `close_browser` - Closes a specific browser instance
* `get_browsers` - Lists all active browser instances
* `start_remote_desktop` - Starts VNC access to a browser
* `stop_remote_desktop` - Stops VNC access to a browser
* `get_saved_sessions` - Lists saved browser sessions
* `remove_saved_session` - Removes a saved session

### Browser Automation

* `connect_to_browser` - Establishes direct control connection to a browser
* `navigate_to_url` - Navigates to a specific URL
* `get_page_content` - Extracts comprehensive page content and structure
* `click_element` - Clicks on page elements using CSS selectors
* `type_text` - Types text into form fields and inputs
* `get_elements` - Gets information about elements matching a selector
* `take_screenshot` - Captures page screenshots
* `evaluate_script` - Executes JavaScript code on the page


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cloudbrowser.gitbook.io/docs/get-started/mcp-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
