Skip to content

Mbbrowser Skills Package ​

After configuring the Rules Package, this Skills Package acts as your "quick-start menu." Each scenario has a pre-made prompt template—copy it directly into Cursor or Antigravity, fill in your parameters, and AI will generate a complete, functional script.


IMPORTANT

Mbbrowser Automation: The First Law of Survival

  1. Dual-Package Synergy (Crucial!): In Antigravity or Cursor, you MUST load both the Rules Package and the Skills Package. Rules provide the low-level API dictionary, while Skills provide high-level logic definitions. They are inseparable.
  2. Local Mode Recommendation: Switching the client to "Local Mode" during large-scale runs can increase efficiency by hundreds of times.
  3. Backup Reminder: Regularly back up the MBDATA business database directory.

Core Content of Mbbrowser Skills Package ​

The content below is an advanced Skill package designed for Antigravity. Please copy it in its entirety and save it as .agent/skills/houniao-mbbrowser.md in your project root.

markdown
---
name: houniao-mbbrowser-apiserver-full
description: >
  Complete development specifications, interface details, CDP connection methods, troubleshooting, and legal parameter values for Mbbrowser (MBBrowser) + ApiServer.
  Load this skill immediately when users mention Mbbrowser, ApiServer, fingerprint browsers, multi-account isolation, environment startup/stop, CDP/Playwright/Selenium/Puppeteer takeovers, Session_ID, proxy updates, environment creation, error codes like -1/-105, etc.
  Strictly follow Session_ID type differences, use existing context, check code/status, and validate legal parameter values.
  Prioritize Playwright over CDP direct connection.
---

# Mbbrowser (MBBrowser) + ApiServer Complete Specification

**Core Reminders**:
- ApiServer startup requires Local Mode + regular MBDATA backup.
- All interfaces: **POST** + **application/json**.
- Base: http://127.0.0.1:8186 (Port is customizable).
- Success: code=0; Failure: code<0 + message.
- Check `data.listid[0].status == 0` after startup.
- Use `Public_ip` to verify proxy effect.
- Concurrency control: ≤20 environments per batch.

## Interface Quick Lookup

### Environment Lifecycle (Most Critical)
- **Start**: POST /api/v1/browser/start  
  Session_ID: **Array** ["id1", "id2"]  
  Recommended args: ["--blink-settings=imagesEnabled=false", "--interval-seconds=2", "--disable-extensions"]  
  isHeadless: false (Debug) / true (Production)

- **Stop**: POST /api/v1/browser/stop  
  Session_ID: **String** "id"

- **Kill**: POST /api/v1/browser/kill (Recommended for lingering processes; Session_ID: String)

- **Status**: POST /api/v1/browser/status

### Query Interfaces
- List (Filter + Pagination): /api/v1/session/listid  
- Details (Includes CDP_Port, webdriver): /api/v1/session/id_container (type=1 is most complete; Session_ID: Array)

### Create/Update
- Create: /api/v1/session/create (Automatic_Configure=0 for fast creation).  
- Update basic/proxy/advanced settings: Corresponding to /update, /proxy/update, /adv_setting.

### CDP Connection (Must Follow!)
**Playwright Python**:
```python
port = env["browser_CDP_Port"]
ws = f"ws://127.0.0.1:{port}/json/version"
pw = sync_playwright().start()
browser = pw.chromium.connect_over_cdp(ws)
context = browser.contexts[0]  # MUST use existing context!!
page = context.pages[0] if context.pages else context.new_page()
```

---

## 2. Complete Error/Parameter Reference

### Error Code Index
- **CODE 0**: Success
- **CODE -106**: TimeZone Error
- **CODE -105**: Proxy Validation Failed
- **Status -7**: Environment already running
- **Status -22**: Session_ID not found

### Parameter Dictionary
- **SystemOS**: Windows, iPhone, Android, MacIntel, etc.
- **Resolution**: 1920x1080 and other standard resolutions.
- **TimeZone**: IANA standard, e.g., "Asia/Shanghai +08:000".

Usage Tips ​

Secrets for Better AI Generated Code ​

  1. Be as Specific as Possible: Don't just say "write a login script." Say "Login URL is xxx, username selector is #username, password field is #password, click .submit-btn after input, and wait for URL to change to /dashboard."

  2. Specify Error Handling: For example, "Take a screenshot and log to a file if login fails."

  3. Define Output Format: For example, "Write results to result.csv including session_id, status, and duration."

  4. Outline Concurrency Requirements: For example, "10 concurrent environments using ThreadPoolExecutor."

  5. Reference File Names: For example, "Read session_ids from sessions.txt, one per line."

Modifying AI Generated Code ​

If there’s an issue with the AI-generated code, select that code and input:

There is an issue with this code: [describe the issue], please fix it.

Or:

Based on the code above, add the following feature: [describe new requirement].

TIP

Setup complete? Proceed to the next chapter: Live Demo: Talk → Script to see how a single sentence can awaken these powerful skills.