← Back to Articles
mcpxtwittercursoridesetup2026social media

X (Twitter) MCP Server for Cursor IDE Setup Guide (2026)

Connect X (Twitter) to Cursor IDE via MCP. Post tweets, search X, read timelines — all from AI chat. Step-by-step setup with copy-paste config for Mac, Windows & Linux.

By Web MCP GuideApril 5, 20266 min read


X (Twitter) MCP Server: Cursor IDE Setup Guide (2026)

The X (Twitter) MCP server connects your AI assistant directly to X's API — so you can search posts, publish tweets, read your timeline, and manage engagement without leaving Cursor IDE or Claude Desktop.

X overhauled their API in early 2026 with pay-per-use pricing and shut down the v1.1 media upload endpoint in June 2025. This guide covers the current setup using the community-maintained x-mcp-server with the updated v2 API.

What You Can Do


  • "Search X for what people are saying about [topic] right now"

  • "Post a tweet announcing my new product launch"

  • "Show me my home timeline"

  • "Reply to tweet ID 123456789 with..."

  • "Quote tweet this post with my take on it"

  • "Bookmark this tweet for later"
  • X API Pricing (2026)

    X moved to credit-based pay-per-use pricing in February 2026. Here's what matters for MCP use:

    | Tier | Cost | Post Reads | Post Writes |
    |------|------|-----------|------------|
    | Free | $0 | ~100/month | ~500/month |
    | Basic | $200/month | 10,000/month | 3,000/month |
    | Pro | $5,000/month | 1,000,000/month | 300,000/month |
    | Pay-per-use | Credit-based | ~$0.005/read | Varies |

    For personal use and testing, the Free tier is enough to get started. Note: Like/Follow endpoints were removed from the Free tier in August 2025 — you need Basic or higher for those.

    Prerequisites


  • Cursor IDE v0.40+ (or Claude Desktop)

  • X (Twitter) account

  • Node.js 18+

  • X Developer account (free to create)
  • Step 1: Create an X Developer App

    1. Go to developer.x.com and sign in with your X account
    2. Click Create Project → name it (e.g. "Cursor MCP")
    3. Select a use case → click Create App
    4. In your app settings, click User authentication settings
    5. Set App permissions to Read and Write
    6. Enable OAuth 1.0a
    7. Save settings

    Now grab your credentials:

    1. Go to Keys and tokens in your app dashboard
    2. Copy your API Key and API Key Secret
    3. Click Generate under Access Token and Secret
    4. Copy your Access Token and Access Token Secret

    > Important: Store these immediately — X only shows Access Tokens once.

    Step 2: Install the MCP Server

    git clone https://github.com/DataWhisker/x-mcp-server.git
    cd x-mcp-server
    npm install
    npm run build

    Note the full path to your x-mcp-server folder — you'll need it in the next step.

    Step 3: Configure Cursor IDE

    Open Cursor → Settings (Cmd/Ctrl + ,) → Search "MCP" → Edit MCP Settings

    Mac/Linux:

    {
    "mcpServers": {
    "x-twitter": {
    "command": "node",
    "args": ["/Users/yourname/x-mcp-server/build/index.js"],
    "env": {
    "TWITTER_API_KEY": "your_api_key",
    "TWITTER_API_SECRET": "your_api_key_secret",
    "TWITTER_ACCESS_TOKEN": "your_access_token",
    "TWITTER_ACCESS_SECRET": "your_access_token_secret"
    }
    }
    }
    }

    Windows:

    {
    "mcpServers": {
    "x-twitter": {
    "command": "node",
    "args": ["C:\\Users\\yourname\\x-mcp-server\\build\\index.js"],
    "env": {
    "TWITTER_API_KEY": "your_api_key",
    "TWITTER_API_SECRET": "your_api_key_secret",
    "TWITTER_ACCESS_TOKEN": "your_access_token",
    "TWITTER_ACCESS_SECRET": "your_access_token_secret"
    }
    }
    }
    }

    Replace the path with your actual x-mcp-server install location.

    Step 4: Claude Desktop (Alternative)

    If you prefer Claude Desktop, add this to %APPDATA%/Claude/claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (Mac):

    {
    "mcpServers": {
    "x-twitter": {
    "command": "node",
    "args": ["/path/to/x-mcp-server/build/index.js"],
    "env": {
    "TWITTER_API_KEY": "your_api_key",
    "TWITTER_API_SECRET": "your_api_key_secret",
    "TWITTER_ACCESS_TOKEN": "your_access_token",
    "TWITTER_ACCESS_SECRET": "your_access_token_secret"
    }
    }
    }
    }

    Restart Claude Desktop after saving.

    Step 5: Restart and Test

    Restart Cursor, open the AI chat (Cmd/Ctrl + L), and try:

    > "Search X for the latest posts about Model Context Protocol"

    You should see real, recent tweets returned within seconds.

    Available Tools (16 total)

    The x-mcp-server exposes 16 tools across four categories:

    Timeline & Search

  • get_home_timeline — your feed, up to 100 posts

  • search_tweets — search the last 7 days of public posts
  • Post Management

  • create_tweet — post text or attach images/videos

  • reply_to_tweet — reply to any post by ID

  • quote_tweet — quote with your commentary

  • delete_tweet — remove your own post

  • get_tweet — fetch a specific post by ID
  • Engagement (Basic tier and above)

  • like_tweet / unlike_tweet

  • retweet / undo_retweet

  • bookmark_tweet / unbookmark_tweet / get_bookmarks
  • Users

  • get_user — look up any public profile

  • get_user_tweets — fetch a user's recent posts
  • Media Uploads (2026 Update)

    X sunset the v1.1 media upload endpoint in June 2025. If you want to post images or videos, you now need OAuth 2.0 credentials in addition to OAuth 1.0a.

    Add these to your config:

    "env": {
    "TWITTER_API_KEY": "...",
    "TWITTER_API_SECRET": "...",
    "TWITTER_ACCESS_TOKEN": "...",
    "TWITTER_ACCESS_SECRET": "...",
    "TWITTER_CLIENT_ID": "your_oauth2_client_id",
    "TWITTER_CLIENT_SECRET": "your_oauth2_client_secret",
    "TWITTER_OAUTH2_REFRESH_TOKEN": "your_refresh_token"
    }

    To get OAuth 2.0 credentials: In your X Developer app, enable OAuth 2.0, set the client type to Confidential, add a callback URL, and request scopes tweet.read tweet.write media.write offline.access users.read.

    Tokens auto-refresh and persist to ~/.x-mcp-tokens.json.

    Power User Prompts

    "What are people saying about OpenAI on X right now?"
    "Post: Just shipped a new feature! Check it out at [url] #buildinpublic"
    "Get the last 20 tweets from @lexfridman"
    "Reply to tweet 1234567890 with 'Great point, I agree because...'"
    "Search for tweets about cursor IDE from the last week"
    "Show me my bookmarks"
    "Quote tweet 1234567890 with my thoughts on their approach"

    Troubleshooting

    401 Unauthorized — Your credentials are wrong or the app doesn't have Read+Write permissions. Re-check your User authentication settings in the developer portal.

    403 Forbidden on likes/follows — These endpoints require the Basic tier ($200/month). Free tier is read + write posts only.

    Media upload fails — You need OAuth 2.0 credentials configured. The v1.1 endpoint was sunset June 2025.

    Rate limit errors — Free tier is capped at ~100 reads/month and ~500 writes/month. Upgrade to Basic or switch to pay-per-use credits for heavier usage.

    "Cannot find module" — Make sure you ran npm run build and that the path in your config points to build/index.js, not src/index.ts.

    Using the Official X API Directly

    If you want to call the X API without an MCP wrapper — for example in a backend function or script — the base URL is:

    https://api.x.com/2/

    Reference: docs.x.com

    Quick example — fetch a user by username:

    curl "https://api.x.com/2/users/by/username/xdevelopers" \
    -H "Authorization: Bearer $BEARER_TOKEN"

    The official Python and TypeScript SDKs are available via the @xdevplatform npm org and the twitter-api-v2 PyPI package.

    Related Guides


  • How to Set Up MCP Servers in Cursor IDE (2026)

  • GitHub MCP Server Cursor IDE Setup

  • Slack MCP Server Setup Guide (2026)

  • Top 10 MCP Servers You Should Know

  • How to Authenticate MCP Servers (OAuth & API Keys)