x-use — MCP server for X (Twitter)
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**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.
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.10+ and Chromium. The CI matrix covers Python 3.10–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.