Cover image
Try Now
2025-03-17

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

Twitter MCP Server for Claude Desktop

A Model Context Protocol (MCP) server that enables Claude Desktop to interact with Twitter - post tweets, analyze content, and create well-structured tweets based on prompts.

Overview

This MCP server connects Claude Desktop to Twitter via the Twitter API, providing several capabilities:

  • Resources: Access your Twitter profile, recent tweets, and trending topics
  • Tools: Post tweets, delete tweets, and analyze tweet content
  • Prompts: Templates for creating concise tweets, Twitter threads, and engagement-focused content

Prerequisites

Installation

  1. Clone or download this repository

    git clone https://github.com/yourusername/twitter-mcp-server
    cd twitter-mcp-server
    
  2. Install dependencies

    npm install
    
  3. Create a .env file in the project root with your Twitter API credentials

    TWITTER_API_KEY=your_api_key
    TWITTER_API_SECRET=your_api_secret
    TWITTER_ACCESS_TOKEN=your_access_token
    TWITTER_ACCESS_SECRET=your_access_secret
    

Setup with Claude Desktop

  1. Open Claude Desktop and access settings (from the Claude menu, not in-app)
  2. Click on "Developer" in the left sidebar, then "Edit Config"
  3. Add the Twitter MCP server to your configuration:
{
    "mcpServers": {
        "Twitter Assistant": {
            "command": "npm",
            "args": [
                "--prefix",
                "/full/path/to/twitter-mcp-server.js",
                "start"
            ]
        }
    }
}
  1. Replace /full/path/to/twitter-mcp-server.js with the actual path to your server file
  2. Save the configuration file and restart Claude Desktop

Features

Resources

  • User Profile (twitter://user/profile): Get information about your Twitter profile
  • Recent Tweets (twitter://user/tweets): Retrieve your most recent tweets
  • Trending Topics (twitter://trends): Fetch current trending topics

Tools

  • Post Tweet: Publish a new tweet with content validation

    • Parameters: content (string, max 280 chars), dryRun (boolean, optional)
  • Delete Tweet: Remove a tweet by ID

    • Parameters: tweetId (string)
  • Analyze Tweet: Check engagement potential of tweet content

    • Parameters: content (string, max 280 chars)

Prompts

  • Concise Tweet: Create short, focused tweets

    • Parameters: topic (string), include_hashtags (boolean), tone (enum: professional, casual, humorous)
  • Twitter Thread: Generate multi-tweet threads

    • Parameters: topic (string), points (number, 2-5), include_call_to_action (boolean)
  • Engagement Tweet: Create tweets designed for high engagement

    • Parameters: topic (string), engagement_type (enum: question, poll, hot-take, useful-tip)

Usage Examples

Once configured, you can ask Claude Desktop:

  • "What are the current trending topics on Twitter?"
  • "Draft a professional tweet about artificial intelligence"
  • "Create a Twitter thread about climate change with 3 points"
  • "Analyze this tweet: [your tweet content]"
  • "Post this tweet: Just learned how to connect Claude with Twitter!"

File Structure

twitter-mcp-server/
├── twitter-mcp-server.js  # Main server file
├── .env                   # Environment variables (API keys)
├── package.json           # Project dependencies
└── README.md              # This file

Troubleshooting

  • Twitter API Errors: Verify your API credentials and permissions
  • Server Not Found: Check that the path in your configuration is correct
  • Module Not Found: Ensure all dependencies are installed (npm install)
  • Connection Issues: Make sure Claude Desktop is restarted after configuration changes

Security Note

This server runs with the permissions of your user account. It will ask for confirmation before posting or deleting tweets, but always review actions before approving them.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    5 (1)
    Avatar
    user_BQ4NoRrY
    2025-04-16

    I've been using the twitter-mcp-server by SouravKumarBarman, and it's quite impressive. The server efficiently manages and processes Twitter content, proving its reliability and robustness. Integration was seamless, thanks to the well-documented guidelines on GitHub. I highly recommend it to anyone looking to handle Twitter data effectively.