Twitter Cookie mcpServer

by dewkiks

377 downloads
Not rated
GitHub

About

A Model Context Protocol (MCP) server that enables AI assistants to interact with Twitter using cookie-based authentication. It leverages the unofficial twikit library for Twitter integration and is intended for educational/experimental use.

Details

Author
dewkiks
Downloads
377
Categories
Other

- Post, like, retweet, and search tweets
- Get user profiles and follow/unfollow users
- Access your timeline or other user timelines
- Send, read, and react to direct messages
- Retrieve trending topics by category

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Twitter Cookie mcpServer
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via Smithery or manually clone the repository and install dependencies with pip install -r requirements.txt. Obtain the ct0 and auth_token cookies from your logged-in Twitter/X browser session, then configure Claude Desktop by adding environment variables TWITTER_CT0 and TWITTER_AUTH_TOKEN to the server entry in claude_desktop_config.json.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "twitter cookie mcpserver": {
            "twitter": {
                "command": "python",
                "args": [
                    "./path/to/server.py"
                ],
                "env": {
                    "TWITTER_CT0": "your_ct0_here",
                    "TWITTER_AUTH_TOKEN": "your_auth_token_here"
                }
            }
        }
    }
}

McpServers

{
    "twitter": {
        "command": "python",
        "args": [
            "./path/to/server.py"
        ],
        "env": {
            "TWITTER_CT0": "your_ct0_here",
            "TWITTER_AUTH_TOKEN": "your_auth_token_here"
        }
    }
}

Twitter MCP Server

smithery badge

A Model Context Protocol (MCP) server for Twitter integration using cookie-based authentication. Allows AI assistants to interact with Twitter through a standardized protocol.

⚠️ Disclaimer

This uses an unofficial Twitter API via the twikit library. Not endorsed by Twitter/X and may break without notice. Use for educational/experimental purposes only. Account restrictions possible.

Quick Setup

Installing via Smithery

To install Twitter MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @dewkiks/twitter-mcp-server --client claude

Manual Installation

1. Install
git clone <repository-url>
cd twitter-mcp
pip install -r requirements.txt

2. Get Twitter Cookies
- Open Twitter/X in browser and login
- Open Developer Tools (F12) → Application/Storage → Cookies → twitter.com
- Copy these values:
- ct0 (CSRF token)
- auth_token (Authentication token)

3. Configure Claude Desktop
Add to your claude_desktop_config.json:

{
"mcpServers": {
"twitter": {
"command": "python",
"args": ["./path/to/server.py"],
"env": {
"TWITTER_CT0": "your_ct0_here",
"TWITTER_AUTH_TOKEN": "your_auth_token_here"
}
}
}
}

Main Features

- Tweet Management: Post, like, retweet, search tweets
- User Operations: Get profiles, follow/unfollow users
- Timeline Access: Get your timeline and user timelines
- Direct Messages: Send DMs, get history, react to messages
- Trending Topics: Get trending topics by category

Key Tools

Tweet Operations

- tweet - Post a new tweet - like_tweet - Like a tweet by ID - retweet - Retweet by ID - search_tweets - Search for tweets

User Operations

- get_user_info - Get user profile info - get_timeline - Get your timeline

Direct Messages

- send_dm - Send direct message to username - get_dm_history - Get DM history with user - add_reaction_to_message - React with emoji - delete_dm - Delete a message

Other

- get_tweet_replies - Get replies to a tweet - get_trends - Get trending topics

Example Usage

Post a tweet about AI developments

Search for tweets about "artificial intelligence" and show me the top 10

Send a DM to @username saying "Hello from MCP!"

Get my timeline with the latest 20 tweets

Like the tweet with ID 1234567890123456789

Get trending topics in sports

Show me replies to tweet ID 9876543210987654321

That's it! All tools require the cookies to be set in your environment variables.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.