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-ai-mcpanalyze the current sentiment around AI agents on X"
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-ai-mcp
X (Twitter) MCP server with Grok-powered intelligence. Personal account access + AI analysis in one package.
20 tools: 16 X API tools for reading/writing + 4 Grok intelligence tools for real-time analysis.
Setup
1. Install
2. Configure
Copy .env.example to .env and fill in:
3. Get OAuth tokens (for write operations)
Opens browser, authorizes your account, saves token.json. Tokens auto-refresh.
4. Add to Claude Code
Tools
X API — Timeline & Tweets
Tool | Description |
| Your home timeline |
| A user's recent tweets |
| Get a specific tweet |
| Post a tweet (OAuth) |
| Delete your tweet (OAuth) |
| Search recent tweets (7 days) |
X API — DMs
Tool | Description |
| Recent DM messages |
| Read a DM conversation |
| Send a DM (OAuth) |
X API — Social
Tool | Description |
| Your bookmarked tweets |
| Liked tweets (you or others) |
| Like a tweet (OAuth) |
| User profile details |
| List followers |
| List following |
Intelligence — Grok-powered
Tool | Description |
| Real-time analysis of any topic on X |
| AI-powered daily briefing |
| Summarize a tweet thread |
| Deep analysis of any X account |
Daily Digest (standalone)
Cron it for daily briefings:
Architecture
X client: async httpx, auto rate-limit retry, OAuth token refresh
Grok client: Chat Completions API for analysis, Responses API with x_search for real-time X data
Output: Plain text, never raw JSON. Tweets formatted as
[date time] @user: text (metrics)
License
MIT