Twitter MCP Server

Twitter MCP Server

Provides tools for accurate Twitter/X post character counting, validation, and optimization using official counting methods. It enables users to extract entities like URLs and hashtags to ensure content fits within platform constraints.

Category
Visit Server

README

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 optimize
    • maxLength (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

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Create a Pull Request

Support

If you have any issues or questions, please report them in GitHub Issues.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured