Home / Open Source / mcp-twikit

mcp-twikit

Model Context Protocol (MCP) server for interacting with Twitter

PythonMITMCP
⭐ GitHubhttps://github.com/adhikasp/mcp-twikit
234
Stars
+-1
Star growth
Mar 14, 2025
Last updated
1,196
Clicks

MCP-Twikit Project Detailed Introduction

Project Overview

MCP-Twikit is a Model Context Protocol (MCP) server for interacting with Twitter. This project provides AI assistants (such as Claude Desktop) with powerful Twitter data access and analysis capabilities through the MCP protocol.

Core Features

1. Twitter Search Functionality

  • Supports searching for tweets by keyword
  • Allows specifying the number of search results
  • Supports sorting by time (newest first)
  • Can search for tweets from specific users (using the to:username syntax)

2. Timeline Retrieval

  • Retrieves a user's personal Twitter timeline
  • Provides real-time access to the latest tweet content
  • Supports parsing of various tweet types

3. Social Media Sentiment Analysis

  • Analyzes the sentiment of tweets in batches
  • Compares public sentiment across multiple accounts
  • Generates detailed sentiment analysis reports

Installation and Configuration

Automatic Installation (Recommended)

Automatically install to Claude Desktop via Smithery:

npx -y @smithery/cli install mcp-twikit --client claude

Manual Configuration

Add the following to the Claude Desktop configuration file:

{
  "mcpServer": {
    "command": "uvx",
    "args": ["--from", "git+https://github.com/adhikasp/mcp-twikit", "mcp-twikit"],
    "env": {
      "TWITTER_USERNAME": "@example",
      "TWITTER_EMAIL": "[email protected]",
      "TWITTER_PASSWORD": "secret"
    }
  }
}

Using the MCP Client CLI

Supports interactive use via the mcp-client-cli tool.

Real-World Application Scenarios

1. Brand Sentiment Monitoring

The project documentation showcases a real-world case: analyzing customer sentiment towards the four largest internet service providers in Indonesia:

$ llm compare 20 latest tweet directed @IndiHomeCare, @di_cbn, @BiznetHome, @ID_MyRepublic. What are people sentiment to the product? Do 1 search for each account

Analysis results show:

  • IndiHomeCare: Primarily negative sentiment (unstable network, slow response)
  • CBN: Mostly negative sentiment (long-term outages, slow customer service response)
  • BiznetHome: Strong negative sentiment (frequent network interruptions, slow speed)
  • MyRepublic: Extremely negative sentiment (severe service interruptions, extremely poor customer service)

2. Personal Timeline Analysis

$ llm what is happening on my twitter timeline?

Capable of analyzing and summarizing:

  • Professional/technical news
  • Important tweet summaries
  • Categorized organization of various topics

Technical Features

Model Context Protocol Integration

  • Built entirely based on the MCP standard
  • Seamless integration with Claude Desktop
  • Supports tool calling and structured responses

Multi-Functional API Support

  • search_twitter: Tweet search functionality
  • get_timeline: Timeline retrieval functionality
  • Supports complex query syntax and parameter configuration

Security Authentication

  • Supports username/email/password authentication
  • Secure environment variable configuration
  • Adheres to Twitter API usage guidelines

Related Project Ecosystem

Developer adhikasp also maintains other MCP server projects:

  • mcp-linkedin: LinkedIn data access
  • mcp-git-ingest: GitHub repository analysis
  • mcp-reddit: Reddit content retrieval
  • mcp-youtube: YouTube transcription retrieval

Usage Recommendations

  1. Enterprise Applications: Suitable for brand monitoring, competitor analysis, customer sentiment tracking
  2. Personal Use: Timeline management, trend analysis, social media insights
  3. Research Purposes: Social media research, sentiment analysis research, data mining

Precautions

  • Requires valid Twitter account credentials
  • Adheres to Twitter's terms of service and API limitations
  • It is recommended to reasonably control the request frequency to avoid account risks
  • Ensure data usage complies with privacy protection requirements