# lcbro-mcp
## 基本信息
- Slug: `lcbro-lcbro-mcp`
- Source: modelscope
- Publisher: @lcbro/lcbro-mcp
- Categories: browser-automation / web-scraping / app-automation
- Hosted: No
- License: Unknown
- Source URL: https://www.modelscope.cn/mcp/servers/@lcbro/lcbro-mcp
## 简介
暂无描述。
## 安装提示

```bash
# Use directly without installation npx lcbro # With custom configuration npx lcbro --config /path/to/config.yaml --port 3000
```

## MCP Server 详情

<div align="center">
  <br />
  <img src="assets/logo.svg" alt="LCBro Logo" width="300" height="225">
  <br />
  <br />
  
  # LCBro
  
  ### Low Cost Browser Remote Operations
  
  **The Cool Browser Automation MCP Server** 
  
  [![npm version](https://img.shields.io/npm/v/lcbro.svg?style=flat-square)](https://www.npmjs.com/package/lcbro)
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org/)
  
  [![CI/CD Pipeline](https://github.com/lcbro/lcbro/actions/workflows/ci.yml/badge.svg)](https://github.com/lcbro/lcbro/actions/workflows/ci.yml)
  [![Docker Testing](https://github.com/lcbro/lcbro/actions/workflows/docker.yml/badge.svg)](https://github.com/lcbro/lcbro/actions/workflows/docker.yml)
  [![Release](https://github.com/lcbro/lcbro/actions/workflows/release.yml/badge.svg)](https://github.com/lcbro/lcbro/actions/workflows/release.yml)
  [![Nightly Tests](https://github.com/lcbro/lcbro/actions/workflows/nightly.yml/badge.svg)](https://github.com/lcbro/lcbro/actions/workflows/nightly.yml)
  
  <br />
  
   **Lightning Fast**   **Zero Config**   **Production Ready**
  
  <br />
  
</div>

LCBro is a powerful MCP server for browser automation with support for both Playwright and Chrome DevTools Protocol (CDP). It provides intelligent preprocessing, comprehensive logging, and remote browser management capabilities.

** Cost Optimization Focus**: This project is specifically designed to optimize LLM request costs and reduce context usage by intelligently preprocessing and cleaning data using local LLM models before sending to expensive main LLM APIs. This approach can reduce costs by up to 80% while improving result quality.

##  Features

<table>
<tr>
<td width="50%">

###  **Browser Automation**
- Real browser control with JavaScript execution
- Login flows, clicks, text input, form handling
- Screenshot capture and content extraction
- Session management with persistent contexts

###  **Intelligent Preprocessing** 
- Auto-generates preprocessing prompts
- Local LLM integration (Ollama, JAN)
- Smart content analysis and optimization
- Cost-efficient data preparation

</td>
<td width="50%">

###  **Multiple Engines**
- **Playwright**: Full-featured automation
- **CDP**: Chrome DevTools Protocol support
- Remote browser connections
- Auto-detection and fallback

###  **Advanced Logging**
- Comprehensive LLM interaction logs
- Performance metrics and token tracking
- Configurable log rotation and compression
- Debug and monitoring capabilities

</td>
</tr>
</table>

##  Quick Start

### Use with npx (Recommended - No Installation)
```bash
# Use directly without installation
npx lcbro

# With custom configuration
npx lcbro --config /path/to/config.yaml --port 3000
```

### Global Installation
```bash
# Install globally via npm
npm install -g lcbro

# Start the server
lcbro
```

### Local Development
```bash
# Clone and install
git clone https://github.com/lcbro/lcbro.git
cd lcbro
npm install
npm run build
npm start
```

### Docker
```bash
# Run with Docker
docker run -p 3000:3000 lcbro:latest
```

##  Usage Examples

### Basic Browser Automation
```bash
# Navigate and extract content
npx lcbro navigate --url "https://example.com"
npx lcbro extract --format text
```

### With Custom Configuration
```bash
# Enable CDP support
npx lcbro --cdp-enabled --port 3001

# Custom logging directory
npx lcbro --logs-dir "/custom/logs" --log-level debug
```

### MCP Client Integration
```json
{
  "mcpServers": {
    "lcbro": {
      "command": "npx",
      "args": ["-y", "lcbro"]
    }
  }
}
```

##  Installation

### Prerequisites
- Node.js 18+ 
- npm or yarn
- Chrome/Chromium browser (for CDP support)

### Global Installation (Recommended)
```bash
# Install globally
npm install -g lcbro

# Verify installation
lcbro --version
```

### Local Development
```bash
# Clone repository
git clone https://github.com/lcbro/lcbro.git
cd lcbro

# Install dependencies
npm install

# Build project
npm run build

# Install Playwright browsers
npm run install:browsers
```

##  Configuration

LCBro uses YAML configuration files with CLI overrides. Create a `config/default.yaml` file or use CLI options:

### Basic Configuration
```yaml
server:
  host: "localhost"
  port: 3000

browser:
  engine: playwright  # playwright | cdp
  headless: true
  defaultTimeoutMs: 30000
  maxContexts: 8
  storageDir: /data/profiles

llm:
  defaultModel: "ollama:llama3.1"
  maxOutputTokens: 2000
  temperature: 0
  host: "localhost"
  port: 11434
  janPort: 1337
  autoPreprocess: true

security:
  allowDomains: ["example.com", "gov.br"]
  blockPrivateNetworks: true
```

### CLI Configuration Overrides
```bash
# Server settings
lcbro --port 3001 --host 0.0.0.0

# CDP browser support
lcbro --cdp-enabled --cdp-port 9222

# Remote CDP server
lcbro --remote-url https://cdp.example.com:9222 --remote-ssl-mode enabled

# Logging configuration
lcbro --log-level debug --logs-dir /tmp/lcbro-logs
```

##  CLI Usage

LCBro provides a comprehensive command-line interface:

### Main Commands
```bash
# Start the server
lcbro

# Show help
lcbro --help

# Show current configuration
lcbro config

# Launch browsers with CDP
lcbro browser:launch -b chrome -p 9222

# Manage log files
lcbro logs --command summary

# Test remote CDP connection
lcbro test:remote -u https://cdp.example.com:9222
```

##  Environment Variables

LCBro supports configuration via environment variables:

### LLM Configuration
```bash
# Local LLMs (Recommended)

#### Ollama (free, no API keys required)
```bash
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

# Pull a model
ollama pull llama3.1

# Configure LCBro
export LLM_HOST=localhost
export LLM_PORT=11434
export LLM_DEFAULT_MODEL=ollama:llama3.1
```

#### JAN AI (free, with optional API key)
```bash
# Configure LCBro for JAN AI
…

