Twitter

by dishant27

2 stars
368 downloads
Not rated
GitHub

About

Integrates with Twitter's API to enable posting tweets, searching content, managing profiles, and handling follower relationships with robust error handling for rate limits and authentication issues.

Details

Author
dishant27
Repository
Dishant27/twitter-mcp
GitHub stars
2
Downloads
368
License
MIT License
Categories
Productivity, Developer Tools, Design, File Management, AI, Search, Security, API, Frontend, Infrastructure, Other

- Post tweets up to 280 characters
- Search for tweets by query with adjustable result count
- Get and update authenticated user profile information
- Follow and unfollow users
- List followers and accounts a user is following
- Create, retrieve, and list lists (public or private)

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
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 path/to/twitter-mcp/dist/index.js
    Environment
    • TWITTER_API_KEY your_api_key
    • TWITTER_API_SECRET your_api_secret
    • TWITTER_ACCESS_TOKEN your_access_token
    • TWITTER_ACCESS_TOKEN_SECRET your_access_token_secret

    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

Setup

1. Create an X Developer account and get your API keys from X Developer Portal
2. Set all required API keys in the environment variables
3. Clone this repository: git clone https://github.com/Dishant27/twitter-mcp.git
4. Install dependencies: npm install
5. Run the server:
- With environment variables:

TWITTER_API_KEY=your_api_key \
TWITTER_API_SECRET=your_api_secret \
TWITTER_ACCESS_TOKEN=your_access_token \
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret \
npm start

- Using a .env file:

Requirements

- Node.js 18.x or higher
- X Developer account with API keys
- API v1 and v2 access

Environment Variables

| Variable | Description |
|----------|-------------|
| TWITTER_API_KEY | Your API key |
| TWITTER_API_SECRET | Your API secret |
| TWITTER_ACCESS_TOKEN | Your access token |
| TWITTER_ACCESS_TOKEN_SECRET | Your access token secret |

Claude Configuration

To use this server with Claude, you'll need to set up the MCP configuration. Here's an example of how the configuration structure should look:

json
{
"name": "x",
"display_name": "X",
"description": "X MCP allows Claude to interact with X (formerly Twitter)",
"path": "path/to/twitter-mcp/dist/index.js",
"startup": {
"env": {
"TWITTER_API_KEY": "your_api_key",
"TWITTER_API_SECRET": "your_api_secret",
"TWITTER_ACCESS_TOKEN": "your_access_token",
"TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
}
},
"transport": "stdio"
}
``

Save this configuration in your Claude MCP config directory, typically located at:
- Windows:
%APPDATA%\AnthropicClaude\mcp-servers
- macOS:
~/Library/Application Support/AnthropicClaude/mcp-servers
- Linux:
~/.config/AnthropicClaude/mcp-servers`

post_tweet

Post new content to X

search_tweets

Search for content on X

get_profile

Get profile information for a user or the authenticated account

update_profile

Update the authenticated user's profile

follow_user

Follow a user

unfollow_user

Unfollow a user

list_followers

List followers of a user or the authenticated account

list_following

List accounts that a user or the authenticated account is following

create_list

Create a new list

get_list_info

Get information about a list

get_user_lists

Get all lists owned by the authenticated user

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "twitter": {
            "env": {
                "TWITTER_API_KEY": "your_api_key",
                "TWITTER_API_SECRET": "your_api_secret",
                "TWITTER_ACCESS_TOKEN": "your_access_token",
                "TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
            },
            "args": [
                "path/to/twitter-mcp/dist/index.js"
            ],
            "command": "node"
        }
    }
}

Linux

{
    "env": {
        "TWITTER_API_KEY": "your_api_key",
        "TWITTER_API_SECRET": "your_api_secret",
        "TWITTER_ACCESS_TOKEN": "your_access_token",
        "TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
    },
    "args": [
        "path/to/twitter-mcp/dist/index.js"
    ],
    "command": "node"
}

Macos

{
    "env": {
        "TWITTER_API_KEY": "your_api_key",
        "TWITTER_API_SECRET": "your_api_secret",
        "TWITTER_ACCESS_TOKEN": "your_access_token",
        "TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
    },
    "args": [
        "path/to/twitter-mcp/dist/index.js"
    ],
    "command": "node"
}

Windows

{
    "env": {
        "TWITTER_API_KEY": "your_api_key",
        "TWITTER_API_SECRET": "your_api_secret",
        "TWITTER_ACCESS_TOKEN": "your_access_token",
        "TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
    },
    "args": [
        "path/to/twitter-mcp/dist/index.js"
    ],
    "command": "node"
}

X Logo X (Twitter) MCP Server

This MCP server allows Clients to interact with X (formerly Twitter), enabling comprehensive platform operations including posting tweets, searching content, managing accounts, and organizing lists.

Quick Start

1. Create an X Developer account and get your API keys from X Developer Portal
2. Set all required API keys in the environment variables
3. Clone this repository: git clone https://github.com/Dishant27/twitter-mcp.git
4. Install dependencies: npm install
5. Run the server:
- With environment variables:

TWITTER_API_KEY=your_api_key \
TWITTER_API_SECRET=your_api_secret \
TWITTER_ACCESS_TOKEN=your_access_token \
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret \
npm start

- Using a .env file:
```bash

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.