X (Twitter) MCP Server

X (Twitter) MCP Server

twitter-mcp•bydishant27

An MCP server that lets clients interact with X (formerly Twitter) for posting, searching, account management, and list operations.

License: MIT•Runtime: Awaiting documentation review•Category: communication social

WHAT IT DOES

  • •Posts content to X and searches posts by query with a customizable result count.
  • •Supports account management: reading profiles, updating profile details, following and unfollowing users, and listing followers and following accounts.
  • •Manages lists by creating public or private lists, retrieving list information, and listing lists owned by the authenticated user.

BEST FOR

  • •Using an MCP client such as Claude to post tweets and search X content.
  • •Automating follower and following management for an X account through MCP tools.
  • •Organizing X content into lists programmatically via MCP.

ABOUT TWITTER-MCP

X (Twitter) MCP Server is cataloged as an MCP server attributed to dishant27. An MCP server that lets clients interact with X (formerly Twitter) for posting, searching, account management, and list operations. It is categorized under communication social. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for X (Twitter) MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What credentials are required to run this server?

All four X API credentials are required, and the server exits at startup if any is missing.

How many MCP tools does the server expose?

The build includes 11 tools, as checked by the smoke test.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 6c348761c72a · 采集于 2026-11-13 10:42:37 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

X Logo X (Twitter) MCP Server

This MCP server allows Clients to interact with X (formerly Twitter), enabling comprehensive platform operations including posting tweets, searching content, managing accounts, and organizing lists.

Quick Start

  1. Create an X Developer account and get your API keys from X Developer Portal
  2. Clone this repository: git clone https://github.com/Dishant27/twitter-mcp.git
  3. Install dependencies and build: npm install && npm run build
  4. Set your API keys, either as environment variables or in a .env file (copy .env.example to .env and fill in your values; .env is git-ignored, so never commit it)
  5. Run the server:
  • With environment variables:
TWITTER_API_KEY=your_api_key \
TWITTER_API_SECRET=your_api_secret \
TWITTER_ACCESS_TOKEN=your_access_token \
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret \
npm start
  • Using a .env file:
cp .env.example .env
# edit .env with your own keys, then:
npm start
  1. Use with a MCP client, such as Claude.

Claude Configuration

To use this server with Claude, you'll need to set up the MCP configuration. Here's an example of how the configuration structure should look:

{
  "name": "x",
  "display_name": "X",
  "description": "X MCP allows Claude to interact with X (formerly Twitter)",
  "path": "path/to/twitter-mcp/dist/index.js",
  "startup": {
    "env": {
      "TWITTER_API_KEY": "your_api_key",
      "TWITTER_API_SECRET": "your_api_secret",
      "TWITTER_ACCESS_TOKEN": "your_access_token",
      "TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
    }
  },
  "transport": "stdio"
}

Save this configuration in your Claude MCP config directory, typically located at:

  • Windows: %APPDATA%\AnthropicClaude\mcp-servers
  • macOS: ~/Library/Application Support/AnthropicClaude/mcp-servers
  • Linux: ~/.config/AnthropicClaude/mcp-servers

Features

Post Operations

  • Post content (up to 280 characters)
  • Search for posts by query with customizable result count

Account Management

  • Get profile information for any user or the authenticated account
  • Update profile details (name, bio, location, website URL)
  • Follow and unfollow users
  • List followers for any user or the authenticated account
  • List accounts that a user is following

List Management

  • Create new lists (public or private)
  • Get information about specific lists
  • Retrieve all lists owned by the authenticated user

Available MCP Tools

Tool NameDescription
post_tweetPost new content to X
search_tweetsSearch for content on X
get_profileGet profile information for a user or the authenticated account
update_profileUpdate the authenticated user's profile
follow_userFollow a user
unfollow_userUnfollow a user
list_followersList followers of a user or the authenticated account
list_followingList accounts that a user or the authenticated account is following
create_listCreate a new list
get_list_infoGet information about a list
get_user_listsGet all lists owned by the authenticated user

Requirements

  • Node.js 18.x or higher
  • X Developer account with API keys
  • API v1 and v2 access

Built on @modelcontextprotocol/sdk 1.x (the McpServer / registerTool API with zod input schemas). It runs over stdio, so stdout is reserved for the MCP protocol and all logs go to stderr.

Environment Variables

VariableDescription
TWITTER_API_KEYYour API key
TWITTER_API_SECRETYour API secret
TWITTER_ACCESS_TOKENYour access token
TWITTER_ACCESS_TOKEN_SECRETYour access token secret

All four are required; the server exits at startup if any is missing. See .env.example.

Development

npm run build   # compile TypeScript to dist/
npm run smoke   # start the built server with placeholder keys and check it lists its 11 tools (no X API calls)

CI (.github/workflows/ci.yml) runs npm ci, a type check, the build and the smoke test on pushes and pull requests to master.

Repository Structure

twitter-mcp/
├── .github/
│   └── workflows/
│       └── ci.yml      # Build + smoke test
├── code/
│   ├── account_management.py  # Sample Python code for account management
│   ├── post_tweet.py          # Sample Python code for posting content
│   └── retrieve_tweets.py     # Sample Python code for retrieving content
├── src/
│   ├── index.ts        # Main entry point (MCP server and tools)
│   ├── twitter-api.ts  # X API client
│   ├── formatter.ts    # Response formatter
│   └── types.ts        # Type definitions
├── test/
│   └── smoke.mjs       # Stdio smoke test
├── .env.example
├── .gitignore
├── LICENSE
├── package.json
├── package-lock.json
├── README.md
└── tsconfig.json

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for X (Twitter) MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/twitter-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related communication social MCP Servers

Alternative and complementary servers in the same category

View all in communication social →

An AI receptionist platform with an MCP server for accessing business calls, contacts and appointments from AI assistants.

52
Communication

Pidgeon provides an MCP server and an email inbox API that gives AI agents their own addresses for sending, awaiting, and replying to email.

Repository stats unavailable
Communication