- Explore MCP Servers
- twitter-mcp-server
Twitter Mcp Server
What is Twitter Mcp Server
twitter-mcp-server is an MCP (Model Context Protocol) server designed to accurately count Twitter/X post characters and optimize posts for better engagement.
Use cases
Use cases include validating tweet length before posting, optimizing content for better engagement, extracting entities for analytics, and ensuring compliance with Twitter/X’s posting guidelines.
How to use
To use twitter-mcp-server, clone the repository, install dependencies, and configure it in your Claude Desktop configuration file. You can then utilize various tools like count_tweet_characters, validate_tweet, optimize_tweet, and extract_entities within Claude.
Key features
Key features include accurate character counting based on Twitter/X’s official method, post validation for character limits, optimization suggestions for long posts, and entity extraction for URLs, mentions, and hashtags.
Where to use
twitter-mcp-server can be used in social media management, content creation, marketing, and any application that requires precise character counting and post optimization for Twitter/X.
Overview
What is Twitter Mcp Server
twitter-mcp-server is an MCP (Model Context Protocol) server designed to accurately count Twitter/X post characters and optimize posts for better engagement.
Use cases
Use cases include validating tweet length before posting, optimizing content for better engagement, extracting entities for analytics, and ensuring compliance with Twitter/X’s posting guidelines.
How to use
To use twitter-mcp-server, clone the repository, install dependencies, and configure it in your Claude Desktop configuration file. You can then utilize various tools like count_tweet_characters, validate_tweet, optimize_tweet, and extract_entities within Claude.
Key features
Key features include accurate character counting based on Twitter/X’s official method, post validation for character limits, optimization suggestions for long posts, and entity extraction for URLs, mentions, and hashtags.
Where to use
twitter-mcp-server can be used in social media management, content creation, marketing, and any application that requires precise character counting and post optimization for Twitter/X.
Content
Twitter MCP Server
An MCP (Model Context Protocol) server for Claude to accurately count Twitter/X post characters and optimize posts.
Features
- Accurate Character Counting: Calculate character count based on Twitter/X’s official counting method
- Post Validation: Check character limits and other constraints
- Post Optimization: Suggestions for optimizing posts that are too long
- Entity Extraction: Extract and analyze URLs, mentions, and hashtags
Installation
# Clone the repository
git clone <your-repo-url>
cd twitter-mcp-server
# Install dependencies
npm install
# Build
npm run build
Configuration for Claude Desktop
Add the following to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json
):
{
"mcpServers": {
"twitter-mcp-server": {
"command": "node",
"args": [
"/path/to/twitter-mcp-server/dist/server.js"
]
}
}
}
Usage
The following tools will be available in Claude:
1. count_tweet_characters
Please count the characters in this Twitter/X post accurately: "Hello! It's a beautiful day today ☀️ #goodweather https://example.com"
2. validate_tweet
Please validate if this post is valid: "(long post text)"
3. optimize_tweet
Please optimize this post: "(post text to optimize)"
4. extract_entities
Please extract entities from this post: "@user Hello! #hello please check out https://example.com"
Development
# Start in development mode
npm run dev
# Build
npm run build
# Start in production
npm start
API Details
count_tweet_characters
- Input:
text
(string) - Text to count - Output: Detailed information including character count, remaining characters, validity
validate_tweet
- Input:
text
(string) - Text to validate - Output: Validity, issues, entity information
optimize_tweet
- Input:
text
(string) - Text to optimizemaxLength
(number, optional) - Maximum character count (default: 280)
- Output: Optimized text and suggestions
extract_entities
- Input:
text
(string) - Text to extract entities from - Output: Lists of URLs, mentions, and hashtags
Tech Stack
- TypeScript: Type safety and better development experience
- @modelcontextprotocol/sdk: MCP server implementation
- twitter-text: Official Twitter character counting library
License
MIT License
Contributing
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Create a Pull Request
Support
If you have any issues or questions, please report them in GitHub Issues.