Skip to main content
Glama
CodeInKlingon

@codeinklingon/browser-mcp

@codeinklingon/browser-mcp

vibecoded port of oh-my-pi's browser tool as an mcp server

MCP server for headless browser automation via Puppeteer. Drop-in replacement for @playwright/mcp with enhanced stealth anti-detection and Playwright-format ARIA snapshots.

Usage

Add to your opencode.json:

{
  "mcp": {
    "browser-mcp": {
      "type": "local",
      "command": ["npx", "-y", "@codeinklingon/browser-mcp"],
      "enabled": true
    }
  }
}

Or install the skill (registers the MCP server + loads AI guidance):

npx skills install @codeinklingon/browser-mcp

Or run directly:

npx @codeinklingon/browser-mcp

Related MCP server: Chrome MCP Stealth

Tools

Tool

Description

browser_tab_open

Open a tab, optionally navigate to a URL

browser_tab_run

Execute JS in the tab — has full tab API in scope

browser_tab_close

Close the tab and release resources

The tab API

Every browser_tab_run call has tab, display, wait, assert in scope.

Navigation & Info

Method

Notes

tab.url()

Current URL (sync)

tab.title()

Page title

tab.goto(url, { waitUntil? })

'load', 'domcontentloaded', 'networkidle'

tab.waitForNavigation({ waitUntil?, timeout? })

Wait for next page load

Click & Input

Method

Notes

tab.click(selector)

CSS, text/, xpath/, aria-ref=

tab.type(selector, text)

Type into input

tab.fill(selector, value)

Clear then type

tab.press(key, { selector? })

'Enter', 'Escape', etc.

tab.hover(selector)

tab.select(selector, ...values)

<select> options

tab.drag(from, to)

Selector or { x, y } point

tab.uploadFile(selector, ...filePaths)

File input

Scrolling & Visibility

Method

Notes

tab.scroll(dx, dy)

Scroll by pixels

tab.scrollIntoView(selector)

Center element in viewport

Page State

Method

Notes

tab.observe()

Accessibility tree: { elements: [{ id, role, name, value, focused }] }

tab.ariaSnapshot()

Playwright-format YAML with [ref=eN] ids, [cursor=pointer] on clickables

tab.evaluate(fn, ...args)

Raw JS in page context

tab.extract(format?)

'markdown' / 'text' / omitted = HTML

tab.screenshot({ fullPage?, selector? })

Base64 PNG

Element Refs

Method

Notes

tab.id(n)

ElementHandleActions from observe() id

tab.ref("e5")

ElementHandleActions from ariaSnapshot() ref

tab.waitForSelector(...)

CSS, text, xpath, aria-ref

tab.waitForUrl(pattern, { timeout? })

String substring or RegExp

tab.waitForResponse(pattern, { timeout? })

String, RegExp, or function

ElementHandleActions: { click, type, fill, hover, focus, screenshot, evaluate, scrollIntoView }

Important

  • display, wait, assert are bare globals — NOT tab.* methods

    • display(x) ✓ — tab.display(x)

    • wait(2000) ✓ — tab.wait(2000)

  • Navigation invalidates refs — re-run ariaSnapshot() or observe() after goto()

  • Single-expression code auto-returns its value (no explicit return needed)

Selector Syntax

Prefix

Example

Notes

(none)

'button.submit'

CSS selector

text/

'text/Sign in'

Visible text (retries 10x)

xpath/

'xpath//button'

XPath

aria-ref=

'aria-ref=e12'

Ref from ariaSnapshot()

Example

await tab.goto('https://example.com/login')
const snap = await tab.ariaSnapshot()
display(snap)
await tab.fill('aria-ref=e5', 'admin')
await tab.fill('aria-ref=e8', 'password')
await tab.click('aria-ref=e12')
await tab.waitForNavigation()
display(tab.url())
const screenshot = await tab.screenshot()
display(screenshot)

Install

# Quick start — installs the skill and registers the MCP server
npx skills install codeinklingon/browser-mcp

# Or manually add to opencode.json (see Usage above)

Build from source

npm install
npm run build

Publish:

npm publish

License

MIT

Available Tools

3 tools
browser_tab_closeA

Close the browser tab and release resources.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of disclosure. It mentions resource release but does not specify whether the operation is instantaneous, requires confirmation, or affects state. Minimal but acceptable for a simple action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with one sentence, front-loading the action. It avoids unnecessary words but could be slightly more detailed without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless tool with no output schema, the description covers the basic purpose and resource release. It might be considered adequate, though more context about behavior (e.g., no prompts) would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so schema coverage is 100%. The description adds no parameter information, but none is needed. Baseline for zero parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: closing the browser tab and releasing resources. It uses a specific verb and resource, and distinguishes well from sibling tools like open and run.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, such as when to close versus leaving a tab open. It does not mention any prerequisites or side effects.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

browser_tab_openC

Open a browser tab, optionally navigating to a URL. Reuses existing tab by name.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlNoURL to navigate to
viewportNo

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description mentions reusing a tab by name but doesn't specify behavior when no URL is provided or what happens to the previous tab content. Side effects are unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short (two sentences) but omits important information about the 'name' reuse mechanism and viewport parameter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and only 2 parameters, the description fails to explain how to specify a tab name for reuse, what the tool returns, or default behavior for optional parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no value beyond the schema for 'url' (schema already says 'URL to navigate to'). The 'viewport' parameter is not described at all, despite being a nested object with no schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Open a browser tab, optionally navigating to a URL' which is clear, but it also says 'Reuses existing tab by name' without a 'name' parameter in the schema, causing confusion about how the reuse works.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus siblings (browser_tab_close, browser_tab_run) or when to avoid it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

browser_tab_runA

Execute JavaScript code in the browser tab. The code runs as an async function body.

CRITICAL RULES:

  • MUST call browser_tab_open before browser_tab_run

  • ALWAYS await async tab methods

  • tab.observe() and tab.goto() invalidate previous element refs

  • Default to tab.observe() for page state; screenshot only when appearance matters

  • For reading static content (articles, docs, JSON, PDFs), prefer webfetch — browser is for JS execution, auth, interactive actions

Available variables in scope:

  • tab — TabApi object: tab.url(): string (sync) tab.title(): Promise tab.goto(url, { waitUntil? }) waitUntil: 'load' | 'domcontentloaded' | 'networkidle' tab.click(selector) CSS, "text/...", "xpath/...", "aria-ref=..." tab.type(selector, text) tab.fill(selector, value) clear + type into input tab.press(key, { selector? }) e.g. 'Enter', 'Escape' tab.hover(selector) tab.scroll(deltaX, deltaY) tab.scrollIntoView(selector) tab.screenshot({ fullPage?, selector? }) returns base64 PNG tab.evaluate(fn, ...args) raw JS in page context tab.observe() accessibility tree: { elements: [{ id, role, name, value, focused }] } tab.ariaSnapshot() Playwright-format YAML tree with [ref=eN] ids, [cursor=pointer] for clickables tab.id(n) ElementHandleActions from observe() id tab.ref("e5") ElementHandleActions from ariaSnapshot() ref tab.waitForSelector(selector, { timeout?, visible?, hidden? }) tab.waitForUrl(pattern, { timeout? }) string substring or RegExp tab.waitForResponse(pattern, { timeout? }) string, RegExp, or (res) => boolean tab.waitForNavigation({ waitUntil?, timeout? }) tab.select(selector, ...values) option(s) tab.drag(from, to) selector or { x, y } point tab.extract(format?) 'markdown' | 'text' | omitted (returns HTML) tab.uploadFile(selector, ...filePaths) file input

ElementHandleActions: { click, type, fill, hover, focus, screenshot, evaluate, scrollIntoView }

  • display(value) — emit structured output (NOT a tab.* method)

  • wait(ms) — delay (NOT a tab.* method; use bare wait(2000), not tab.wait(...))

  • assert(cond, msg?) — guard (NOT a tab.* method)

Selectors: CSS by default, "text/Sign in" for visible text, "xpath/...", "aria-ref=e5" from ariaSnapshot.

Single-expression code auto-returns its value (no explicit 'return' needed). Use display() for intermediate values.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesJavaScript code body to execute

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully bears the burden of behavioral disclosure. It details the async execution context, available methods, and important behaviors like invalidated element refs. No contradictions exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured with critical rules upfront and organized sections. Every sentence adds value for a powerful tool, though some details could be condensed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity with many methods and no output schema, the description thoroughly explains all necessary context, including scope variables and usage patterns like single-expression auto-return.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'code' is fully described in the schema (100% coverage). The description adds useful context about auto-return and single-expression behavior, exceeding the schema's simple description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute JavaScript code in the browser tab' with a specific verb and resource. It distinguishes from sibling tools (browser_tab_close, browser_tab_open) by focusing on code execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit prerequisites (must call browser_tab_open first) and alternatives (prefer webfetch for static content), guiding the agent on when to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.6/5.0
Disambiguation5/5

Each tool has a distinct action: open, run, close. No overlap; an agent can easily select the correct tool for each step of the browser lifecycle.

Naming Consistency5/5

All names follow the exact pattern `browser_tab_<verb>`, with verbs being clear actions. Perfectly consistent.

Tool Count5/5

Three tools cover the essential browser tab lifecycle: open, execute code, close. This is a well-scoped set for the server's purpose.

Completeness4/5

The tools cover the primary workflow (open, run, close). While additional tools for specialized actions (e.g., tab navigation) could be added, the API methods described in the critical rules provide sufficient interactivity, so no dead ends.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    Not graded
    maintenance
    A MCP server that provides browser automation tools, allowing users to navigate websites, take screenshots, click elements, fill forms, and execute JavaScript through Playwright.
    8
    2
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for stealth browser automation that uses human-like interaction patterns to bypass bot detection via the Chrome DevTools Protocol. It enables users to navigate, interact with elements, and capture data from websites using undetectable behaviors like Bezier mouse movements and Gaussian typing delays.
    165
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Self-hosted MCP server for browser automation using Puppeteer, with tools for navigation, screenshots, mouse interactions, cookie management, and multiple transport protocols.
    2,359
    20
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server for headless browser automation using Puppeteer, enabling AI to navigate, click, fill forms, take screenshots, and execute JavaScript on web pages.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CodeInKlingon/browser-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server