Twitter / X

The Twitter / X connector lets AI agents read tweets, search the platform, explore user timelines and follower graphs, post new tweets, and manage likes. Authentication uses OAuth 2.0 with PKCE and your credentials are stored encrypted in MCPGate's vault, never exposed to the AI client.

Posting tweets is public

twitter_post_tweetpublishes content immediately to your public Twitter/X timeline. There is no draft or approval step built into the API. Always deny this tool in apps that don't explicitly require posting capability.

Tool reference#

The Twitter / X connector exposes 10 tools: 6 read, 3 write, and 1 delete. Use the MCP Apps page to enable or disable individual tools per app.

ToolCategoryDescription
twitter_get_tweetreadGet a tweet by ID
twitter_search_tweetsreadSearch recent tweets by query string
twitter_get_userreadGet a Twitter/X user by username or ID
twitter_get_timelinereadGet the home timeline or user timeline tweets
twitter_list_followersreadList followers of a Twitter/X user
twitter_list_followingreadList accounts a Twitter/X user is following
twitter_post_tweetwritePost a new tweet
twitter_like_tweetwriteLike a tweet
twitter_unlike_tweetwriteUnlike a previously liked tweet
twitter_delete_tweetdeleteDelete a tweet by ID

Common guardrail recipes#

Read-only access#

Enable only the six read tools and deny twitter_post_tweet, twitter_like_tweet, twitter_unlike_tweet, and twitter_delete_tweet. Use this for social listening agents that monitor mentions, trends, or competitor activity without taking any action.

Engage preset#

Use the built-in engage preset to allow reads plus twitter_like_tweet and twitter_unlike_tweet, while keeping twitter_post_tweet and twitter_delete_tweet denied. Agents can interact with content passively without publishing anything or removing tweets.

Rate-limit tweet posting#

Twitter/X enforces strict write rate limits (300 tweets per 3-hour window on Basic tier). Apply the cooldown guardrail template to twitter_post_tweet with a minimum interval of 30 seconds between calls to prevent the AI from bulk-posting and triggering rate limit errors.

Troubleshooting#

  • 401 Unauthorized — The OAuth token has been revoked or the connected Twitter/X app has been suspended. Reconnect the connector in MCPGate to obtain a fresh token.
  • 403 on tweet posting — Your Twitter developer app may not have Read and Write permissions enabled. Update the app permissions in the Twitter Developer Portal and reconnect MCPGate to obtain a token with write access.
  • Search returns no recent tweets twitter_search_tweets searches only the past 7 days of tweets on the Basic access tier. For older tweets, a higher Twitter API access tier is required.