Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[files]
# Exclude README files from typos checking (they contain multiple languages)
# Exclude bundled-modules directory (contains third-party bundled code)
extend-exclude = ["README*.md", "**/bundled-modules/**"]
# Exclude mcp-bridge directory (tool schemas contain glob patterns that trigger false positives)
extend-exclude = ["README*.md", "**/bundled-modules/**", "mcp-bridge/**"]
1 change: 1 addition & 0 deletions mcp-bridge/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
148 changes: 100 additions & 48 deletions mcp-bridge/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
# aipex-mcp-bridge

MCP bridge that connects AI agents to the [AIPex](https://aipex.ai) browser extension via WebSocket.

Works with **any** MCP client that supports stdio transport — Cursor, Claude Desktop, Claude Code, VS Code Copilot, Windsurf, Zed, and more.
MCP server that connects AI agents to the [AIPex](https://aipex.ai) browser extension. Supports **multiple simultaneous clients** (Cursor, Claude Code, VS Code Copilot, etc.) via StreamableHTTP.

## How it works

```
AI Agent (MCP client) ──stdio──▶ aipex-mcp-bridge ──WebSocket──▶ AIPex Chrome Extension
Cursor ──HTTP POST /mcp──┐
Claude Code ──HTTP POST /mcp──┤── aipex-mcp-server ──WebSocket──▶ AIPex Chrome Extension
VS Code ──HTTP POST /mcp──┘
```

The bridge starts a WebSocket server on `localhost:9223` (configurable) and communicates with your AI agent over stdio using the MCP protocol. The AIPex extension connects to the WebSocket server to expose browser control tools.
The server runs on `localhost:9223` and provides:

- **`/mcp`** — StreamableHTTP endpoint for MCP clients
- **`/extension`** — WebSocket endpoint for the AIPex Chrome extension
- **`/health`** — Health check endpoint

## Quick start

### 1. Configure your AI agent
### 1. Start the server

Add the following to your agent's MCP configuration:
```bash
npx aipex-mcp-server
```

**Cursor** (`.cursor/mcp.json`):
The server stays running and handles all AI agent connections.

```json
{
"mcpServers": {
"aipex-browser": {
"command": "npx",
"args": ["-y", "aipex-mcp-bridge"]
}
}
}
```
### 2. Configure your AI agent

**Claude Desktop** (`claude_desktop_config.json`):
**Cursor** (`.cursor/mcp.json` or `~/.cursor/mcp.json`):

```json
{
"mcpServers": {
"aipex-browser": {
"command": "npx",
"args": ["-y", "aipex-mcp-bridge"]
"url": "http://localhost:9223/mcp"
}
}
}
Expand All @@ -47,7 +43,7 @@ Add the following to your agent's MCP configuration:
**Claude Code**:

```bash
claude mcp add aipex-browser -- npx -y aipex-mcp-bridge
claude mcp add --transport http aipex-browser http://localhost:9223/mcp
```

**VS Code Copilot** (`.vscode/mcp.json`):
Expand All @@ -56,14 +52,38 @@ claude mcp add aipex-browser -- npx -y aipex-mcp-bridge
{
"servers": {
"aipex-browser": {
"command": "npx",
"args": ["-y", "aipex-mcp-bridge"]
"url": "http://localhost:9223/mcp"
}
}
}
```

**Windsurf** (`mcp_config.json`):
### 3. Connect AIPex extension

1. Open Chrome → AIPex extension → Options page
2. Set WebSocket URL to `ws://localhost:9223/extension`
3. Click **Connect**

Your AI agents can now control the browser through AIPex — all simultaneously.

## Options

```
npx aipex-mcp-server [--port <port>] [--host <host>]
```

| Option | Default | Description |
| ----------------- | ----------- | ----------------------------------------------------------- |
| `--port <port>` | `9223` | Server port |
| `--host <host>` | `127.0.0.1` | Bind address (`0.0.0.0` to allow remote/Docker connections) |
| `--help`, `-h` | | Show help message |
| `--version`, `-v` | | Show version |

---

## Stdio Bridge (backward compatibility)

For MCP clients that only support stdio transport, a thin bridge is included:

```json
{
Expand All @@ -76,43 +96,75 @@ claude mcp add aipex-browser -- npx -y aipex-mcp-bridge
}
```

### 2. Connect AIPex extension
The stdio bridge forwards tool calls to the HTTP server at `http://localhost:9223/mcp`. The server must be running separately.

1. Open Chrome → AIPex extension → Options page
2. Set WebSocket URL to `ws://localhost:9223`
3. Click **Connect**
---

Your AI agent can now control the browser through AIPex.
## AIPex CLI

## Options
Command-line tool for controlling the browser directly from the terminal.

### Usage

```bash
aipex-cli <tool_name> [--param value ...]
aipex-cli --list # List all tools
aipex-cli --help <tool_name> # Show tool parameters
aipex-cli --json '{"name":"...","arguments":{...}}' # Raw JSON
```
npx aipex-mcp-bridge [--port <port>]

### Examples

```bash
aipex-cli get_all_tabs
aipex-cli create_new_tab --url https://example.com
aipex-cli search_elements --tabId 123 --query "button*"
aipex-cli click --tabId 123 --uid btn-42
aipex-cli capture_screenshot
```

| Option | Default | Description |
| ----------------- | ------- | ---------------------------------- |
| `--port <port>` | `9223` | WebSocket port for AIPex extension |
| `--help`, `-h` | | Show help message |
| `--version`, `-v` | | Show version |
### Environment Variables

### Custom port example
| Variable | Default | Description |
| ----------------------- | --------------------------- | ---------------------- |
| `AIPEX_SERVER_URL` | `http://localhost:9223/mcp` | HTTP server URL |
| `AIPEX_WS_URL` | `ws://localhost:9223/cli` | WebSocket fallback URL |
| `AIPEX_CONNECT_TIMEOUT` | `60000` | Max ms to wait |

```json
{
"mcpServers": {
"aipex-browser": {
"command": "npx",
"args": ["-y", "aipex-mcp-bridge", "--port", "8080"]
}
}
}
---

## Docker Image

```bash
docker pull butterman2/aipex-browser:latest
docker run -d --name aipex --shm-size=2g \
-p 9223:9223 -p 5900:5900 -p 6080:6080 \
butterman2/aipex-browser:latest
```

| Port | Service |
| ---- | ---------------------- |
| 9223 | MCP Server (HTTP + WS) |
| 5900 | VNC |
| 6080 | noVNC (web-based) |

## Migration from v2.x

v3.0 replaces the daemon+proxy architecture with a single HTTP server:

| v2.x (daemon) | v3.0 (HTTP server) |
| ------------------------------------------- | ----------------------------------------------------- |
| `npx aipex-mcp-bridge` (stdio per IDE) | `npx aipex-mcp-server` (one server) |
| Each IDE spawns its own bridge process | All IDEs connect to one HTTP endpoint |
| Daemon with PID files, idle timeout | Standard HTTP server, no background process |
| Extension connects to `ws://localhost:9223` | Extension connects to `ws://localhost:9223/extension` |

**Breaking change**: The AIPex extension WebSocket URL changed from `ws://localhost:9223` to `ws://localhost:9223/extension`. Update the URL in AIPex extension Options.

## Requirements

- Node.js >= 18
- AIPex Chrome extension installed
- AIPex Chrome extension installed (not needed for Docker image)

## License

Expand Down
12 changes: 8 additions & 4 deletions mcp-bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"name": "aipex-mcp-bridge",
"version": "1.0.0",
"description": "MCP bridge that connects AI agents (Cursor, Claude, VS Code Copilot, etc.) to the AIPex browser extension via WebSocket",
"version": "3.1.0",
"description": "MCP bridge that connects AI agents (Cursor, Claude Code, VS Code Copilot, etc.) to the AIPex browser extension. Auto-spawns a shared daemon to support multiple simultaneous clients.",
"type": "module",
"bin": {
"aipex-mcp-bridge": "./dist/bridge.js"
"aipex-mcp-bridge": "./dist/bridge.js",
"aipex-mcp-daemon": "./dist/daemon.js",
"aipex-cli": "./dist/cli.js"
},
"files": [
"dist",
"README.md"
],
"scripts": {
"build": "tsup",
"dev": "tsx src/bridge.ts"
"dev": "tsx src/bridge.ts",
"dev:daemon": "tsx src/daemon.ts"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.28.0",
"ws": "^8.18.0"
},
"devDependencies": {
Expand Down
Loading