browser-control

0
0
Source

This skill should be used when the user needs to control the browser via HTTP API, supporting tab management, page content retrieval, script execution, Cookie operations, and more.

Install

mkdir -p .claude/skills/browser-control && curl -L -o skill.zip "https://mcp.directory/api/skills/download/8216" && unzip -o skill.zip -d .claude/skills/browser-control && rm skill.zip

Installs to .claude/skills/browser-control

About this skill

Browser Control Skill

Control the browser via HTTP API to automate tab management, page content retrieval, script execution, Cookie operations, and more.

Prerequisites

Before executing any browser operation, check the service status:

curl http://localhost:3333/api/browser/status

Verify:

  • isRunning: true - Service is running
  • activeConnections >= 1 - Browser extension is connected

If the service is not running or the extension is not connected, browser operations will fail.

Mandatory Guidelines

Temporary file location: All temporary scripts and JSON request files must be created in:

.claude/data/browser-control/workspace/

Do not create temporary files in the project root directory.

Decision Guide

flowchart TD
    Start[Need to execute browser script] --> Search[Search script library first]
    Search --> Found{Found existing script?}
    Found -->|Yes| UseLib["Execute with --from-library"]
    Found -->|No| Create[Create new script in workspace]
    Create --> Archive["Execute with --auto-archive"]
    UseLib --> Done[Done]
    Archive --> Done

Recommended Workflow

Before executing script injection, follow this process:

Important: When executing scripts, always add the --visual-feedback parameter so users can see which page elements the script is operating on.

Step 1: Search the Library First

# Search by URL
node .claude/skills/browser-control/scripts/search_library.js \
  --url "https://www.xiaohongshu.com/explore/xxx"

# Search by domain + keywords
node .claude/skills/browser-control/scripts/search_library.js \
  --domain xiaohongshu.com --keywords "note,extract"

# List all available scripts
node .claude/skills/browser-control/scripts/search_library.js --list

Step 2a: Reuse Existing Script

If a matching script is found, execute it directly from the library:

node .claude/skills/browser-control/scripts/run_script.js \
  --from-library xiaohongshu.com/get_note_info.js \
  --tabId 123456789 \
  --visual-feedback

Step 2b: Create New Script and Auto-Archive

If no existing script is found, create a new one with auto-archiving enabled:

# Create JS script file in workspace directory
# Path: .claude/data/browser-control/workspace/my_script.js
# Then execute with auto-archive
node .claude/skills/browser-control/scripts/run_script.js \
  --tabId 123456789 .claude/data/browser-control/workspace/my_script.js \
  --visual-feedback \
  --auto-archive \
  --url "https://www.xiaohongshu.com/..." \
  --name "get_note_info" \
  --purpose "Extract note information" \
  --keywords "note,title,likes"

After successful execution, the script will be automatically saved to .claude/data/browser-control/library/xiaohongshu.com/get_note_info.js.

Core Capabilities

1. Tab Management

OperationAPI
Get tab listGET /api/browser/tabs
Open new URLPOST /api/browser/open_url
Close tabPOST /api/browser/close_tab

For detailed parameters and examples, see the "Tab Operations" section in references/API.md.

2. Page Content Retrieval

OperationAPI
Get page HTMLPOST /api/browser/get_html

Getting page HTML is an asynchronous operation that requires using requestId to retrieve results.

For detailed usage, see "Scenario 1: Get Web Content for Analysis" in references/SCENARIOS.md.

3. Script Execution

OperationAPI
Execute JavaScriptPOST /api/browser/execute_script
Inject CSSPOST /api/browser/inject_css

Can be used for:

  • Getting page title, text, links, and other information
  • Clicking buttons, filling forms
  • Scrolling pages
  • Extracting specific data

Important: Before writing injection scripts, read references/SCRIPT-WRITING-GUIDE.md to understand:

  • Encoding handling for Chinese and special characters (avoiding garbled text)
  • Serialization requirements for return values (avoiding empty objects)
  • Error handling best practices
  • Common script templates

For detailed usage, see "Scenario 5: Execute Automation on Pages" in references/SCENARIOS.md.

4. Cookie Operations

OperationAPI
Get cookies from browserPOST /api/browser/get_cookies
Save cookies to databasePOST /api/browser/save_cookies
Query saved cookiesGET /api/browser/cookies

For detailed usage, see "Scenario 4: Get Login Session Cookies" in references/SCENARIOS.md.

5. Event Listening

OperationAPI
SSE event streamGET /api/browser/events
Send custom eventPOST /api/browser/emit_event

Receive browser events in real-time via SSE, such as tab changes, script execution results, etc.

For detailed usage, see "Scenario 6: Monitor Page Changes" in references/SCENARIOS.md.

Reference Documentation

DocumentDescription
references/API.mdComplete API reference
references/QUICKSTART.mdQuick start with common operation templates
references/SCENARIOS.mdUsage scenarios guide
references/SCRIPT-WRITING-GUIDE.mdInjection script writing guide
references/TROUBLESHOOTING.mdTroubleshooting guide

Helper Scripts Quick Reference

ScriptPurposeKey Parameters
check_status.jsCheck service statusNo parameters
search_library.jsSearch script library--url, --domain, --keywords, --list
run_script.jsExecute script--tabId, --from-library, --auto-archive, --visual-feedback
archive_script.jsArchive script--file, --url, --name, --purpose, --keywords
update_index.jsUpdate indexNo parameters

Visual Feedback: Always add the --visual-feedback parameter when executing scripts. See the "8. Visual Feedback" section in references/SCRIPT-WRITING-GUIDE.md.

Script Templates: The scripts/templates/ directory provides templates like extract_with_feedback.js, form_with_feedback.js, and click_with_feedback.js.

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

9521,094

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

846846

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

571699

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

548492

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

673466

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

514280

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.