Updated April 2026

Install Twitter MCP Server

Pick your client, copy the command, done.

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone <your-repo-url>
cd twitter-mcp-server
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add twitter-mcp-server -- node "<FULL_PATH_TO_TWITTER_MCP_SERVER>/dist/index.js"

Replace <FULL_PATH_TO_TWITTER_MCP_SERVER>/dist/index.js with the actual folder you prepared in step 1.

Available Tools (4)

Once configured, Twitter MCP Server gives your AI agent access to:

count_tweet_charactersCalculate character count based on Twitter/X's official counting method.
text
validate_tweetCheck character limits and other constraints for a post.
text
optimize_tweetGet suggestions for optimizing posts that are too long.
textmaxLength
extract_entitiesExtract and analyze URLs, mentions, and hashtags from a post.
text

Try It Out

After setup, try these prompts with your AI agent:

Count the characters in this draft tweet to see if it fits within the limit: 'Hello! It's a beautiful day today ☀️ #goodweather https://example.com'
Validate if this post is within the Twitter character limit: '(long post text)'
Optimize this post so it fits within the 280 character limit: '(post text to optimize)'
Extract all the hashtags, mentions, and URLs from this tweet: '@user Hello! #hello please check out https://example.com'
Prerequisites & system requirements
  • An MCP-compatible client (Claude Code, Cursor, Windsurf, Claude Desktop, or Codex)
  • Node.js 18+ with npm/npx installed

Keep this setup from going cold

Save the docs, env vars, and workflow around Twitter MCP Server in Conare so Claude Code, Codex, and Cursor remember it next time.

Need the legacy visual installer? Open Conare IDE.
Remember this setup