Skip to main content
Glama
botcan-mcp
by Nerd0822

botcan

YAML-driven browser automation and scraping. Write a recipe, run it, get extracted data plus downloaded files. Runs Firefox through Playwright; every run uses a fresh disposable browser profile.

Setup

Requires uv.

uv sync
uvx playwright install firefox     # one-time per machine

Related MCP server: marionette-mcp

Run a recipe

uv run python main.py                       # demo recipe, visible browser
uv run python main.py my_recipe.yaml        # any recipe
uv run python main.py my_recipe.yaml ./out  # custom output dir (default: ./output)

Extracted data is printed as JSON. download, screenshot, and save steps write into the output dir. On failure the CLI prints botcan: StepError: ... and exits 1.

The demo recipe points at http://127.0.0.1:5500/Projects_/Botcan/demo/demo.html; serve the repo's parent directory on port 5500 (VS Code Live Server does this by default) or adjust the open: URL to wherever demo/demo.html is served.

Recipe format

Top level: open (URL — starts the browser when hit), steps (list), close (optional marker). Each step is a single-key mapping.

open: https://example.com
steps:
  - fill: {selector: "#search", value: "weather"}
  - press: {selector: "#search", key: "Enter"}
  - wait: {selector: "#results", timeout: 5000}
  - extract: {selector: "#results h3", all: true}
  - copy_link: {selector: "a.permalink", key: "permalink"}
  - screenshot: {path: "results.png", full_page: true}
  - save: {path: "results.json", format: json}
close:

Actions and required args: click(selector), check(selector), uncheck(selector), clear(selector), fill(selector, value), press(selector, key), select(selector, value), hover(selector), scroll(selector), wait(selector, timeout?), copy_link(selector, key), extract(selector, first?|all?), download(selector, path), screenshot(path, full_page?), save(path, format).

extract and copy_link fill extracted_data: the former under the selector, the latter under key. A step before open fails with "browser is not open".

Run as an MCP server

uv run python server.py

Two tools: play_recipe (path to a recipe file) and play_steps (inline YAML). Both return:

{"extracted_data": {"#product-name": "...", "internal_link": "https://..."}, "error": null}

Bad YAML, unknown actions, and failed steps return a string in error (not an exception), and extracted_data keeps everything collected before the failure.

Register with your AI app, pointing --directory at this checkout:

# OpenCode (global for every project)
opencode mcp add botcan --global -- uv --directory <path-to-botcan> run python server.py
// OpenCode — ~/.config/opencode/opencode.jsonc
"mcp": {
  "servers": {
    "botcan": {
      "type": "local",
      "command": ["uv", "--directory", "<path-to-botcan>", "run", "python", "server.py"]
    }
  }
}
// Claude Desktop — claude_desktop_config.json
{ "mcpServers": { "botcan": { "command": "uv", "args": ["--directory", "<path-to-botcan>", "run", "python", "server.py"] } } }
# Claude Code
claude mcp add botcan -- uv --directory <path-to-botcan> run python server.py
# Codex — ~/.codex/config.toml
[mcp_servers.botcan]
command = "uv"
args = ["--directory", "<path-to-botcan>", "run", "python", "server.py"]

Skill (teaches models the recipe language)

skills/botcan/SKILL.md — copy (or symlink) that directory into ~/.claude/skills/botcan/. Claude Code reads it natively; OpenCode discovers it through its ~/.claude/skills compatibility scan. For claude.ai, upload it as a ZIP in Settings → Skills:

zip -r botcan-skill.zip skills/botcan

Layout

main.py      CLI runner
scraper.py   recipe engine: actions, extraction, errors
server.py    MCP server: play_recipe / play_steps
demo/        demo page + recipe
skills/      model-facing skill for the recipe language

Available Tools

2 tools
play_recipeB

Execute a YAML recipe file: open pages, run browser steps, return extracted data.

Inputs: recipe_path (required), output_dir. Returns: result

play_stepsC

Execute an inline YAML recipe string (agent-generated). Args mirror recipe file format.

Inputs: recipe_yaml (required), output_dir. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 2 tools

    Disambiguation3/5

    Both tools execute YAML recipes; the only difference is file vs inline string input. Descriptions clarify the distinction, but the core action overlaps, and the names play_recipe vs play_steps could confuse an agent about which to use.

    Naming Consistency5/5

    Both tools follow a clear verb_noun pattern with the same verb 'play_', making the naming predictable and consistent throughout.

    Tool Count3/5

    Only two tools are provided, which feels thin for a recipe execution server. While both earn their place, the set is borderline minimal for the apparent scope.

    Completeness3/5

    The surface covers file-based and inline execution, but notable operations like recipe validation, listing available recipes, or error handling without execution are missing. Agents can work around these gaps, but they are significant.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables web search and browser automation against a real, locally installed Firefox driven over its built-in Marionette TCP protocol. Exposes tools for multi-engine search, JS-rendered page text and link extraction, screenshots, cookie save/load, and arbitrary JS evaluation, with SSRF guarding, rate limiting, and untrusted-content wrapping.
      10
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude Code to drive a local Firefox browser: opening and managing tabs, navigating, reading page structure and text, clicking, typing, filling forms, running JavaScript, taking screenshots, and inspecting console messages and network requests. Everything runs over a local Unix socket with no network traffic, and actions are restricted to tabs explicitly placed under Claude's control.
      GPL 3.0
    • A
      license
      A
      quality
      B
      maintenance
      Let AI agents use the Firefox, Zen, or LibreWolf browser you already have open, with your logins, cookies, and extensions intact. No Playwright, Chromium, or WebDriver. Agents work in background tabs while you keep browsing: read pages, click, fill forms, take screenshots, and capture network traffic. A WebExtension plus a local bridge lets several agents share one browser.
      6
      282 PyPI
      44
      MIT