
0xhijo/mcp_twitter
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Протокол контекстной модели TypeScript для интеграции платформы Twitter/X.
Обзор
MCP Twitter — это сервер, основанный на протоколе Model Context Protocol, который позволяет напрямую взаимодействовать с Twitter/X. Он раскрывает различные функции API Twitter через стандартизированный набор инструментов, позволяя моделям ИИ и приложениям выполнять действия в Twitter. Этот сервер MCP обеспечивает следующие действия: - Создать новый пост X/Twitter - : Ответить на конкретный пост X/Twitter по ID - : Получить последний пост из указанной учетной записи X/Twitter - : Получить указанное количество сообщений, соответствующих поисковому запросу - : Создать и опубликовать поток X/Twitter - : Следовать за пользователем X/Twitter по имени пользователя - : Получить полные данные профиля X/Twitter по имени пользователя - : Получить идентификатор пользователя X/Twitter от имени пользователя - : Получить последние сообщения X/Twitter и ответы от пользователя - : Получить последние сообщения X/Twitter от пользователя - : Получить данные профиля текущего счета Вам нужно настроить аутентификацию Twitter, создав файл .env или непосредственно добавив переменные в вашу среду.
Обзор (машинный перевод)
Описание
MCP Twitter — это сервер, основанный на протоколе Model Context Protocol, который позволяет напрямую взаимодействовать с Twitter/X. Он раскрывает различные функции API Twitter через стандартизированный набор инструментов, позволяя моделям ИИ и приложениям выполнять действия в Twitter.
Особенности
Этот сервер MCP обеспечивает следующие действия:
create_twitter_post: Создайте новый пост X/Twitterreply_twitter_tweet: Ответ на конкретный пост X/Twitter по IDget_last_tweet: Получите последнюю запись из определенного аккаунта X / Twitter [[Т3]]: Получите определенное количество сообщений, соответствующих поисковому запросуcreate_and_post_twitter_thread: Создание и публикация потока X/Twitter [[Т5]]: Следуйте за пользователем X / Twitter по имени пользователяget_twitter_profile_from_username: Получите полные данные профиля X / Twitter по имени пользователяget_twitter_user_id_from_username: Получите идентификатор пользователя X/Twitter от имени пользователяget_last_tweet_and_replies_from_user: Получите последние сообщения X / Twitter и ответы от пользователяget_last_tweet_from_user: Получите последние сообщения X / Twitter от пользователя
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
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",
Установка
npx mcp_twitter