mcp-twikit
A Model Context Protocol (MCP) server for interacting with Twitter.
claude mcp add --transport stdio adhikasp-mcp-twikit uvx --from git+https://github.com/adhikasp/mcp-twikit mcp-twikit \ --env TWITTER_EMAIL="me@example.com" \ --env TWITTER_PASSWORD="secret" \ --env TWITTER_USERNAME="@example"
How to use
The MCP-Twikit server provides an interface to interact with Twitter data via the Model Context Protocol (MCP). It exposes a Twikit-based workflow that can search Twitter, fetch timelines, and perform sentiment-conscious analyses by leveraging the client tooling available in the MCP ecosystem. Users can configure credentials for a Twitter account and then invoke the MCP tools to retrieve tweets, run sentiment or topic analyses, and compare signals across multiple accounts. This server is designed to be used with an MCP client (e.g., mcp-client-cli) to issue structured requests and receive contextual results. The included example demonstrates performing sentiment-oriented comparisons across several Indonesian providers by querying tweets and applying sentiment summaries per account.
To use it, start the MCP server with the configured environment variables, then connect via your MCP client. Typical operations include retrieving recent tweets for a given handle, analyzing sentiment distribution, and combining multiple sources into a single comparative report. The server relies on a connected Twitter account, so ensure the credentials are valid and that the account permissions allow programmatic access for the actions you intend to perform.
How to install
Prerequisites:
- Git installed on your system
- Python 3.8+ (or a Python environment that provides the uvx CLI, if you’re using uvx via packaging)
- Access to a Twitter account for API authentication (username, email, password)
- Network access to fetch packages from GitHub
Installation steps (manual):
-
Clone or reference the MCP TWIKIT repository via the provided command in the repository:
- You can install using the uvx approach shown in the README: npx -y @smithery/cli install mcp-twikit --client claude
- If installing manually, ensure you have uvx installed on your system. If not, install uvx using your preferred method (for example via pipx or your Python environment):
- pipx install uvx (or your environment’s equivalent)
- Install the MCP server from GitHub directly (per the README example): uvx --from git+https://github.com/adhikasp/mcp-twikit mcp-twikit
-
Configure environment variables (as shown in the README): TWITTER_USERNAME=@example TWITTER_EMAIL=me@example.com TWITTER_PASSWORD=secret
-
Run the server using the configuration provided in the README: uvx --from git+https://github.com/adhikasp/mcp-twikit mcp-twikit
-
Verify the server is listening and accessible via your MCP client (e.g., mcp-client-cli).
Notes:
- The exact commands may vary slightly depending on how your environment handles the uvx CLI installation. If a direct uvx command is not available, use the equivalent installation approach for your setup.
- Keep credentials secure and consider using environment secrets management in production deployments.
Additional notes
Tips and common issues:
- Make sure the Twitter account credentials provided in TWITTER_USERNAME, TWITTER_EMAIL, and TWITTER_PASSWORD are valid and have API access enabled for programmatic usage.
- If you encounter authentication errors, verify that the account is allowed to be accessed by third-party applications and that two-factor authentication settings do not block the automation.
- When deploying, keep the TWITTER_PASSWORD in a secure secret store or environment variable management solution rather than hard-coding it.
- The mcp-twikit server configuration uses the uvx command to pull the code from GitHub; ensure outbound network access is allowed to fetch the repository.
- If you plan to scale or run multiple MCP servers, consider isolating environment variables per server instance and using a containerized or VM-based deployment approach.
- The example usage demonstrates sentiment analysis across multiple Twitter handles; you can adapt tool calls and queries via your MCP client to fetch timelines, search tweets, or compare metrics across accounts.
Related MCP Servers
mcp-agent
Build effective agents using Model Context Protocol and simple workflow patterns
nerve
The Simple Agent Development Kit.
prometheus
A Model Context Protocol (MCP) server that enables AI agents and LLMs to query and analyze Prometheus metrics through standardized interfaces.
mcp-reddit
A Model Context Protocol (MCP) server that provides tools for fetching and analyzing Reddit content.
mcp-ical
A Model Context Protocol Server that allows you to interact with your MacOS Calendar through natural language.
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.