๐ What is MCP?
Model Context Protocol (MCP) is a standard that allows AI assistants to use external tools. XActions provides an MCP server that lets Claude, GPT, and other AI agents automate X/Twitter tasks.
๐ก Why Use MCP?
Instead of manually running scripts, you can ask Claude to "scrape followers from @elonmusk" or "unfollow everyone who doesn't follow me back" - and it just works.
๐ฅ๏ธ Setup with Claude Desktop
Step 1: Install XActions globally
npm install -g xactions
Step 2: Find your Claude Desktop config
The config file location depends on your OS:
# macOS
~/Library/Application Support/Claude/claude_desktop_config.json
# Windows
%APPDATA%\Claude\claude_desktop_config.json
# Linux
~/.config/Claude/claude_desktop_config.json
Step 3: Add XActions MCP server to config
Edit the config file and add the XActions server:
{
"mcpServers": {
"xactions": {
"command": "npx",
"args": ["xactions-mcp"],
"env": {
"X_AUTH_TOKEN": "your_auth_token_here"
}
}
}
}
Step 4: Get your X auth token
To get your auth token from X:
- Go to x.com and log in
- Open Developer Tools (F12)
- Go to Application โ Cookies โ x.com
- Find the
auth_tokencookie and copy its value
Step 5: Restart Claude Desktop
Quit and reopen Claude Desktop. You should now see XActions tools available!
๐ ๏ธ Available MCP Tools
The XActions MCP server provides these tools to AI agents:
scrape_followers
Get a list of followers for any public account
username, limit
scrape_following
Get who an account follows (includes followsBack status)
username, limit
scrape_tweets
Get tweets from a profile with engagement stats
username, limit
search_tweets
Search X for tweets matching a query
query, limit
scrape_profile
Get full profile info (bio, followers count, etc.)
username
get_non_followers
Find who you follow that doesn't follow back
username
unfollow_users
Unfollow a list of usernames
usernames[]
follow_users
Follow a list of usernames
usernames[]
๐ฌ Example Prompts
Once connected, try these prompts with Claude:
# Scraping
"Get me a list of @elonmusk's last 50 followers"
"Who does @naval follow? Show me the first 100"
"Search for tweets about 'AI agents' from the last week"
# Analysis
"Find all the people I follow who don't follow me back"
"Get @pmarca's most liked tweets from his profile"
"Compare the followers of @a16z and @sequoia"
# Actions
"Unfollow everyone who doesn't follow me back"
"Follow the top 20 people who liked @balajis's last post"
# Combined
"Find tech founders who follow both @paulg and @naval,
then follow them if they have over 1000 followers"
๐ Safety Notes
The MCP server respects rate limits and adds human-like delays. Actions like unfollowing require explicit confirmation. Your auth token is stored locally and never sent to external servers.
โจ๏ธ Alternative: Direct CLI
If you prefer using the CLI directly instead of through AI:
# Install globally
npm install -g xactions
# Login (saves session)
xactions login
# Scrape followers
xactions followers elonmusk --limit 100 --output followers.json
# Get non-followers
xactions non-followers YOUR_USERNAME --output non-followers.json
# Unfollow non-followers
xactions unfollow non-followers.json
# Search tweets
xactions search "AI agents" --limit 50