Twitter

v0.2.0Communicationstable

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.

mcpmodelcontextprotocolservertwitterclaude
Share:
393
Stars
0
Downloads
0
Weekly
0/5

What is Twitter?

Twitter is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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 conte...

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.

This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Provides tools for accurate Twitter/X post character countin

Use Cases

Validate Twitter/X post content and count characters accurately.
Extract entities like URLs and hashtags for platform compliance.
EnesCinr

Maintainer

LicenseMIT License
Languagetypescript
Versionv0.2.0
UpdatedMay 17, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @enescinar/twitter-mcp

Manual Installation

npx -y @enescinar/twitter-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Twitter

The Twitter MCP server (@enescinar/twitter-mcp) gives AI assistants the ability to post tweets and search Twitter/X through a typed MCP interface, handling accurate character counting and entity extraction to keep content within platform constraints. It connects to the Twitter v2 API using OAuth 1.0a credentials and exposes two core tools — post_tweet and search_tweets — that AI agents can call directly from natural language prompts. Developers building social media automation, content pipelines, or social listening workflows use it to integrate Twitter actions into their AI-driven processes.

Prerequisites

  • Node.js 18+ with npx available
  • A Twitter Developer account with an approved app at developer.twitter.com
  • Four Twitter API credentials: API_KEY, API_SECRET_KEY, ACCESS_TOKEN, and ACCESS_TOKEN_SECRET
  • An MCP-compatible client such as Claude Desktop
1

Create a Twitter Developer app

Go to developer.twitter.com and create a new project and app. Under the app settings, enable Read and Write permissions and generate OAuth 1.0a credentials: API Key, API Secret Key, Access Token, and Access Token Secret.

2

Note your four credential values

From the Twitter Developer Portal, collect: API Key (API_KEY), API Secret Key (API_SECRET_KEY), Access Token (ACCESS_TOKEN), and Access Token Secret (ACCESS_TOKEN_SECRET). These are required in the MCP config.

3

Add the server to your MCP client config

Open claude_desktop_config.json and add the twitter-mcp server block with all four credentials as environment variables.

{
  "mcpServers": {
    "twitter-mcp": {
      "command": "npx",
      "args": ["-y", "@enescinar/twitter-mcp"],
      "env": {
        "API_KEY": "your_twitter_api_key",
        "API_SECRET_KEY": "your_twitter_api_secret_key",
        "ACCESS_TOKEN": "your_access_token",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret"
      }
    }
  }
}
4

Restart your MCP client

Restart Claude Desktop or your chosen MCP client to load the new server configuration. The twitter-mcp tools (post_tweet and search_tweets) will appear as available tools.

5

Test with a search query

Ask your AI assistant to search for tweets on a topic to verify the connection is working before attempting to post.

Twitter Examples

Client configuration

Add the Twitter MCP server to claude_desktop_config.json with your four OAuth 1.0a credentials.

{
  "mcpServers": {
    "twitter-mcp": {
      "command": "npx",
      "args": ["-y", "@enescinar/twitter-mcp"],
      "env": {
        "API_KEY": "your_twitter_api_key",
        "API_SECRET_KEY": "your_twitter_api_secret_key",
        "ACCESS_TOKEN": "your_access_token",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret"
      }
    }
  }
}

Prompts to try

After configuring the server, use these prompts with Claude Desktop to interact with Twitter/X.

- "Search Twitter for the latest tweets about Model Context Protocol"
- "Post a tweet announcing our new open-source library: 'Excited to launch...' — make sure it's under 280 characters"
- "Find the most recent tweets mentioning @anthropic and summarize the sentiment"
- "Count the characters in this tweet draft and tell me if it fits: [paste draft]"
- "Search for tweets about AI coding tools from the past 7 days"

Troubleshooting Twitter

post_tweet returns 403 Forbidden

Your Twitter app likely has Read-only permissions. Go to the Twitter Developer Portal, find your app, and change permissions to Read and Write. After changing permissions, regenerate your Access Token and Access Token Secret — old tokens retain the original permissions.

search_tweets returns no results or empty arrays

The Twitter v2 search endpoint requires at minimum a Basic tier API access. Free developer accounts have limited search capabilities. Upgrade your developer plan or use the recent search endpoint with simpler queries.

npx -y @enescinar/twitter-mcp fails to start

Confirm all four environment variables are set in the MCP config env block. If any credential contains special characters, wrap the value in quotes. Run 'npx -y @enescinar/twitter-mcp' directly in a terminal to see the raw error output.

Frequently Asked Questions about Twitter

What is Twitter?

Twitter is a Model Context Protocol (MCP) server that 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. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Twitter?

Install via npm with the command: npx -y @enescinar/twitter-mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Twitter?

Twitter works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Twitter free to use?

Yes, Twitter is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Communication MCP Servers

Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "twitter-mcp-server": { "command": "npx", "args": ["-y", "@enescinar/twitter-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Twitter?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides