X

X (Twitter)

Integrates with Twitter/X API using dual OAuth authentication (1.0a and 2.0) to enable tweet posting...

119 views
0 installs
Updated Sep 22, 2025
Not audited
Integrates with Twitter/X API using dual OAuth authentication (1.0a and 2.0) to enable tweet posting with media attachments, tweet searching, and tweet deletion with intelligent rate limiting designed for free-tier API usage.

Step-by-Step Instructions to Obtain X (Twitter) API Credentials

The X MCP Server requires API keys and tokens for either OAuth 1.0a or OAuth 2.0 authentication. Follow the relevant steps below to obtain the necessary environment variable (ENV) values. After acquiring the values, fill them in through the FastMCP connection interface using your "Install Now" button.


For OAuth 1.0a

  1. Log in to the X Developer Portal

  2. Create a New App

    • Navigate to the Developer Portal Dashboard.
    • Click "Projects & Apps" → "New Project".
    • Name your project and select your use case.
    • Within the project, create a new App.
  3. Configure App Permissions

    • In your new App, find "User authentication settings".
    • Click "Set up".
    • Enable OAuth 1.0a.
    • Set permissions to "Read and Write".
    • Add a Callback URL: http://localhost:3000/callback.
    • Set any website URL (e.g., a GitHub repo).
  4. Generate API Keys and Tokens

    • In the "Keys and tokens" tab, copy your:
      • API Key
      • API Key Secret
    • Scroll down to "Access Token and Secret", and click "Generate".
    • Copy your:
      • Access Token
      • Access Token Secret
  5. Fill in the FastMCP Connection Interface

    • After clicking "Install Now", fill in the required values:
      • API_KEY: [your API Key]
      • API_SECRET_KEY: [your API Secret Key]
      • ACCESS_TOKEN: [your Access Token]
      • ACCESS_TOKEN_SECRET: [your Access Token Secret]

For OAuth 2.0

  1. Log in to the X Developer Portal

  2. Create a New App

    • Follow steps as above to set up a new app in the Developer Portal.
  3. Configure App Permissions for OAuth 2.0

    • In "User authentication settings", enable OAuth 2.0.
    • Set permissions to at least:
      • tweet.read, tweet.write, users.read, media.write, offline.access (required scopes).
    • Add a Callback URL: http://localhost:3000/callback.
  4. Obtain OAuth 2.0 Credentials

    • In the "Keys and tokens" tab, copy your:
      • OAuth 2.0 Client ID
      • OAuth 2.0 Client Secret
  5. Generate User Tokens

    • Clone the MCP server repository:

      git clone https://github.com/mbelinky/x-mcp-server.git
      cd x-mcp-server/twitter-mcp
      npm install
      # Run the OAuth2 setup script
      node scripts/oauth2-setup.js
      
    • Follow the instructions from the script to authenticate and retrieve:

      • Access Token
      • Refresh Token

      Alternative: Manually complete the OAuth 2.0 PKCE authentication flow using the credentials and required scopes, then exchange the authorization code for your tokens.

  6. Fill in the FastMCP Connection Interface

    • After clicking "Install Now", fill in the required values:
      • AUTH_TYPE: oauth2
      • OAUTH2_CLIENT_ID: [your client ID]
      • OAUTH2_CLIENT_SECRET: [your client secret]
      • OAUTH2_ACCESS_TOKEN: [your OAuth2 access token]
      • OAUTH2_REFRESH_TOKEN: [your OAuth2 refresh token]

Note: All credentials should be entered through the FastMCP connection interface after clicking your "Install Now" button. Do not share these credentials publicly.

Quick Start

View on GitHub

More for Communication

View All →

Similar MCP Servers

Report Issue

Thank you! Your issue report has been submitted successfully.