X (Twitter)

by enescinr

308 stars
2.3k downloads
Not rated
GitHub

About

Interact with X (Twitter) by posting tweets and searching for tweets through the X API.

Details

Author
enescinr
Repository
EnesCinr/twitter-mcp
GitHub stars
308
Downloads
2,334
License
MIT License
Categories
Communication, Other, Design, AI, Community, Media, Search, API, Automation, Knowledge Base, Frontend

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 X (Twitter)
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @enescinar/twitter-mcp
    Environment
    • API_KEY your_api_key_here
    • ACCESS_TOKEN your_access_token_here
    • API_SECRET_KEY your_api_secret_key_here
    • ACCESS_TOKEN_SECRET your_access_token_secret_here

    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

1. Create a Twitter Developer account and get your API keys from Twitter Developer Portal

2. Add this configuration to your Claude Desktop config file:

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "twitter-mcp": {
      "command": "npx",
      "args": ["-y", "@enescinar/twitter-mcp"],
      "env": {
        "API_KEY": "your_api_key_here",
        "API_SECRET_KEY": "your_api_secret_key_here",
        "ACCESS_TOKEN": "your_access_token_here",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret_here"
      }
    }
  }
}

3. Restart Claude Desktop

That's it! Claude can now interact with Twitter through two tools:

- post_tweet: Post a new tweet
- search_tweets: Search for tweets

Try asking Claude:
- "Can you post a tweet saying 'Hello from Claude!'"
- "Can you search for tweets about Claude AI?"

The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found here.

OPENAI_API_KEY=your-key  npx mcp-eval src/evals/evals.ts src/index.ts

post_tweet

Post a new tweet.

search_tweets

Search for tweets.

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "x (twitter)": {
            "env": {
                "API_KEY": "your_api_key_here",
                "ACCESS_TOKEN": "your_access_token_here",
                "API_SECRET_KEY": "your_api_secret_key_here",
                "ACCESS_TOKEN_SECRET": "your_access_token_secret_here"
            },
            "args": [
                "-y",
                "@enescinar/twitter-mcp"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": {
        "API_KEY": "your_api_key_here",
        "ACCESS_TOKEN": "your_access_token_here",
        "API_SECRET_KEY": "your_api_secret_key_here",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret_here"
    },
    "args": [
        "-y",
        "@enescinar/twitter-mcp"
    ],
    "command": "npx"
}

Macos

{
    "env": {
        "API_KEY": "your_api_key_here",
        "ACCESS_TOKEN": "your_access_token_here",
        "API_SECRET_KEY": "your_api_secret_key_here",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret_here"
    },
    "args": [
        "-y",
        "@enescinar/twitter-mcp"
    ],
    "command": "npx"
}

Windows

{
    "env": {
        "API_KEY": "your_api_key_here",
        "ACCESS_TOKEN": "your_access_token_here",
        "API_SECRET_KEY": "your_api_secret_key_here",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret_here"
    },
    "args": [
        "/c",
        "npx",
        "-y",
        "@enescinar/twitter-mcp"
    ],
    "command": "cmd"
}

MseeP.ai Security Assessment Badge

Twitter MCP Server

smithery badge

This MCP server allows Clients to interact with Twitter, enabling posting tweets and searching Twitter.

<a href="https://glama.ai/mcp/servers/dhsudtc7cd">
Twitter Server MCP server
</a>

Quick Start

1. Create a Twitter Developer account and get your API keys from Twitter Developer Portal

2. Add this configuration to your Claude Desktop config file:

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "twitter-mcp": {
      "command": "npx",
      "args": ["-y", "@enescinar/twitter-mcp"],
      "env": {
        "API_KEY": "your_api_key_here",
        "API_SECRET_KEY": "your_api_secret_key_here",
        "ACCESS_TOKEN": "your_access_token_here",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret_here"
      }
    }
  }
}

3. Restart Claude Desktop

That's it! Claude can now interact with Twitter through two tools:

- post_tweet: Post a new tweet
- search_tweets: Search for tweets

Example Usage

Try asking Claude:
- "Can you post a tweet saying 'Hello from Claude!'"
- "Can you search for tweets about Claude AI?"

Troubleshooting

Logs can be found at:
- Windows: %APPDATA%\Claude\logs\mcp-server-twitter.log
- macOS: ~/Library/Logs/Claude/mcp-server-twitter.log

Development

If you want to contribute or run from source:

1. Clone the repository:

git clone https://github.com/EnesCinr/twitter-mcp.git
cd twitter-mcp

2. Install dependencies:

npm install

3. Build:

npm run build

4. Run:

npm start

Running evals

The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found here.

OPENAI_API_KEY=your-key  npx mcp-eval src/evals/evals.ts src/index.ts

License

MIT

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.