Provides a TypeScript-based server for interacting with Twitter, enabling tweet operations, user profile management, and Grok AI integration through multiple authentication methods.
Choose Authentication Method
Decide which authentication method to use for connecting to Twitter. The recommended method is cookie-based authentication. You may also use username/password or Twitter API credentials if preferred.
For Cookie-Based Authentication (Recommended)
Log in to Twitter in your browser.
Open Developer Tools:
- Press
F12
or right-click anywhere on the page and select “Inspect.”
Go to the Application Tab:
- In Developer Tools, go to the “Application” tab.
- On the left, expand the “Cookies” section and select
https://twitter.com
.
Copy Required Cookies:
- Find and copy the values of these cookies:
auth_token
, ct0
, and twid
.
Format Cookies:
Paste Cookies in the FastMCP Connection Interface:
- In the Install Now (FastMCP) connection interface, set the following ENV values:
AUTH_METHOD
: cookies
TWITTER_COOKIES
: Use your prepared formatted cookie JSON as above
For Username/Password Authentication
Gather Your Twitter Account Information:
- Username, password, and if applicable, your email and 2FA secret.
Enter in FastMCP Connection Interface:
- Set:
AUTH_METHOD
: credentials
TWITTER_USERNAME
: Your Twitter username
TWITTER_PASSWORD
: Your Twitter password
TWITTER_EMAIL
: (Optional) Your associated email
TWITTER_2FA_SECRET
: (Optional) Your Two-Factor secret, if 2FA is enabled
For Twitter API Authentication
Obtain API credentials from Twitter Developer Portal:
- Go to Twitter Developer Portal
- Create a new Project & App if you don’t have one yet
- In your App settings, generate the following keys/tokens:
API Key
API Secret Key
Access Token
Access Token Secret
Enter in FastMCP Connection Interface:
- Set:
AUTH_METHOD
: api
TWITTER_API_KEY
: Your API key
TWITTER_API_SECRET_KEY
: Your API secret key
TWITTER_ACCESS_TOKEN
: Your access token
TWITTER_ACCESS_TOKEN_SECRET
: Your access token secret
Finalize and Install
- Click “Install Now” in the FastMCP connection interface.
- The MCP server will run with your provided credentials and enable Twitter interaction.
Note: If using cookies, ensure to refresh your cookies periodically as they can expire. If using API keys or password authentication, follow best practices for credential security.