Sponsored by Deepsite.site

X(Twitter) V2 MCP Server

Created By
clean998 months ago
An MCP server implementation that provides tools for interacting with the Twitter/X API v2 interface.
Content

X(Twitter) V2 MCP Server

smithery badge

An MCP server implementation that provides tools for interacting with the Twitter/X API v2. This service allows AI assistants to retrieve tweets, post new content, reply to tweets, and quote tweets and more programmatically.

Tools

The X MCP Service provides the following tools for interacting with the Twitter/X API:

get_tweets_by_userid

Retrieves tweets from a specific user's timeline.

  • userId: The Twitter user ID to search for tweets
  • paginationToken (optional): Token for fetching the next page of results
  • exclude (optional): Types of tweets to exclude (retweets, replies)
  • maxResults (optional): Maximum number of tweets to return (default: 10)

get_tweet_by_id

Retrieves a single tweet by its ID.

  • tweetId: The ID of the tweet to retrieve

get_user_mentions

Retrieves tweets that mention a specific user.

  • userId: The Twitter user ID to get mentions for
  • paginationToken (optional): Token for fetching the next page of results
  • maxResults (optional): Maximum number of mentions to return (default: 10)

quote_tweet

Creates a quote tweet with custom text.

  • tweetId: The ID of the tweet to quote
  • replyText: The text to include with the quote

reply_to_tweet

Replies to an existing tweet.

  • tweetId: The ID of the tweet to reply to
  • replyText: The text content of the reply

post_tweet

Post a new tweet.

  • text: The content that you want to post.

like_tweet

Like a specific tweet.

  • tweetId: The ID of the tweet to like

follow_user

Follow a Twitter user.

  • targetUserId: The ID of the user to follow

unfollow_user

Unfollow a Twitter user.

  • targetUserId: The ID of the user to unfollow

get_user_by_username

Get information about a Twitter user by their username.

  • username: The Twitter username (without @ symbol)

search_tweets

Search for tweets using a query string.

  • query: The search query
  • maxResults (optional): Maximum number of results to return (default: 10)

Get trending topics for a specific location.

  • woeid (optional): The 'Where On Earth ID' (WOEID) for the location (1 for worldwide, default: 1)

create_list

Create a new Twitter list.

  • name: The name of the list
  • description (optional): Optional description for the list
  • isPrivate (optional): Whether the list should be private (default: false)

add_list_member

Add a user to a Twitter list.

  • listId: The ID of the list
  • userId: The ID of the user to add

remove_list_member

Remove a user from a Twitter list.

  • listId: The ID of the list
  • userId: The ID of the user to remove

get_owned_lists

Get all lists owned by the authenticated user.

  • No parameters required

Configuration

Env Configuration

X API Authentication

You can get all of the token below via X Developer Dashboard

X_API_KEY=your_api_key
X_API_SECRET=your_api_secret
X_ACCESS_TOKEN=your_access_token
X_ACCESS_SECRET=your_access_token_secret

Development


npm i

npm run build

npx @modelcontextprotocol/inspector node dist/index.js

Open http://127.0.0.1:6274 set up env, and interact with the tools.

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Amap Maps高德地图官方 MCP Server
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
Serper MCP ServerA Serper MCP Server
Tavily Mcp