home / mcp / twitter noauth mcp server
Provides Twitter API access with core actions like searching, posting, and replying, using token refresh.
Configuration
View docs{
"mcpServers": {
"baryhuang-mcp-twitter-noauth": {
"command": "mcp-server-twitter-noauth",
"args": []
}
}
}You can run the MCP Twitter NoAuth server to access Twitter API operations without storing credentials locally. It enables searching tweets, fetching user timelines and replies, posting tweets, and replying to tweets, while handling token refreshes automatically. This setup is ideal for headless, remote deployments where credential storage is separated from the server logic.
Use an MCP client to interact with the Twitter MCP server by invoking its tools for search, fetch, post, and reply actions. You will provision tokens per call or via a token refresh workflow, then pass the tokens as part of your tool calls. The server focuses on Twitter operations and manages token refreshing when needed.
Prerequisites: Python 3.10 or higher. You may also use Docker if you prefer containerized deployment.
# Clone the repository
git clone https://github.com/baryhuang/mcp-twitter-noauth.git
cd mcp-twitter-noauth
# Install dependencies
pip install -e .Server execution uses a dedicated MCP entry point. The server can run locally as a stdio process, allowing your MCP client to start it and communicate through standard input/output. The following runtime command starts the server as a standalone process.
mcp-server-twitter-noauthToken management is handled through a dedicated token refresh workflow. You can provide an initial access token and refresh token, or refresh tokens alone if the access token has expired. The server returns a new access token and its expiration time to use for subsequent calls.
Security note: Keep all Twitter API credentials secure and pass them only through trusted MCP client calls. This server is designed to minimize credential exposure by decoupling credential storage from the server logic.
If you encounter token expiration, trigger the token refresh workflow again to obtain a new access token before continuing with API calls.
For Docker-based deployment, you can run the same server image in a container and connect your MCP client to the container’s IO streams.
- Search tweets using Twitter API and return matching tweets with metadata like creation time and author.
- Get recent tweets from a specific user.
- Post a new tweet and optionally reply to existing tweets.
- Retrieve recent replies by a user and refresh tokens as needed.
Search tweets using the Twitter API and return matching tweet data including text, time, and author.
Fetch recent tweets from a specified user by user_id, returning a list of tweets.
Fetch recent replies made by a specific user, returning corresponding tweets and metadata.
Post a new tweet with the provided text content.
Post a reply to an existing tweet identified by tweet_id with the given text.
Refresh the access token using the refresh token, client_id, and client_secret to obtain a new access token.
Automatically refresh access tokens when they expire and provide the new token to subsequent requests.