> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rustybrowser.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Integrate Rusty Browser with Claude and other AI assistants via Model Context Protocol

## Overview

The Rusty Browser MCP Server is an [open-source](https://github.com/wraithbytes/mcp-server) server that exposes browser control capabilities through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), enabling integration with Claude, Cursor, VS Code, and other MCP-compatible AI tools.

## Tools Provided

### `create_browser`

Spawn a new browser instance. Returns the browser ID.

### `navigate`

Navigate a browser to a URL.

| Parameter | Type   | Required | Description        |
| --------- | ------ | -------- | ------------------ |
| `id`      | string | Yes      | Browser ID         |
| `url`     | string | Yes      | URL to navigate to |

### `click`

Click an element on the current page.

| Parameter  | Type   | Required | Description                      |
| ---------- | ------ | -------- | -------------------------------- |
| `id`       | string | Yes      | Browser ID                       |
| `selector` | string | Yes      | CSS selector of element to click |

### `type`

Type text into a field.

| Parameter  | Type   | Required | Description           |
| ---------- | ------ | -------- | --------------------- |
| `id`       | string | Yes      | Browser ID            |
| `text`     | string | Yes      | Text to type          |
| `selector` | string | No       | Target input selector |

### `screenshot`

Capture a screenshot of the current page.

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `id`      | string | Yes      | Browser ID  |

### `fetch_text`

Fetch visible text content of the current page.

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `id`      | string | Yes      | Browser ID  |

### `instruct`

Issue a natural language instruction to the browser.

| Parameter     | Type   | Required | Description                  |
| ------------- | ------ | -------- | ---------------------------- |
| `id`          | string | Yes      | Browser ID                   |
| `instruction` | string | Yes      | Natural language instruction |

### `delete_browser`

Close a browser and release its resources.

| Parameter | Type   | Required | Description         |
| --------- | ------ | -------- | ------------------- |
| `id`      | string | Yes      | Browser ID to close |

## Setup

### Docker

```bash theme={null}
docker run -p 2425:2425 \
  -e RUSTY_BROWSER_API_URL=http://host.docker.internal:8080 \
  rustybrowser/mcp-server
```

### From Source

```bash theme={null}
git clone https://github.com/wraithbytes/mcp-server.git
cd mcp-server
go run main.go
```

### Environment Variables

| Variable                 | Default                 | Description                |
| ------------------------ | ----------------------- | -------------------------- |
| `RUSTY_BROWSER_API_URL`  | `http://localhost:5201` | Rusty Browser API base URL |
| `RUSTY_BROWSER_SSE_ADDR` | `:2425`                 | SSE server listen address  |

## Authentication

The MCP server connects to your Rusty Browser API server. If you expose it outside a trusted local environment, protect the SSE endpoint with your own network controls or reverse-proxy authentication.

## Claude Desktop Configuration

```json theme={null}
{
  "mcpServers": {
    "rustybrowser": {
      "url": "http://localhost:2425/sse"
    }
  }
}
```

## Transport

The server uses **SSE (Server-Sent Events)** transport on port 2425 by default.
