An AI-powered MCP (Model Context Protocol) server that provides a natural language interface to browser automation. This server acts as an intelligent wrapper around the official Playwright MCP server, allowing you to control browsers using plain English commands through Claude.
- Natural Language Browser Control: Execute browser automation tasks using plain English commands
- Claude Integration: Leverages Claude's AI capabilities through OAuth (using your Claude Code subscription)
- Intelligent Tool Mapping: AI automatically translates your commands into appropriate Playwright tool calls
- Session Management: Maintain context across multiple browser automation commands
- Error Recovery: Smart error handling with helpful feedback
To install Browser AI for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @qckfx/browser-ai --client claude
npm install -g @qckfx/browser-ai
Or use directly with npx:
npx @qckfx/browser-ai
The Browser AI MCP server requires Anthropic API access. You have two authentication options:
If you have a Claude subscription, authenticate with your Claude account to use your subscription credits:
npx @qckfx/browser-ai --auth
This will open a browser window for OAuth authentication. After authorizing, the token will be saved securely and your API usage will be charged to your Claude subscription rather than requiring separate API credits.
Alternatively, you can use an Anthropic API key by setting the environment variable:
export ANTHROPIC_API_KEY="your-api-key-here"
After authentication, add the server to Claude Code:
claude mcp add browser-ai -- npx --yes @qckfx/browser-ai@latest
If using API key authentication, you can pass it as an environment variable:
claude mcp add browser-ai --env ANTHROPIC_API_KEY="your-api-key-here" -- npx --yes @qckfx/browser-ai@latest
If using Claude Desktop instead, add the following to your Claude Desktop configuration file (claude_desktop_config.json
):
{
"mcpServers": {
"browser-ai": {
"command": "npx",
"args": ["@qckfx/browser-ai"],
"env": {
"PLAYWRIGHT_MCP_PATH": "@playwright/mcp@latest"
}
}
}
}
Once configured, you can use natural language commands in Claude to control browser automation:
- Navigation: "Go to example.com and wait for the page to load"
- Clicking: "Click the login button"
- Form Filling: "Fill the username field with '[email protected]'"
- Screenshots: "Take a screenshot of the current page"
- Complex Tasks: "Fill out the registration form with test data and submit it"
- You provide a natural language command to Claude
- The AI interprets your intent and breaks it down into Playwright tool calls
- The server executes these tools via the Playwright MCP server
- Results are returned in a user-friendly format
browser-ai/
├── src/
│ ├── auth/ # OAuth authentication
│ ├── mcp/ # MCP server and client
│ ├── ai/ # AI agent and tool mapping
│ ├── provider/ # Custom AI SDK provider
│ └── index.ts # CLI entry point
git clone <repository>
cd browser-ai
npm install
npm run build
Run the integration test:
npm test
Enable debug logging:
npx browser-ai --debug
User Command → Claude → Browser AI MCP → AI Agent → Playwright MCP → Browser
↓
Claude (via OAuth)
The server exposes a single browser_ai
tool that accepts natural language commands. It then:
- Uses Claude to interpret the command
- Generates a sequence of Playwright tool calls
- Executes them via the Playwright MCP client
- Returns a human-friendly summary
If you encounter authentication errors:
- Run
npx browser-ai --auth
to re-authenticate - Ensure you have an active Claude Code subscription
- Check that the token hasn't expired
If the server fails to connect to Playwright MCP:
- Ensure Playwright MCP is installed:
npm install -g @playwright/mcp
- Check the
PLAYWRIGHT_MCP_PATH
environment variable - Enable debug mode to see detailed logs
If commands fail to execute:
- Ensure the browser is in the expected state
- Try breaking complex commands into simpler steps
- Check the debug logs for specific error messages
- Node.js 18 or higher
- Active Claude Code subscription
- Playwright MCP server
MIT
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
For issues and feature requests, please use the GitHub issue tracker.