LabscoMCP early access ↗
serimaMCP SERVER

Twitter Character Counter MCP

Count a post the way X counts it — no account, no API key, just the official character-counting library.

by serima ↗Social Media Accounts & PostingCommunity

LABSCO SUMMARY

It solves the one thing string length gets wrong.

A URL does not cost what it looks like it costs, and an emoji can count as two — which is why drafts written by a model routinely come back over the limit despite looking short. Running the platform's own counting library locally removes the guesswork entirely, with no credential to manage because nothing leaves the machine. Pair the count with the optimiser: knowing a draft is over the limit is only half of what you need.

What it is

A text tool for X and Twitter posts. It counts characters using the platform's own counting method rather than string length, validates a draft against the limits, suggests how to shorten one that is too long, and extracts the URLs, mentions and hashtags it contains.

What you get

  • count_tweet_characters takes text and returns the count, the remaining characters and whether the post is valid
  • validate_tweet checks a draft against the constraints and reports the specific issues
  • optimize_tweet suggests how to shorten a post, with an optional maxLength defaulting to 280
  • extract_entities returns the URLs, mentions and hashtags separately
  • Counting runs on twitter-text, the official character-counting library, so emoji and URLs weigh what the platform says they weigh

Requirements

Node.js. Clone the repository, npm install and npm run build, then point the client at the built server. The npm package mcp-x-post-optimizer has been unpublished, so building from the clone is the only way in. There is nothing to authenticate — no account, no key, no network call, because the counting happens locally.

Setup effort

Build from source — git clone https://github.com/serima/twitter-mcp-server.git