
X-Use - X (Twitter) MCP Server
io.github.ihuzaifashoukat由 GitHub 帳號 ihuzaifashoukat 發布v3.2.0更新於 Oct 24, 2026
Research X (Twitter), read inboxes and review publishing through MCP. No X API key required.
概覽
本機 MCP 伺服器,透過已登入的 X(Twitter)瀏覽器工作階段,讓助理研究帳號、讀取收件匣並暫存待審核的發布內容。
- 可以做什麼
- 搜尋 X,檢視帳號資料、貼文、媒體與有限範圍的推文串脈絡,用於回覆前研究,或起草外聯訊息與追蹤動作以供逐筆核准,潛在客戶與活動保存在本機記錄中。讀取收件匣、對話請求與通知,並執行支援的對話操作。將貼文、回覆與多則貼文串暫存為持久草稿,再核准、排入佇列,或編輯與刪除自己的貼文。檢查帳號健康度、工作階段狀態與代理連線,並追蹤結果不確定的動作。
- 適用情境
- 適合讓助理研究 X 帳號與推文串、整理 X 收件匣,或準備貼文、回覆與外聯內容並在發布前由你審核,且不需要官方 X API 金鑰。
- 執行需求
- 以 Python 套件形式透過 stdio 在本機執行(需要 Python 3.10+ 與 Patchright 安裝的 Chromium)。初始化時從本機 JSON 匯出檔匯入你自己的 X 工作階段 Cookie。需在用戶端設定中將 X_USE_HOME 設為穩定的絕對私有資料目錄。OPENAI_API_KEY 為選用,僅供伺服器端文字生成;OPENAI_BASE_URL 為選用,指向相容 OpenAI 的端點。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 X-Use - X (Twitter) MCP Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
x-use — MCP server for X (Twitter)
[x-use logo — research, draft, review and publish with an MCP server for X (Twitter)]
Connect your AI client to X research, inbox reads, and reviewed publishing.
x-use is an open-source Python Model Context Protocol (MCP) server and CLI for X (Twitter). Connect Claude, Codex, Cursor or another local MCP client to profile research, inbox management and reviewed publishing. It uses your authenticated browser session, supports multiple accounts and runs locally without official X API credentials.
[PyPI] [Python] [CI] [MIT license] [GitHub stars]
Quickstart · Documentation · Tool reference · Discussions · Contribute
What can you do with x-use?
- Research before replying: search X, inspect a profile, read posts and bounded thread context, and prepare a relevant reply.
- Work through your inbox: inspect visible conversations, unread messages, requests and notifications; prepare individual messages and supported conversation actions for review.
- Publish with context: stage posts or multi-post threads, inspect the exact text, and approve the draft when it is ready.
- Organize outreach locally: maintain leads, opt-outs and campaign drafts with per-account limits and delivery tracking.
Your AI client supplies the reasoning and text. An optional OpenAI-compatible LLM configuration supports server-side generation; ordinary explicit-text MCP workflows do not need that extra key.
Quickstart
Requires Python 3.11+ and Chromium. The CI matrix covers Python 3.11–3.14 on Windows, macOS and Linux.
Version 3.2.0 provides 82 tools for research, inbox management, reviewed publishing and account operations. Upgrade the package and restart your MCP client to load the current tools.
1. Install the server and browser
2. Choose a private data directory and initialize
Windows PowerShell:
macOS / Linux:
The wizard configures your account and imports your own X session cookies from a local JSON export. Keep cookies and inbox PINs private. Use the same absolute data directory in your client configuration below; shell environment settings alone do not configure a desktop client.
3. Connect your MCP client
Use this stdio configuration in clients that accept an mcpServers object, such as Claude Desktop:
Replace both paths. On Windows, use the installed x-use.exe path and forward slashes in JSON, for example C:/Users/you/AppData/Local/x-use for the data directory. Locate the executable with Get-Command x-use in PowerShell or command -v x-use on macOS/Linux.
Claude Code, Codex, Cursor and Windsurf have their own registration locations or commands. Follow the client setup instructions, then reload the client if required. Ask it to call list_accounts before starting browser work.
4. Try a first workflow
With draft mode enabled, ask your client:
Check my account health, research the profile I specify, and summarize its recent visible posts. Prepare one relevant reply draft and show me its ID and exact text. Wait for my approval before publishing.
The flow is get_account_health → get_profile_context → prepare_reply → reply_to_tweet → get_draft. The reply tool stages a draft under the default policy; prepare_reply supplies context. Use approve_draft only when authorized.
More workflow examples cover inbox triage, outreach and threads.
Install from source or let your agent handle setup
On Windows you can use py -3 scripts/setup_uv.py --dev; on macOS/Linux use python3 if needed. Setup installs uv when missing, synchronizes locked dependencies into .venv, installs matching Chromium, creates missing sample configuration and runs diagnostics. Activate the environment or use its executable directly. Then initialize your account.
For assisted installation, use the setup prompt or install the root setup skill:
The Claude Code plugin includes the bundled skills and MCP configuration guidance.
Capabilities
Version 3.2.0 includes 82 tools, seven prompts, four resource patterns and seven bundled skills. 3.1.0 added runtime diagnostics, campaign previews, bookmarks, reviewed post edits/deletions, engagement reversal and inbox controls to the 70 tools in 3.0.0; 3.2.0 keeps the same tools on the MCP Python SDK v2 line. See publishing and inbox controls for supported layouts and testing limits.
The MCP guide documents every tool, prompt and resource. Validation evidence separates local protocol checks, synthetic browser fixtures and authorized live-account checks.
For a uvx client, use uvx x-use-mcp or pin the release with
uvx x-use-mcp==3.2.0. The x-use-mcp executable starts MCP without arguments;
the existing x-use mcp command remains supported. Clients pinned to 3.0.0
must use uvx --from x-use-mcp==3.0.0 x-use mcp.
How execution works
The current MCP runtime uses async Patchright Chromium with separate account contexts. Your configuration, cookies, drafts, queue and action journals live under X_USE_HOME. AI-client and optional model-provider data handling depends on the client and provider you choose.
The protocol implementation uses the MCP Python SDK v2 line (mcp>=2.3,<3). It negotiates handshake protocol versions 2024-11-05 through 2025-11-25 with existing clients.
Draft mode is enabled by default for ordinary publishing. Messages, follows and thread starts require draft approval. Direct publishing mode, explicit queue processing, opt-in auto-drain and the legacy batch runner have separate execution paths. Review the configuration reference before changing these settings.
The development checkout allows one MCP server process per X_USE_HOME, preventing concurrent servers from using stale draft and queue state. Close the existing connection before opening the same data directory in another client.
Limits to understand
- Browser reads are bounded by visible X content. Followers, inboxes and threads are not complete exports; unavailable evidence remains unknown.
- Opening conversations or notifications can change their native read state.
- Encrypted inboxes may need the account owner's PIN again after a browser-context restart.
- Analytics currently reports availability and the observed Premium gate; it does not provide a complete analytics dashboard.
- X layout changes, expired sessions, account challenges and platform limits can interrupt work. Local controls do not guarantee protection from account restrictions.
- The legacy Selenium batch engine (
x-use run/run_cycle) executes separately from MCP draft review. Community posting is not currently verified in the async runtime.
See browser behavior and recovery and responsible-use guidance.
Frequently asked questions
Does x-use require an X API key?
No. It operates visible X pages through a browser authenticated with your session cookies. It does not require official X API credentials. Optional server-side text generation may require an LLM provider key.
Which MCP clients can use x-use?
Clients that launch local stdio MCP servers can use x-use. Setup examples cover Claude Desktop, Claude Code, Codex, Cursor and Windsurf. Client-specific discovery and reload behavior varies.
Does x-use automatically send every drafted message?
No. Message drafts require individual approval. Other write behavior depends on draft mode, queue execution and the legacy runner; check the configured policy before requesting actions.
Can I manage multiple X accounts?
Yes. Accounts have separate cookies, browser contexts and policy settings, with optional proxy routes. Browser capacity is bounded and depends on your host and configuration.
Can I edit posts or manage my X inbox?
Version 3.1.0 added reviewed edits and deletion of your own posts, bookmarks, unfollowing, and supported conversation request, mute/unmute and deletion actions. X determines edit eligibility. Inbox history is partial, and per-message editing/deletion, attachment sending and group administration are not implemented. See the controls guide for exact arguments and limits.
Is x-use free and open source?
The project is MIT licensed with no project license fee. AI-client subscriptions, optional model providers, proxies and hosting may have their own costs.
Is x-use affiliated with X?
No. x-use is an independent community project. X and Twitter are names used to identify the platform it works with.
Was this project called twitter-automation-ai?
Yes. The project was renamed to x-use during the v2 relaunch. See the changelog for its history.
Documentation and community
Start with the documentation index. It links setup, workflows, tools, configuration, presets, architecture and troubleshooting. X-Use is maintained by Huzaifa Shoukat and welcomes community contributions.
Found a reproducible problem? Report a bug. Have a workflow to share? Start a discussion. Useful first contributions include clearer setup instructions, fictional browser fixtures, platform fixes and example presets.
See CONTRIBUTING, the Code of Conduct and security policy. If x-use helps your work, a GitHub star helps other developers discover it.
Star history
[Live star history for x-use]License
MIT.
來源:README.md,提交 fb2cb90
工具
0版本歷史
4- v3.2.0最新Oct 13, 2026
- v3.1.0Oct 12, 2026
- v3.0.0Oct 9, 2026
- v2.4.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分