🎉 XActions is 100% Free & Open Source No accounts, no payments, no limits Star on GitHub ⭐

🤖 AI-Powered X/Twitter Automation

Connect GPT, Claude, and any LLM to automate Twitter with the XActions MCP Server. Build intelligent AI agents for social media automation.

MCP Server GPT-4 Compatible Claude Ready Open Source 20+ Tools

🚀 XActions is the first open-source MCP server for X/Twitter automation — let your AI handle your social media!

🔌 MCP Server Integration

The Model Context Protocol (MCP) is the standard for connecting AI assistants to external tools. XActions implements a full MCP server that exposes Twitter automation capabilities to any compatible AI agent.

What is MCP?

MCP (Model Context Protocol) is an open protocol developed by Anthropic that enables AI assistants to securely interact with external data sources and tools. It's the bridge between language models and real-world actions.

  • Standardized: Works with any MCP-compatible client
  • Secure: Controlled access to automation tools
  • Powerful: Full Twitter automation capabilities
  • Open Source: Inspect and customize the code

XActions MCP Capabilities

The XActions MCP server exposes 20+ tools for comprehensive Twitter automation:

  • Scraping: Followers, following, tweets, likes, profiles
  • Actions: Follow, unfollow, like, unlike, retweet
  • Monitoring: Track accounts, detect unfollowers
  • Search: Find users by keywords, hashtags
  • Analytics: Growth metrics, engagement data

💡 With MCP, your AI assistant can research, analyze, and act on Twitter — all autonomously!

đŸ› ī¸ Compatible AI Tools

XActions works with all major AI platforms and tools. Whether you're using a commercial AI assistant or building custom agents, we've got you covered.

đŸ’Ŧ

ChatGPT / GPT-4

OpenAI's flagship model via API integration

đŸŸŖ

Claude Desktop

Native MCP support for seamless integration

📝

Cursor AI

AI-powered code editor with MCP tools

🚀

VS Code Copilot

GitHub Copilot in VS Code

🤖

Custom Agents

Build your own with any LLM

⚡

LangChain

Popular LLM framework support

Integration Options

  • MCP Protocol: Direct integration via Model Context Protocol
  • REST API: HTTP endpoints for any programming language
  • Node.js SDK: Native JavaScript/TypeScript library
  • CLI: Command-line interface for scripting
  • Webhooks: Event-driven automation triggers

đŸŽ¯ Use Cases for AI Agents

Discover how AI agents can transform your X/Twitter presence with intelligent automation powered by machine learning and natural language processing.

đŸ›Ąī¸ Automated Content Moderation

Let AI analyze your followers and engagement for spam, bots, and low-quality accounts. Automatically clean your following list based on intelligent criteria.

  • Detect bot accounts using ML pattern recognition
  • Identify spam followers and fake engagement
  • Auto-unfollow inactive accounts (no posts in 6+ months)
  • Filter followers by engagement quality
  • Flag suspicious accounts for review

đŸ‘Ĩ Smart Follower Management

AI-driven strategies for growing and maintaining a high-quality follower base. Let machine learning optimize your following decisions.

  • Intelligently follow users who engage with similar content
  • Prioritize high-value accounts in your niche
  • Auto-unfollow non-followers with smart delays
  • Track follower/following ratio optimization
  • Segment followers by engagement level

đŸ’Ŧ AI-Driven Engagement

Let your AI agent handle engagement tasks intelligently. From liking relevant content to finding conversation opportunities.

  • Auto-like tweets based on content relevance
  • Find and engage with trending topics in your niche
  • Monitor mentions and keywords for engagement opportunities
  • Smart reply suggestions powered by LLMs
  • Engagement timing optimization

⏰ Scheduled Automation via AI

Create intelligent automation workflows that adapt to your account's needs. Let AI decide when and what actions to take.

  • Adaptive scheduling based on audience activity
  • Automated cleanup routines (weekly unfollows)
  • Growth campaigns with AI optimization
  • Event-triggered actions (new follower → analyze)
  • Rate-limit aware execution

📊 AI Analytics & Insights

Let AI analyze your Twitter data and provide actionable insights. Natural language reports on your account health and growth.

  • Natural language growth reports
  • Follower quality scoring
  • Engagement pattern analysis
  • Competitor tracking and insights
  • Anomaly detection (sudden unfollows)

đŸ’ģ Code Examples

Get started quickly with these integration examples. XActions makes it easy to connect AI agents to Twitter automation.

Claude Desktop MCP Configuration

JSON claude_desktop_config.json
// Add to your Claude Desktop config
{
  "mcpServers": {
    "xactions": {
      "command": "npx",
      "args": ["xactions", "mcp"],
      "env": {
        "TWITTER_AUTH_TOKEN": "your_token"
      }
    }
  }
}

Node.js Integration

JavaScript ai-agent.js
import { XActions } from 'xactions';
import OpenAI from 'openai';

// Initialize XActions
const xactions = new XActions({
  authToken: process.env.TWITTER_AUTH_TOKEN
});

// Initialize OpenAI
const openai = new OpenAI();

// AI-powered follower analysis
async function analyzeFollowers() {
  // Get followers data
  const followers = await xactions.scrapeFollowers({
    username: 'your_handle',
    limit: 100
  });
  
  // Let GPT analyze the data
  const analysis = await openai.chat.completions.create({
    model: 'gpt-4',
    messages: [{
      role: 'user',
      content: `Analyze these followers and identify 
        potential bots or low-quality accounts: 
        ${JSON.stringify(followers)}`
    }]
  });
  
  return analysis.choices[0].message.content;
}

Python with LangChain

Python twitter_agent.py
from langchain.agents import Tool, AgentExecutor
from langchain_openai import ChatOpenAI
import subprocess
import json

# Define XActions tools for LangChain
def scrape_followers(username: str) -> str:
    result = subprocess.run(
        ["npx", "xactions", "scrape-followers", 
         "--username", username, "--json"],
        capture_output=True, text=True
    )
    return result.stdout

# Create LangChain tool
tools = [
    Tool(
        name="ScrapeFollowers",
        func=scrape_followers,
        description="Get followers for a Twitter user"
    )
]

# Build AI agent
llm = ChatOpenAI(model="gpt-4")
agent = AgentExecutor(tools=tools, llm=llm)

CLI Automation Script

Bash daily-cleanup.sh
#!/bin/bash
# Daily AI-powered Twitter cleanup

# Scrape non-followers
npx xactions unfollow-non-followers \
  --limit 50 \
  --delay 30 \
  --dry-run false

# Detect new unfollowers
npx xactions detect-unfollowers \
  --notify email

# Log results
echo "Cleanup completed at $(date)" >> cleanup.log

🔗 API for AI

XActions provides a comprehensive programmatic API designed for AI agent integration. Build autonomous Twitter bots, integrate with your existing workflows, or create custom automation pipelines.

Available API Endpoints

RESTful API endpoints for all automation features:

GET /api/scrape/followers/:username
GET /api/scrape/following/:username
GET /api/scrape/tweets/:username
POST /api/actions/follow
POST /api/actions/unfollow
POST /api/actions/like
GET /api/monitor/unfollowers
GET /api/search/users?q=keyword

API Features

  • JSON Response: All endpoints return structured JSON
  • Rate Limiting: Built-in rate limiting to avoid bans
  • Webhooks: Subscribe to events (new follower, unfollower)
  • Pagination: Handle large datasets efficiently
  • Error Handling: Detailed error messages for debugging

🚀 Getting Started with AI

Step 1: Install XActions

Install XActions globally using npm:

npm install -g xactions

Step 2: Authenticate

Connect your Twitter account:

xactions auth

Step 3: Configure MCP

Add XActions to your AI tool's MCP configuration (see examples above).

Step 4: Start Automating

Your AI agent now has access to all XActions tools. Ask it to scrape followers, unfollow non-followers, or analyze your Twitter data!

📖 Need more help? Check out our complete MCP Server documentation

❓ AI Integration FAQ

Is XActions free for AI integration?

Yes! XActions is 100% open source and free to use. The MCP server, API, and all automation tools are available at no cost. Premium SaaS features are optional.

Do I need the Twitter API?

No! XActions uses browser automation, completely bypassing the expensive Twitter API. This means no API fees, no rate limit hassles, and full feature access.

Is this safe for my Twitter account?

XActions includes built-in rate limiting and delay mechanisms to mimic human behavior. However, aggressive automation can trigger Twitter's spam detection. Use responsibly and follow our recommended settings.

Can I build a commercial product with XActions?

Yes! XActions is MIT licensed, so you can use it for commercial purposes. Attribution is appreciated but not required.

Which LLM works best with XActions?

Any modern LLM works great! GPT-4, Claude 3, and similar models can understand and use the XActions tools effectively. For MCP support, Claude Desktop is recommended.

Can I contribute to XActions?

Absolutely! We welcome contributions. Check out our GitHub repository to get started. Bug fixes, new features, and documentation improvements are all appreciated.