Back to docs

MCP Server

Run CBrowser as an MCP server for Claude Desktop integration.

Looking for Remote MCP? See Remote MCP Server for deploying CBrowser as a remote MCP server for claude.ai custom connectors. No local installation required!


What is MCP?

MCP (Model Context Protocol) is Anthropic's standard for connecting AI assistants to external tools. CBrowser implements an MCP server that gives Claude direct browser automation capabilities.


Why Use MCP?

Without MCP With MCP
Copy-paste commands manually Claude executes directly
View results separately Results inline in conversation
No context awareness Claude sees page state
Manual iteration Autonomous workflows

Setup

1. Install CBrowser

npm install -g cbrowser

2. Configure Claude Desktop

Edit claude_desktop_config.json at the path for your OS:

Platform Config Path
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json
Linux ~/.config/Claude/claude_desktop_config.json

Tip: You can also open this file via Settings > Developer > Edit Config in Claude Desktop.

Note: If the folder or file doesn't exist, create it. On Windows, use double backslashes (\\) in paths.

Add the CBrowser MCP server:

{
  "mcpServers": {
    "cbrowser": {
      "command": "npx",
      "args": ["cbrowser", "mcp-server"]
    }
  }
}

3. Restart Claude Desktop

The CBrowser tools will appear in Claude's tool list.


Available Tools

Once configured, Claude can use these tools:

Navigation

Tool Description
navigate Navigate to URL and screenshot
screenshot Take screenshot of current page

Interaction

Tool Description
click Click element by selector
smart_click AI-powered click with retry
fill Fill form field

Analysis

Tool Description
assert Natural language assertion
analyze_page Analyze page structure
generate_tests Generate test scenarios
extract Extract data from page

Sessions

Tool Description
save_session Save browser session
load_session Load saved session

Self-Healing

Tool Description
heal_stats Selector cache stats

Security

Tool Description
security_audit Scan MCP tools for prompt injection patterns

Example Conversations

Basic Navigation

You: "Go to github.com and take a screenshot"

Claude: Uses navigate tool

"I've navigated to GitHub. Here's what I see: [screenshot] The page shows the GitHub homepage with trending repositories and a search bar."

Form Filling

You: "Fill out the contact form on example.com/contact with my info"

Claude: Uses navigate, fill, smart_click tools

"I've filled out the contact form:

  • Name: [your name]
  • Email: [your email]
  • Message: [your message]

Should I submit it?"

Page Analysis

You: "Analyze the login page at myapp.com/login"

Claude: Uses analyze_page tool

"Here's my analysis of the login page:

  • 1 form with 3 fields (email, password, remember me)
  • Login button labeled 'Sign In'
  • 'Forgot Password' link present
  • Social login options: Google, GitHub
  • No CAPTCHA detected

I can generate test scenarios for this page if you'd like."

Test Generation

You: "Generate tests for the checkout flow"

Claude: Uses navigate, analyze_page, generate_tests tools

"I've analyzed the checkout flow and generated these test scenarios:

# Test: Guest Checkout
go to https://myapp.com/cart
click 'Proceed to Checkout'
fill email with '[email protected]'
click 'Continue as Guest'
verify url contains '/shipping'
...

Want me to run these tests?"


Session Persistence

MCP sessions can persist browser state:

You: "Log into my GitHub account and save the session"

Claude: Uses navigate, fill, smart_click, save_session tools

"I've logged into GitHub. Session saved as 'github-logged-in'.

In future conversations, I can load this session to skip the login step."

Later...

You: "Load my GitHub session and check my notifications"

Claude: Uses load_session, navigate, extract tools

"Loaded your GitHub session. You have 3 unread notifications:

  1. New PR review on repo/project
  2. Issue mention in org/repo
  3. Release published for lib/package"

Safety in MCP

Constitutional safety applies to all MCP operations:

You: "Delete all my GitHub repositories"

Claude: "I can't do that. Deleting repositories is a Red Zone action that could cause irreversible data loss.

If you're certain, you can use the --force flag, but I recommend:

  1. First listing what would be deleted
  2. Creating backups
  3. Confirming each deletion individually

Would you like me to list your repositories instead?"


Configuration

Environment Variables

Set in Claude Desktop config:

{
  "mcpServers": {
    "cbrowser": {
      "command": "npx",
      "args": ["cbrowser", "mcp-server"],
      "env": {
        "CBROWSER_HEADLESS": "true",
        "CBROWSER_TIMEOUT": "60000"
      }
    }
  }
}

Persistent Context

Keep browser open between tool calls:

{
  "mcpServers": {
    "cbrowser": {
      "command": "npx",
      "args": ["cbrowser", "mcp-server", "--persistent"]
    }
  }
}

Troubleshooting

Tools Not Appearing

  1. Check Claude Desktop config syntax (valid JSON)
  2. Restart Claude Desktop completely
  3. Check CBrowser is installed: npx cbrowser --version

"Browser not starting"

  1. Install Playwright browsers: npx playwright install chromium
  2. Check for display issues (Linux): Set DISPLAY environment variable

Timeout Errors

Increase timeout in config:

{
  "env": {
    "CBROWSER_TIMEOUT": "120000"
  }
}

Permission Errors

If running on Linux without display:

{
  "env": {
    "CBROWSER_HEADLESS": "true"
  }
}

Comparison to Other Browser MCPs

Feature CBrowser MCP Playwright MCP Browser-Use
Self-healing selectors
Constitutional safety
Session persistence ⚠️ ⚠️
Persona simulation
Test generation
Natural language assertions

Related


Copyright: (c) 2026 Alexa Eden.

License: MIT License

Contact: [email protected]

From the Blog