An MCP server for browser automation that learns and reuses procedures, built for X (Twitter) automation.
xbot-browser is an MCP server built on Playwright with stored tools, memory, and anti-detection.
When you navigate to a site:
-
Known site: Looks up the domain and URL pattern in its database. If stored tools exist (e.g.
x:get-list-feed,x:post-reply), they're immediately available. The LLM calls them by name with parameters, and xbot translates them into Playwright actions. -
New site: No stored tools exist yet, so xbot falls back to raw Playwright tools. As the LLM explores the page, xbot nudges it to save what it learns as reusable tools so the next visit is instant.
- Stored tool system — Save and reuse browser automation procedures across sessions
- Local embeddings — Semantic search for sites/tools via
Xenova/all-MiniLM-L6-v2(no cloud API needed) - Session persistence — Save/load browser login state with
--session-file - Anti-detection — Configurable delays, typing simulation, scroll behavior
- Selector resilience — Fallback selectors and automatic failure tracking
- X (Twitter) tools — Pre-built tools for feed reading, posting, searching, and metrics
xbot/
├── xbot-browser/ # MCP server (Node.js)
│ ├── src/
│ │ ├── xbot-backend.js # Main orchestrator
│ │ ├── action-store.js # DB + local embeddings
│ │ ├── action-translator.js # Tool → Playwright code
│ │ ├── action-tools.js # MCP tool schemas
│ │ ├── action-schema.js # Validation schemas
│ │ ├── tools/
│ │ │ ├── registry.js # Tool lookup logic
│ │ │ ├── fallback.js # Fallback/nudge logic
│ │ │ └── x-tools.js # X-specific handlers
│ │ └── browser/
│ │ ├── session.js # Session save/load
│ │ └── anti-detection.js # Delay helpers
│ └── scripts/
│ └── train-x-tools.js # X tool training script
└── supabase/ # Database migrations
git clone https://github.com/DarlingtonDeveloper/Xbot.git
cd Xbotpsql $DATABASE_URL -f supabase/migrations/0001_init_schema.sql
psql $DATABASE_URL -f supabase/migrations/0005_xbot_schema.sqlcp .env.example .env| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
cd xbot-browser
npm install
npx playwright installnpm run train:x{
"mcpServers": {
"xbot-browser": {
"command": "node",
"args": ["/absolute/path/to/Xbot/xbot-browser/cli.js"]
}
}
}--browser <browser>— Browser to use (chrome,firefox,webkit,chromium,msedge)--headless— Run in headless mode--session-file <path>— Path to session file for persistent login state
XBOT_DELAY_BEFORE_ACTION=500
XBOT_DELAY_AFTER_ACTION=300
XBOT_DELAY_TYPING=80
XBOT_DELAY_JITTER=200Apache 2.0