Get the FREE Ultimate OpenClaw Setup Guide →

twitter

MCP server from serima/twitter-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio serima-twitter-mcp-server node /path/to/twitter-mcp-server/dist/server.js

How to use

The Twitter MCP Server provides tools to count characters according to Twitter/X rules, validate posts against Twitter limits, optimize posts to fit within limits, and extract entities such as URLs, mentions, and hashtags. It exposes four MCP tools that you can invoke from Claude: count_tweet_characters, validate_tweet, optimize_tweet, and extract_entities. Each tool takes a text input and, where applicable, additional parameters like maxLength for optimization. The server uses the official twitter-text counting logic to ensure counts align with Twitter/X behavior. Use the provided commands in Claude to get precise character counts, validate posts, receive optimization suggestions, and extract relevant entities from your content.

How to install

Prerequisites:

  • Node.js (recommended LTS) and npm installed on your system
  • Git for cloning the repository
  • Access to the MCP server repository (or your fork of it)

Installation steps:

  1. Clone the repository git clone <your-repo-url> cd twitter-mcp-server

  2. Install dependencies npm install

  3. Build the project npm run build

  4. Run the server (development/production options may vary) npm run dev # for development npm start # for production

  5. Configure Claude Desktop to point to the server entrypoint (as shown in the README configuration example).

Additional notes

Tips and common considerations:

  • Ensure the path in the mcp_config matches the built server file (dist/server.js).
  • If you modify the server, re-build before restarting Claude to pick up changes.
  • The server relies on Twitter/X counting rules; if Twitter changes its counting, you may need to update the dependency or counting logic.
  • If you run into port or network issues, verify firewall rules and that the node process has permission to bind interfaces as required by your environment.
  • Environment variables are not defined in this README; add any required VAR_NAME values to env in mcp_config if your deployment requires them.

Related MCP Servers

Sponsor this space

Reach thousands of developers