x-mcp-playwright
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-mcp-playwrightsearch for tweets about #AI from @OpenAI with at least 50 likes"
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-mcp-playwright
A Twitter/X MCP server powered by patchright (stealth Playwright fork) and a persistent Chrome user profile.
9 grouped tools — 33 actions preserved, zero functionality lost.
1. Install
git clone <this-repo> x-mcp-playwright
cd x-mcp-playwright
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate
pip install -e .
patchright install chromiumOne-time login
x-mcp-login
# or: python login.pyOpens a real browser window. Log in to X normally, then close the window. Session saved in ~/.x-mcp-playwright/profile/.
2. Register in your MCP client
Claude Code
claude mcp add --scope user x-twitter x-mcp-serverClaude Desktop
{
"mcpServers": {
"x-twitter": {
"command": "x-mcp-server",
"env": { "X_MCP_HEADLESS": "1" }
}
}
}If x-mcp-server isn't on PATH, use:
{
"mcpServers": {
"x-twitter": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "x_mcp_server"]
}
}
}Docker (headless VPS)
docker build -t x-mcp-playwright .
docker run -i --rm \
-v ~/.x-mcp-playwright/profile:/root/.x-mcp-playwright/profile \
x-mcp-playwright3. Tool catalog (9 tools, 33 actions)
x_post — Publish tweets (6 actions)
action | Required args | Description |
|
| Post a single tweet |
|
| Post a connected thread |
|
| Up to 4 images or 1 video |
|
| Reply to a tweet |
|
| Quote-tweet with comment |
|
| Delete your tweet |
x_engage — Interact with tweets (4 actions)
action | Required args |
|
|
|
|
|
|
|
|
|
|
|
|
|
x_user — User operations (6 actions)
action | Required args | Optional |
|
| — |
|
|
|
|
|
|
|
|
|
|
| — |
|
| — |
x_search — Search tweets (simple + advanced)
arg | Default | Description |
| — | Keywords to search |
|
|
|
| — | Filter by author |
| — | Filter by reply-to |
| — | Date range (YYYY-MM-DD) |
| 0 | Minimum likes |
| 0 | Minimum retweets |
| — | Language code |
| 10 | Max results |
x_feed — Browse feeds (4 actions)
action | Description |
| Your home timeline. Optional: |
| Your saved bookmarks |
| Mentions, likes, follows |
| What's happening |
x_tweet — Tweet details (4 actions)
action | Required args | Description |
|
| Full tweet with metrics |
|
| Replies under a tweet |
|
| Impressions/engagements (own tweets) |
|
| Who liked/retweeted ( |
x_list — Lists
Scenario | Args |
Your lists | No args |
User's lists |
|
List tweets |
|
x_dm — Direct messages (3 actions)
action | Required args | Description |
|
| Send a DM |
| — | List recent DM threads |
|
| Read messages with a user |
x_session — Session management (2 actions)
action | Description |
| Returns |
| Capture any X page. Optional: |
4. Environment variables
Variable | Default | Description |
|
|
|
|
| Default Playwright timeout (ms) |
|
| Debug screenshots |
|
|
|
5. Safety
Rate limiter: Write actions (post, delete, DM, reply) capped at 1/min. Engage actions (like, RT, follow) capped at 2/min. Read actions unlimited.
Session keepalive: Background task pings X every 30 min. Logs warning if session expires.
Pinned to your real account. Anything the LLM does, you did.
6. MCP resources
x://session/status— Login statex://version— Server versionx://tools/list— All toolsx://tools/categories— Grouped taxonomy
7. MCP prompts
analyze_tweet(tweet_url)— Fetch & analyze a tweet (sentiment, engagement, response tone)draft_reply(tweet_url, intent)— Draft 3 reply variants under 280 chars
7. Development
make install # deps + chromium
make login # interactive X login
make test # unit tests (no browser)
make smoke # live search test
make server # run MCP server
make lint # compile-check
make clean # remove pycache, screenshots8. Safety
Pinned to your real account. Anything the LLM does, you did.
Cap: <= 1-2 publish/reply actions per minute.
Gate destructive tools (
delete,block,send_dm) behind human approval on VPS.
License
MIT
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
FastMCP server for posting formatted content to X (Twitter) — Tollbooth-monetized, DPYC-native
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
Remote MCP server for The Colony — a social network for AI agents (posts, DMs, search, marketplace).
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/Steph-ux/x-mcp-playwright'
If you have feedback or need assistance with the MCP directory API, please join our Discord server