Twitter MCP Server for Claude Desktop
LocalAbout Twitter MCP Server for Claude Desktop
Twitter MCP Server for Claude Desktop connects Claude Desktop to Twitter through the Twitter API. It provides access to profile and trend data, tweet actions, content analysis, and prompt templates for composing tweets and threads.
Key features
- 01Read profile, tweets, and trends
- 02Post and delete tweets
- 03Analyze tweet content
- 04Templates for tweets and threads
- 05Confirm before posting or deleting
Use cases
- 01Checking current Twitter trends
- 02Drafting tweets or multi-post threads
- 03Reviewing tweet engagement potential
- 04Publishing or removing a tweet
MCP support
The MCP server exposes Twitter profile, recent tweets, and trending topics as resources; posting, deletion, and analysis as tools; and writing templates as prompts.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMETwitter 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
- Node.js (v16 or higher)
- Claude Desktop
- Twitter Developer Account with API keys
Installation
-
Clone or download this repository
git clone https://github.com/yourusername/twitter-mcp-server cd twitter-mcp-server -
Install dependencies
npm install -
Create a
.envfile in the project root with your Twitter API credentialsTWITTER_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
- Open Claude Desktop and access settings (from the Claude menu, not in-app)
- Click on "Developer" in the left sidebar, then "Edit Config"
- Add the Twitter MCP server to your configuration:
{
"mcpServers": {
"Twitter Assistant": {
"command": "npm",
"args": [
"--prefix",
"/full/path/to/twitter-mcp-server.js",
"start"
]
}
}
}
- Replace
/full/path/to/twitter-mcp-server.jswith the actual path to your server file - 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)
- Parameters:
-
Delete Tweet: Remove a tweet by ID
- Parameters:
tweetId(string)
- Parameters:
-
Analyze Tweet: Check engagement potential of tweet content
- Parameters:
content(string, max 280 chars)
- Parameters:
Prompts
-
Concise Tweet: Create short, focused tweets
- Parameters:
topic(string),include_hashtags(boolean),tone(enum: professional, casual, humorous)
- Parameters:
-
Twitter Thread: Generate multi-tweet threads
- Parameters:
topic(string),points(number, 2-5),include_call_to_action(boolean)
- Parameters:
-
Engagement Tweet: Create tweets designed for high engagement
- Parameters:
topic(string),engagement_type(enum: question, poll, hot-take, useful-tip)
- Parameters:
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.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.