A TypeScript Model Context Protocol for Twitter/X platform integration.
What is 0xhijo mcp twitter
MCP Twitter
Description
MCP Twitter is a server based on the Model Context Protocol that allows direct interaction with Twitter/X. It exposes various Twitter API functionalities through a standardized set of tools, enabling AI models and applications to perform actions on Twitter.
Features
This MCP server provides the following actions:
create_twitter_post
: Create a new X/Twitter postreply_twitter_tweet
: Reply to a specific X/Twitter post by IDget_last_tweet
: Get the most recent post from a specified X/Twitter accountget_last_tweets_options
: Get a specified number of posts matching a search querycreate_and_post_twitter_thread
: Create and publish an X/Twitter threadfollow_twitter_from_username
: Follow an X/Twitter user by usernameget_twitter_profile_from_username
: Get complete X/Twitter profile data by usernameget_twitter_user_id_from_username
: Get X/Twitter user ID from usernameget_last_tweet_and_replies_from_user
: Get recent X/Twitter posts and replies from a userget_last_tweet_from_user
: Get recent X/Twitter posts from a userget_own_twitter_account_info
: Get current account profile data
Installation and Usage
Local Installation
# Clone the repository
git clone https://github.com/0xhijo/mcp_twitter.git
# Install dependencies and build the project
pnpm build
# Launch the server
node ./build/index.js
Installation via NPX
npx mcp_twitter
Configuration
Configuration via Twitter Scraper
- Configure the .env file:
TWITTER_AUTH_MODE = "CREDENTIALS" # Credentials mode
# Your Twitter credentials
TWITTER_USERNAME="YOUR_TWITTER_USERNAME"
TWITTER_PASSWORD="YOUR_TWITTER_PASSWORD"
TWITTER_EMAIL="YOUR_TWITTER_EMAIL"
You need to configure Twitter authentication by creating a .env
file or directly adding the variables to your environment.
Configuration via Twitter API
- Create a Developer Account:
Make sure you have a Twitter account Visit the Developer Platform Get your API credentials Follow this guide if you need help creating your developer account
- Configure the .env file
TWITTER_AUTH_MODE = "API" # API mode
# Your CREDENTIALS obtained from the Developer Platform
TWITTER_API="YOUR_TWITTER_API"
TWITTER_API_SECRET="YOUR_TWITTER_API_SECRET"
TWITTER_ACCESS_TOKEN="YOUR_TWITTER_ACCESS_TOKEN"
TWITTER_ACCESS_TOKEN_SECRET="YOUR_TWITTER_ACCESS_TOKEN_SECRET"
Integrating with Claude
To use MCP Twitter with Claude, you need to add it to your claude_mcp_config.json
file. This will allow Claude to interact with Twitter through the MCP server.
Adding to Claude's MCP Configuration
Add the following entry to your claude_mcp_config.json
file:
"mcp_twitter": {
"command": "npx",
"args": ["mcp_twitter"],
"env": {
"TWITTER_AUTH_MODE": "CREDENTIALS",
"TWITTER_USERNAME": "YOUR_TWITTER_USERNAME",
"TWITTER_PASSWORD": "YOUR_TWITTER_PASSWORD",
"TWITTER_EMAIL": "YOUR_TWITTER_EMAIL"
}
}
Replace the placeholder credentials with your actual Twitter account information. This configuration will launch the MCP Twitter server using npx when Claude needs to interact with Twitter.
Usage with Claude
Once configured, Claude will be able to use all the Twitter functionalities provided by the MCP server, such as creating posts, retrieving tweets, and more. You can simply ask Claude to perform Twitter actions, and it will utilize the MCP server to execute them.
Important Notes
- Choose the authentication mode (API or CREDENTIALS) based on your needs
- Verify that your credentials are properly configured in the .env file
- Check the official documentation for more details about API limitations
Leave a Comment
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
chrisdoc hevy mcp
sylphlab pdf reader mcp
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
aashari mcp server atlassian bitbucket
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.
aashari mcp server atlassian confluence
Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.
prisma prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Zzzccs123 mcp sentry
mcp sentry for typescript sdk
zhuzhoulin dify mcp server
zhongmingyuan mcp my mac
zhixiaoqiang desktop image manager mcp
MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)
zhixiaoqiang antd components mcp
An MCP service for Ant Design components query | 一个减少 Ant Design 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询
Submit Your MCP Server
Share your MCP server with the community
Submit Now