Labsco
baryhuang logo

Twitter NoAuth

โ˜… 1

from baryhuang

Provides Twitter API access without requiring local credential setup. Credentials must be provided at runtime.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

MCP Server - Twitter NoAuth

A MCP (Model Context Protocol) server that provides Twitter API access without local credential or token setup. Provides core Twitter operations like searching tweets, getting user tweets, posting tweets, and replying to tweets.

Demo Video

https://www.youtube.com/watch?v=LOxFqCTPedc

Why MCP Twitter NoAuth Server?

Critical Advantages

  • Headless & Remote Operation: This server can run completely headless in remote environments with no browser and no local file access.
  • Decoupled Architecture: Any client can complete the OAuth flow independently, then pass credentials as context to this MCP server, creating a complete separation between credential storage and server implementation.

Nice but not critical

  • Focused Functionality: Provides core Twitter operations like searching tweets, getting user tweets, posting tweets, and replying to tweets.
  • Docker-Ready: Designed with containerization in mind for a well-isolated, environment-independent, one-click setup.
  • Reliable Dependencies: Built on standard Python requests library for Twitter API integration.

Features

  • Search tweets using Twitter API
  • Get recent tweets by a specific user
  • Get recent replies by a specific user
  • Post new tweets
  • Reply to existing tweets
  • Refresh access tokens separately
  • Automatic refresh token handling

Docker

Building the Docker Image

# Build the Docker image
docker build -t mcp-twitter-noauth .

Cross-Platform Publishing

To publish the Docker image for multiple platforms, you can use the docker buildx command. Follow these steps:

  1. Create a new builder instance (if you haven't already):

    docker buildx create --use
  2. Build and push the image for multiple platforms:

    docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t buryhuang/mcp-twitter-noauth:latest --push .
  3. Verify the image is available for the specified platforms:

    docker buildx imagetools inspect buryhuang/mcp-twitter-noauth:latest

Obtaining Twitter API Credentials

To obtain the required Twitter API credentials, follow these steps:

  1. Go to the Twitter Developer Portal
  2. Create a new project and app
  3. Set up OAuth 2.0 authentication
  4. Configure the OAuth settings for your app
  5. Generate client ID and client secret
  6. Complete the OAuth flow to obtain access and refresh tokens

Token Refreshing

This server implements automatic token refreshing. When your access token expires, the server will use the refresh token, client ID, and client secret to obtain a new access token without requiring user intervention.

Security Note

This server requires direct access to your Twitter API credentials. Always keep your tokens and credentials secure and never share them with untrusted parties.