
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
rag-browser
Advanced tools
A Model Context Protocol server for browser automation using Playwright.
A Browser Automation Tool for Humans and AI
rag-browser is a versatile tool built with Playwright that enables webpage analysis and automation. It operates in two modes: a CLI mode for direct webpage analysis and an MCP Server mode for integration with AI systems via the Model Context Protocol (MCP). Whether you're a developer exploring a webpage's structure or an AI system executing complex browser tasks, rag-browser provides a robust and flexible solution.
curl -fsSL https://bun.sh/install | bashbunx or npx to run directly from GitHub.Use bunx (preferred) or npx to execute rag-browser without cloning the repository:
# Using Bun (Recommended)
bunx github:aashari/rag-browser --url "https://example.com"
# Using Node.js/npm
npx -y github:aashari/rag-browser --url "https://example.com"
If you prefer to install the tool locally without publishing to npm, you have two simple options:
This is the easiest way to install the tool globally on your machine:
# Using Bun (Recommended)
bun install -g github:aashari/rag-browser
# Using npm
npm install -g github:aashari/rag-browser
After installation, you can run it directly:
rag-browser --url "https://example.com"
For development or customization:
# Clone the repository
git clone https://github.com/aashari/rag-browser.git
cd rag-browser
# Install dependencies
bun install # or npm install
# Build the project
npm run build
# Link the package globally
bun link # or npm link
After linking, you can run it directly:
rag-browser --url "https://example.com"
To contribute or modify, clone the repository:
git clone https://github.com/aashari/rag-browser.git
cd rag-browser
bun install
bun run src/index.ts
Analyze a webpage or execute a sequence of actions.
# Using Bun
bunx github:aashari/rag-browser --url "https://example.com"
# Using Node.js/npm
npx -y github:aashari/rag-browser --url "https://example.com"
Output: Displays page title, description, and top 5 inputs, buttons, and links.
bunx github:aashari/rag-browser --url "https://example.com" --headless --json
Output: JSON object with full page analysis.
bunx github:aashari/rag-browser --url "https://example.com"
Output: Lists top 5 inputs, buttons, and links with selectors.
Search Wikipedia and capture results:
bunx github:aashari/rag-browser --url "https://wikipedia.org" --plan '{
"actions": [
{"type": "wait", "elements": ["#searchInput"]},
{"type": "typing", "element": "#searchInput", "value": "AI Tools"},
{"type": "keyPress", "key": "Enter"},
{"type": "wait", "elements": [".mw-search-results-container"]},
{"type": "print", "elements": [".mw-search-result"], "format": "markdown"}
]
}'
Output: Executes the plan and prints search results in Markdown.
| Option | Description | Example Value |
|---|---|---|
--url | Target URL (required) | "https://example.com" |
--headless | Run without UI | (flag) |
--json | Output in JSON format | (flag) |
--simple-selectors | Use simpler CSS selectors | (flag) |
--plan | JSON string of actions | See above example |
--timeout | Timeout in ms (-1 for infinite) | 5000 |
--debug | Enable verbose debug logging | (flag) |
Run as a server for AI integration.
# Using Bun
bunx github:aashari/rag-browser
# Using Node.js/npm
npx -y github:aashari/rag-browser
Add to your AI system's MCP configuration:
// For Bun
{
"mcpServers": {
"rag-browser": {
"command": "bunx",
"args": ["github:aashari/rag-browser"]
}
}
}
// For Node.js/npm
{
"mcpServers": {
"rag-browser": {
"command": "npx",
"args": ["-y", "github:aashari/rag-browser"]
}
}
}
| Action | Description | Required Fields | Optional Fields |
|---|---|---|---|
wait | Wait for elements | elements: string[] | timeout: number |
click | Click an element | element: string | - |
typing | Type text | element: string, value: string | delay: number |
keyPress | Press a key | key: string | element: string |
print | Capture content | elements: string[] | format: "html" | "markdown" |
bunx github:aashari/rag-browser --url "https://example.com/login"
{
"actions": [
{"type": "typing", "element": "input[name='username']", "value": "user"},
{"type": "typing", "element": "input[name='password']", "value": "pass"},
{"type": "click", "element": "button[type='submit']"}
]
}
bunx github:aashari/rag-browser --url "https://example.com/login" --plan '<your_json_here>'
rag-browser exposes browser automation via MCP, allowing AI to:
{
"tool": "rag-browser",
"action": {
"url": "https://wikipedia.org",
"debug": false,
"plan": {
"actions": [
{"type": "wait", "elements": ["#searchInput"]},
{"type": "typing", "element": "#searchInput", "value": "Machine Learning"},
{"type": "keyPress", "key": "Enter"},
{"type": "print", "elements": [".mw-search-result"], "format": "markdown"}
]
}
}
}
Response: Markdown content of search results.
src/
├── cli/ # CLI entry point
├── config/ # Constants and versioning
├── core/ # Browser automation logic
├── mcp/ # MCP server implementation
├── types/ # TypeScript types
├── utils/ # Helper functions
└── index.ts # Main entry point
tests/
├── mcp-server.test.ts # Core MCP server tests
├── simple-mcp.test.ts # Simple MCP tests
├── wikipedia-search.test.ts # Wikipedia search tests
├── resource.test.ts # Resource management tests
├── test-utils.ts # Common test utilities
└── README.md # Testing documentation
bun install
bun run src/index.ts --url "https://example.com"
The project includes a comprehensive test suite for the MCP server. The tests use Bun's built-in test runner and the MCP SDK client to test the server's functionality.
# Run all tests
bun test
# Run specific test suites
bun test tests/mcp-server.test.ts
bun test tests/simple-mcp.test.ts
bun test tests/wikipedia-search.test.ts
bun test tests/resource.test.ts
# Or use the npm scripts
npm test
npm run test:mcp
npm run test:simple
npm run test:wikipedia
npm run test:resource
# Run tests with coverage
npm run test:coverage
The test suite includes:
For more information about testing, see the tests/README.md file.
FAQs
A Model Context Protocol server for browser automation using Playwright.
We found that rag-browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.