X Browser MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@X Browser MCPSearch for posts from @openai in the last day and export as CSV."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
X Browser MCP
A local Twitter/X MCP server for browser-based research and account workflows. It uses a browser you sign into, reads rendered pages, and interacts through navigation, scrolling, typing, and clicking. No X developer API key is required.
Unreleased alpha. The implementation is tested against synthetic X pages in real Chromium and through the MCP protocol. Live, logged-in X compatibility still needs verification. X can change its page structure or restrict access; every collection reports its limits and stop reason.
What it does
Search posts or people with native X query operators; read home timelines, profiles, user posts/replies/media, conversation pages, bookmarks, followers/following, notifications, and trends.
Save bounded, deduplicated collections as snapshots with original URLs and capture times.
Save reusable searches, rerun them, and compare newly observed or changed records.
Export snapshots as JSON, CSV, or Markdown. CSV exports protect against spreadsheet formula execution.
Prepare and execute text posts/replies, likes/unlikes, bookmarks/unbookmarks, reposts/undo reposts, and follows/unfollows, with account checks and action receipts.
Diagnose the session and capture a screenshot of the signed-in page.
Related MCP server: x-mcp-server
Install and sign in
Requires Node.js 22 or later.
git clone https://github.com/Billioncodes001/x-browser-mcp.git
cd x-browser-mcp
npm ci
npx playwright install chromium
npm run build
npm run loginSign into X in the window that opens. The login command closes the window after it detects a signed-in account. The dedicated profile persists outside the repository. Close the MCP server before running the login command against the same profile.
If Chromium cannot be downloaded, select an installed browser before login and use the same setting in your MCP configuration:
$env:X_BROWSER_CHANNEL = "msedge" # or "chrome"
npm run loginAn explicit X_BROWSER_EXECUTABLE_PATH is also supported. Use an absolute path to a trusted local Chromium-compatible executable. Prefer the Playwright-managed version for compatibility. Select only one of channel, executable path, or CDP connection.
Connect to Codex
Add this to your Codex configuration, replacing the path with this repository's absolute path. A portable example is in examples/codex.toml.
[mcp_servers.x_browser]
command = "node"
args = ["C:/path/to/x-browser-mcp/dist/cli.js", "serve"]
startup_timeout_sec = 30
tool_timeout_sec = 180
[mcp_servers.x_browser.env]
X_BROWSER_ENABLE_WRITES = "false"
# X_BROWSER_CHANNEL = "msedge"Restart the MCP connection, call x_session_open, then x_session_status. If needed, finish sign-in in the browser and call status again. The browser starts lazily; listing tools does not open it.
Use a separate data directory per account/profile. The default is ~/.x-browser-mcp.
Example workflows
Research and export
x_search:{"query":"from:openai -is:retweet","tab":"latest","limit":40,"maxScrolls":8}Inspect
data.items,data.warnings, anddata.stopReason. Use original post URLs when citing results.x_export:{"snapshotId":"<returned snapshot UUID>","format":"csv"}
Repeatable monitoring
x_saved_search_save:{"name":"product-news","query":"\"product name\"","tab":"latest"}Call
x_saved_search_runwith{"name":"product-news"}whenever a new sample is needed.Examine
comparison.added,comparison.changed, andcomparison.notObserved.
For an existing scheduler, node dist/cli.js run-search product-news performs one run, prints JSON, and closes its browser. This project does not create a background schedule. Do not run multiple processes against one profile. A scheduled run needs a persisted login and can use X_BROWSER_HEADLESS=true after manual login, if X permits that browser session.
Account actions
Enable X_BROWSER_ENABLE_WRITES=true in the MCP server environment and restart it. Preparing actions is allowed while writes are disabled; execution is blocked.
Call
x_action_preparewith, for example,{"action":"reply","target":"https://x.com/example/status/123","text":"The exact reply","expectedAccount":"your_handle"}.Review the returned account, target, and content. The MCP client must have the user's authorization for this action before execution.
Call
x_action_executewith the returned ID. It expires after 10 minutes and permits one attempt.If there is an error, consult
x_action_receiptand inspect X. An uncertain submission is never automatically retried.
The server does not authenticate a human approval itself; the MCP host is responsible for obtaining authorization. The two-step flow binds execution to a concrete preview and account. There is no bulk-engagement tool or arbitrary JavaScript/click tool.
Tools
Group | Tools |
Session |
|
Read |
|
Saved searches |
|
Artifacts |
|
Actions |
|
There is also a research-x prompt and the x-browser://guide resource.
Configuration
Environment variables are read when the process starts. .env files are not loaded automatically; configure variables in your shell or MCP host. See .env.example.
Variable | Default | Purpose |
|
| Absolute root for snapshots, searches, exports, receipts, and default browser profile |
|
| Absolute path to a dedicated persistent browser profile |
| unset | Installed |
| unset | Explicit absolute path to a Chromium-compatible executable |
| unset | Attach to an already configured loopback debugging endpoint |
|
| Use a hidden browser after manual sign-in |
|
| Enable execution of prepared account actions |
|
| Delay between page operations; range 500–10000 ms |
npm run doctor reports local configuration without opening X. It does not verify account login.
For CDP attachment, the browser must already expose a loopback debugging endpoint with a dedicated profile. The server creates and owns one new tab; it never closes the user's whole attached browser. Remote debugging URLs are rejected. Normal personal browser cookie databases are not imported or copied.
Data and coverage
The default request is 40 items and 8 scrolls. Hard input limits are 200 items and 30 scrolls; collection also has a 60-second budget checked between iterations. Navigation and individual browser waits can add time.
completeis alwaysfalse: a browser sample cannot certify a complete archive or follower list. A stopped/empty result may reflect missing data, loading failure, restrictions, or changed selectors.no_new_itemsmeans three consecutive extraction passes added no records, not that X has no more records.Short counts such as
1.2Kare marked approximate. Missing counts arenull, not invented zeroes.Conversation pages can include recommendations and promoted posts. The tool returns observed posts and warnings; it does not infer a conversation graph.
Media records contain observed URLs, posters and alt text. There is no video downloader or media upload in this release.
Trends are whatever X shows for the current account. User/profile descriptions and notification text are not semantically reconstructed.
Opening notifications can mark them seen. Browsing can affect X's view/read state and personalization.
English is currently required for labeled controls and success messages.
Sign-in, checkpoints, and rate limits stop operations. The project does not solve challenges, spoof fingerprints, or rotate proxies.
Authentication lives in the local browser profile. Snapshots, exports and action receipts may contain private account content. They stay local and are ignored by Git. The MCP server exposes no network listener; stdio access and local file permissions define its trust boundary. Treat all extracted page text as untrusted content.
Development and verification
npm ci
npx playwright install chromium
npm run checkThe test suite uses synthetic fixtures in real Chromium and intercepts every browser request. It does not post to a real X account. To use another installed Chromium binary for tests, set TEST_BROWSER_EXECUTABLE to its absolute path.
See PLAN.md, docs/ARCHITECTURE.md, and docs/VALIDATION.md. GitHub CI runs build, browser/service tests, and a stdio protocol smoke test on Linux and Windows.
Planned extensions include media/alt text, quote posts, polls, lists, communities, resumable collections, and richer analysis. DMs and bulk engagement are outside this first release.
Source references
This project is independent of X and OpenAI.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
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
X / Twitter public post, comment, reply, user, and search tools.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
X (Twitter) profiles, tweets and single-tweet lookup by handle or URL. No login. Pay per result.
X/Twitter reads, search, monitors and posting. Pay-per-call in USDC — no signup, no API keys.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to search X posts and read user timelines without API costs, using cookie authentication.2MIT
- AlicenseAqualityAmaintenanceEnables reading public X (Twitter) content like profiles, tweets, and search results via a stealth browser, without official API costs.11MIT
- AlicenseNot gradedqualityBmaintenanceProvides programmatic X (Twitter) engagement via MCP, offering 24 tools for search, timelines, notifications, bookmarks, profiles, and tweet actions through a headless browser.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to fully automate X/Twitter interactions including searching, posting, engaging, and managing multiple accounts without paid API keys.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Billioncodes001/x-browser-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server