Sign inSign up

genaiwithms/twitter-mcp

By genaiwithms

โ€ขUpdated about 2 months ago

MCP server for X that lets AI assistants post, upload images, and search via API.

Image
Machine learning & AI
Developer tools
0

71

genaiwithms/twitter-mcp repository overview

โ Twitter MCP

genaiwithms/twitter-mcp | Full README on GitHubโ 

A Model Context Protocolโ  server that lets AI assistants (Claude, Cursor, OpenCode, and other MCP-compatible clients) read and write to X / Twitter using natural language โ€” post tweets, search, monitor mentions, and engage with content.

This image runs the MCP stdio server. Credentials are never baked in; you pass them as environment variables at run time.

โ What the image does

  • Runs the Twitter MCP server as a stdio process, ready to be wired into any MCP client via docker run -i.
  • Post text-only tweets and tweets with images (JPG, PNG, GIF, WEBP).
  • Search tweets (with optional Xquik / GetXAPI backends), fetch user profiles, thread history, recent mentions, and extract media URLs.
  • Publish smart threads (auto-split long content), quote tweets, and like / retweet / bookmark.
  • Runs as a non-root user (node) and needs no volume mounts โ€” the server only reads stdin/stdout.

โ Features

FeatureDescription
๐Ÿฆ Post tweetsPublish status updates, replies, and threaded replies
๐Ÿ–ผ๏ธ Image supportAttach JPG, PNG, GIF, WEBP images
๐Ÿ” Search tweetsQuery by keyword, hashtag, date, or advanced filters
๐Ÿ‘ค User profilesBio, metrics, pinned tweet, recent activity
๐Ÿ’ฌ Thread historyFull conversation context by tweet ID
๐Ÿ”” Mention monitoringRecent mentions of the authenticated user or keywords
๐Ÿงต Smart threadsAuto-split long content into a tweet chain
๐Ÿ’ฌ Quote tweetsQuote an existing tweet with AI commentary
๐ŸŽฌ Media extractionDirect media URLs (images, video, GIF)
โค๏ธ EngagementLike, retweet, or bookmark
๐Ÿ” OAuth 1.0aSecure Twitter authentication

โ Pull

# Docker
docker pull genaiwithms/twitter-mcp:latest

# Podman
podman pull docker.io/genaiwithms/twitter-mcp:latest

โ Usage

The server speaks MCP over stdio (stdin/stdout). Point your MCP client at the container, or smoke-test it directly:

printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\n' \
  | docker run -i --rm genaiwithms/twitter-mcp:latest

A successful handshake returns the server name and version (twitter-mcp).

โ Configuration

Provide your Twitter credentials at run time with -e. The image ships with no default credentials.

docker run -i --rm \
  -e API_KEY="your_consumer_api_key" \
  -e API_SECRET_KEY="your_consumer_api_secret" \
  -e ACCESS_TOKEN="your_access_token" \
  -e ACCESS_TOKEN_SECRET="your_access_token_secret" \
  genaiwithms/twitter-mcp:latest

post_tweet_with_image reads a local file path. If you use that tool from the container, mount the file with -v /abs/path/to/image.jpg:/abs/path/to/image.jpg and pass the same path to the tool.

โ Environment Variables

VariableDescriptionRequired
API_KEYTwitter consumer API keyYes (posting / Twitter search)
API_SECRET_KEYTwitter consumer API secretYes (posting / Twitter search)
ACCESS_TOKENTwitter access tokenYes (posting / Twitter search)
ACCESS_TOKEN_SECRETTwitter access token secretYes (posting / Twitter search)
XQUIK_API_KEYOptional Xquik key for search_tweetsNo
XQUIK_BASE_URLXquik base URL, defaults to https://xquik.comNo
GETXAPI_API_KEYOptional GetXAPI key for search_tweetsNo
GETXAPI_BASE_URLGetXAPI base URL, defaults to https://api.getxapi.comNo

โ MCP Setup

Register the container as a stdio MCP server in your client. Example for Claude Desktop App (claude_desktop_config.json):

{
  "mcpServers": {
    "twitter-mcp": {
      "command": "docker",
      "args": ["run", "-i", "--rm",
        "-e", "API_KEY=your_consumer_api_key",
        "-e", "API_SECRET_KEY=your_consumer_api_secret",
        "-e", "ACCESS_TOKEN=your_access_token",
        "-e", "ACCESS_TOKEN_SECRET=your_access_token_secret",
        "genaiwithms/twitter-mcp:latest"
      ]
    }
  }
}

For Podman, replace "docker" with "podman". Restart your client after saving.

Tag summary

Content type

Image

Digest

sha256:09cdd9687โ€ฆ

Size

100.8 MB

Last updated

about 2 months ago

docker pull genaiwithms/twitter-mcp